Grappling hooks are present in a few other VR games (like Windlands), and are the embodiment of the motion of the most famous arachnid superhero. When we first began working on our own grappling hook locomotion mechanic, we were fortunate enough to be able to draw upon games like Windlands for ideas before we even started programming. We knew our version of a grappling hook needed to be different in the physics of the rope pulling on you to make it easier to chain together your swings. But this post isn’t about that. This is about a new feature we created, to fill in the gaps that other implementations have left. For the purposes of this article, you can think about the rope between the player and their hook simply as springs.
The spring model works pretty well, but it makes it hard (or impossible) to execute some specific types of movement. Say, for example, I’m falling from high up. If I grapple towards something in front of me, I expect to be able to transfer some of my momentum forward, as shown below
However, with a spring, nearly all of your momentum is absorbed by the retracting nature of the spring, unless you are at just the right distance from the object you grapple on, and going the perfect speed. So that’s no good.
Instead of modelling the physics differently to accommodate this motion, we decided it would be best to implement this as a separate feature. Giving the player a button which allowed them to essentially “switch their physics”. Having more movement options is an inherent part of what makes games fun. Think back to Mario 64 and how much better that game is for having a triple jump, and a long jump.
So this new physics needed to allow “Rope Swinging”. Sounds simple enough. When you press a button, you “latch” on to the rope so that it stops retracting like a spring, and has a fixed length. This will let you move in a circular path around where you hooked, like this:
All good, right? Well, until you approach from angles like this…
Now sure, as a developer it would be easy to say:
“It's obvious that it would work that way if you fixed the length of the rope, because there is slack in the line now”.
While there is truth to that, it makes the mechanic very hard to use, and similar again to the “just the right speed and distance” problem that the spring model has.
The desirable outcome would be this: regardless of your timing, latching onto the rope would yield a successful monkey swing. We made a slight modification to the system: whenever you latch the rope, its length is fixed and all its radial velocity is killed. This makes your path look something like this:
While this worked well, and was quite learnable, it had the undesirable outcome of still killing your momentum. It could also be uncomfortable at times when you had such sudden changes in direction. The model was useful when your velocity was tangent to the circle you would go in, and otherwise pretty silly, effectively turning your “rope” into a “rod”.
Our solution was essentially designed such that when you enter the circle part of the path, you are moving tangent to that circle. To make this happen, you continue to move in a straight line, and use the shortest distance between that line and the hook to make the radius of your circle.
This model makes very little physical sense, but is vastly superior to the previous models in terms of usability. Almost every time the player grabs, he will get a motion which is useful. More importantly, the motion is smooth, not jerking the player. Removing that jerk turns out to be very important in VR, because of the prevalence of motion sickness on the platform.
The downside is that to use this most effectively, the player needs a fairly accurate understanding of the direction of their velocity, something most people aren't that naturally good at. However, it is pretty easy to learn, so we decided the added benefits of this model outweighed any negative.
Now, our grappling mechanic has two functionalities: it can act like a spring, and it can reel in to a fixed length, allowing the player to better “swing”. Knowing the player can freely choose which mode to be in expands our options when designing levels, allowing new obstacle types. But overall, it adds an element of depth that a game based on movement so clearly needs.