Nailing character controls

Every great action-exploration game has one thing in common: tight, responsive controls. If the character doesn’t respond in a consistent, intuitive way to your commands, the game is going to be frustrating to play at its most basic level. Control is so crucial that I’m spending quite a bit of effort early on to make sure it’s perfect. There are project dependency reasons to focus on this up front as well — knowing how high and far a character can jump, for example, can profoundly influence level design.

Like everyone who saw it, I was deeply inspired by Bret Victor’s talk about game development at Inventing on Principle. The most relevant portion is reproduced below:

I’m not nearly as fancy as Victor is, mostly because I don’t want to spend as long on my tool chain, and because my choice of language (C#) makes his demo slightly more complicated. But the basic idea of being able to play around with simple variables at runtime, without having to recompile or restart the program, struck me as absolutely vital. So I built my own small system to let me do that.

This version allows you to increment or decrement various character control parameters as you experiment with them. The hardest part is actually knowing which parameters might be important and how to use them to produce engaging control characteristics.

Just as a simple example, what happens when the character is standing still and the player presses right on the stick? Do you start accelerating to the right at a constant rate? In practice I found this makes the control feel beyond sluggish. I have my character instantaneously accelerating to a pretty good clip right away, then accelerating smoothly afterwards up to a maximum speed. Both these parameters are configurable so I can play around with them to see what feels right.

Jumping is even more fraught. It’s important to the player’s sense of control that holding down the jump button longer makes the character jump higher, but how to implement this behavior is anything but straightforward. For now, I have a few parameters controlling it: the initial jump speed; how much to accelerate the character for every frame the button is held once airborne; and how long this effect should persist. It’s interesting to play around with very high values for the latter two variables — setting the air boost variable above the acceleration due to gravity turns you into a rocket.

I’m also realizing that I really need to be able to fool around with gravity in this sandbox. At the moment the jumps feel downright floaty, which is an artifact of the character launching off at over 10 meters a second — it’s gonna take you a while to fall back to earth with that kind of kick. For reference, each of the tiles in the game world are one meter wide, and the character is two meters tall. Since you want a brief tap of the jump button to result in a tiny little jump, it’s becoming clear to me that the initial jump speed will need to be much, much smaller, and that the air-boosting effect will need to be much more prominent, probably involving a fade function of some sort to diminish its effect over time.

Leave a Reply