Skip to main content

Command Palette

Search for a command to run...

Grapple Physics Perfected

Updated
3 min readView as Markdown

TL;DR

  • The original grapple took 30mins, perfecting it took weeks

  • The journey involved two physics systems and several adjustments

  • AI wrote the code, but 'the feel' required a lot of human playtesting


The original grapple physics I built a few weeks back was very rudimentary: fire 45° left or right and connect to whatever rock you hit

It sometimes worked well, but too often left you hitting the floor mid-spiderman-flow, when a ceiling ahead was too far up in the cave.

I decided the grapple needed to be a bit more clever.

Attempt 1: Rope-length system

This first attempt to improve it took any long diagonal shots reaching a ceiling too far away, and bent them closer to Pip.

I introduced several tuning dials, vertical band, floor angle, rope distance, etc., which were nudged independently trying to find a sweet spot.

It worked well sometimes but not always, and still didn't feel quite right.

Attempt 2: Cone/ray-fan system

This time I asked Claude to explore how expensive it would be to compute several grapples at the same time and somehow choose the best one... the answer was promising, not expensive at all!

This approach involved fanning out several rays from 45° all the way to straight up 0°, and calculating a score for each. This score would take factors like difference from 45°, rope length, etc. and apply a biased points value.

The grapple ray with the best score would be selected, all in the blink of an eye, invisible to the player.

https://youtu.be/_jz7jaAzKmw

Tweaking and Playtesting

Even with the new engine up and running, every now and then a grapple would do something unexpected, leaving Pip un-spiderman-like.

As you can see in the above video, I introduced an overlay which fires on every grapple, printing information like the firing angle, the calculated score/cost, etc. I also visualised the full ray-fan spread, with the winning ray in green to see which rays landed where, to guide any further tweaks.

I introduced several debug keys which allowed me to fine-tune certain values in the game in realtime until it felt right, e.g. the range/size of the cone, the penalty for rising in height, etc.

This was a great example of where AI can be extremely powerful, developing multiple physics systems in a short space of time, allowing me to actually try them out side by side, and introducing levers to tweak the experience instantly.

The AI could not, however, figure out the right values for the best game feel.

A great example of built by an AI, perfected by a human.


Published Friday 7th August 2026 at 6:00 PM