Aztez – A Game of Conquest and Brutality
14Mar/135

Walking And Running Implementation

When analog sticks were born, the way walking and running was implemented in games changed. But before I go into that, it's important to understand the key differences between the joystick on a traditional arcade machine and the little analog stick on your console controller. When you push on an arcade stick, it's pressing down on one or two of four different little buttons that lie underneath the stick. Each button only has two states: pushed and non-pushed. So when you push the stick upward it's going to press on the northern button and when you push the stick up and left it's pressing on both the northern button and the western button. Now when you push on an analog stick, it's cross-referencing two different axises (a "left to right" axis and a "up to down" axis) and the controller is finding the precise location the stick is resting at, which could be anywhere inside that plastic circle your analog stick is poking out of. With all this extra possibility space, you can alter the way the player tells the character on the screen to move. What I'm gonna talk about here is the three major ways this can be done based on the implementation across a handful of different games. The first variant of this is the most straightforward.

In these images the circle represents the analog stick possibility space. When the stick is not being touched it is resting inside the "deadzone". The deadzone is a very important mechanism on sticks of all kinds because it prevents input from registering until the stick is pushed on a specific amount. The reason you want this feature on a stick is to make it less sensitive to three meddling forms of very minor input:

  1. The thumb or finger of the player lightly pressing the stick.
  2. The stick being very subtly "stuck" a little bit in one direction.
  3. The microscopic bouncing that happens when the player lets go of the stick from a tilted position.

Truthfully, these three things are constantly happening but you don't know it because we game developers have been smart enough to make sure there is a deadzone on the sticks we make games for. Getting back to the this specific implementation, it was used in Viewtiful Joe but is the same in just about every traditional beat-em-up, since they couldn't help it on account of their simple joysticks. By pushing the stick past the deadzone, the character will move in the direction pushed at a specific speed while a movement animation plays at a specific speed. Very simple and again, very traditional. Easy to implement in every case. This next one is a little more complicated.

Devil May Cry and Bayonetta have given the player the ability to walk at a slightly slower rate if they so choose. By pushing the stick past the deadzone but not full-tilt, the character will walk in the direction pushed, and they will do so at a specific speed while a unique walking animation plays at a specific speed. When pushed all the way to the edge the character will run, and they will do so at a specific speed while a unique running animation plays at a specific speed. Slightly more complicated but not particularly difficult to implement, even in 3d. This last one is the most realistic looking of all these three major control types, but also the most convoluted and difficult to implement.

The characters in these games have two different movement animations: a walking and a running. Based on how far the analog stick is being pressed, the animations will not only be blended into each other at different values (which only works with 3d animation), but the character will be moved at a very precise speed somewhere between not-moving and full speed. So if the player is pushing the stick 75% out from its default position in the deadzone, the character will be employing 25% of the walk animation data and 75% of the run animation data and will be moving through space at 75% of the character's top speed. It's why you can do everything from a slow tiptoe to a gallant trot to full-blown running in these games. But it's also very difficult to implement as the animations not only need to look good individually, but they need to look good at varying degrees of animation cross-fade. Personally, I find this all moot since no one ever walks in a beat-em-up unless they are specifically incentivized by the game. So we're just going for a very straightforward run only scheme.

There is a little bit more going on here under the hood but only because we will be using up and down in attack mechanics; it would be frustrating trying to push up or down in a combo and have the game think that you are trying to move. So those upper and lower quadrants act as a deadzone, but only when it comes to movement. Hope this was helpful for you in your own implementations. :)

  • Aaron Burch

    Have you ever seen a beat-em-up game that incentivizes walking over running beyond sneaking? I’ve only seen it as a punishment to being hit by certain attacks or as a drawback to charging a move or the like.

  • I never have, no! But that doesn’t surprise me though; I feel like the whole notion of lightly tilting a stick to run while KNOWING you can walk just isn’t fun. I mean I definitely enjoyed sneaking around in Mark Of Kri, but that game is an exception to the action game rule in just about every way. But like you suggested, that’s a stealth gameplay consideration which is different.

  • Ozzie Smith

    I think games like God of War that do have walking are games that generally also have some amount of focus on platforming, where the extra control is needed. Although unless you count the stealth sections in Metal Gear Rising, I haven’t seen a beat-em-up ever require/encourage the player to walk during combat.

  • VictorBorgesAngelo

    I always thought that the walking speed was for positioning your character and avoid attacks.

  • The Fool Who Bears The Name Freedom

    I use walking, sometimes, but never for a game reason. Sometimes I will walk into a boss room if I can see the boss through the door, just because it feels like that’s what the character (who is a badass and doesn’t care what this boss thinks of him, and I haven’t played Bayonetta yet so it is always a him). Sometimes I will deliberately walk away from the scene of a point of dramatic impact, for largely the same reason that it’s the kind of thing the character would do. Having recently played Asura’s Wrath, I sat at the “Press RS left now” prompt for several minutes before initiating the Most Moving Fist Bump Ever.

    So being ABLE to walk is kind of important to me. Putting it on the thumbstick, though, is the completely wrong place for it. Give me a button, a bumper to press and hold to deliberately walk (and not a toggle–it’s not right for the feel). Because thumbsticks, ergonomically speaking, are complete garbage to press in a direction without going all the way to the physical limit of motion.