Home Artists Posts Import Register

Content

There’s a moment in the Context Sensitivity video where I talk about first person shooters and how the directions you can move are “technically limited by which direction you’re facing”. The example footage from Quake does a lot to illustrate the point but I’ll try to sum it up in words: Since most FPS games assume 4 directional keys for movement, you can only move in 8 directions on any given frame. There’s complete freedom among these directions as long as the camera can be moved around but assuming the camera needs to be pointed a certain way (such as when aiming at an enemy), you can only move in 8 different directions relative to that camera orientation. Of course this is not necessarily true if a game supports analogue movement.

Allow me to explain why I think this nuance of movement is more consequential than it initially seems. I’ve been playing Neon White recently and it’s a perfect example of how important this dynamic can be. If you’re looking to shave a few milliseconds off your Neon White times in any given level, I have a simple piece of advice which is surprisingly effective: look in the direction you want to move. Why? Because the game normalizes your movement vector regardless of what keys you press. I’ll explain what that means.

In games it’s sometimes useful to express certain mechanics as vectors. This is basically just a cool term for numbers which correspond to dimensions in space, two for 2D; three for 3D. Imagine 2D Link standing in an empty screen and also imagine that pressing the direction buttons causes him to walk at a speed of one pixel per frame.

If we press right on the d-pad, his movement vector would look like this: (1, 0). Move 1 pixel in the X dimension (rightward) and 0 pixels in the Y direction (no change) each frame.

If we press down, his movement vector would looks like this: (0, 1). Move 0 pixels in the X dimension (no change) and 1 pixel in the Y direction (downward) each frame.

Pretty simple so far, we’re just saying the character should move at a certain speed when the button is pressed but something interesting happens if we press diagonally.

If we press both right and down, his movement vector would look like this: (1, 1). Move 1 Pixel in the X dimension (rightward) and 1 pixel in the Y direction (downward) each frame.

Picture this outcome in your mind. Link is moving both directions with a speed of 1, this gives him a total speed of 2 so his effective speed has increased compared to the other examples. This doesn’t break the game or anything but it’s a little strange and doesn’t fit with the premise the game is trying to sell. Link is supposed to be a person who exerts himself to move from one place to another, why would he arbitrarily move faster in some directions than others? It doesn’t make any sense and although it’s not a game-breaking issue, it might feel unsatisfactory as a result.

This is where normalization comes in. A normalized vector always has a total length of 1. At this point you might think 0.5+0.5 = 1 so it’s a pretty easy fix but unfortunately that’s not how it works. Maths is not my strong suit so take this with an iota of salt but you can basically think of the outcome like a triangle. The (1,1) vector is the width and height of the triangle and we want to move along the hypotenuse to our destination. The length can therefore be calculated using the Pythagorean Theorem you might remember from school. In this case the correct result is actually about (0.7, 0.7). If you want to learn more just read up on Unit Vectors. Basically, diagonals need to be handled carefully in order to result in a speed of 1. The process is much the same for 3D only with an extra number and thus some extra calculation.

While some developers have made this diagonal movement mistake, most know to normalize the inputs so that movement is the same speed in all directions which is useful knowledge for a game like Neon White. Assuming the movement vector is normalized, there’s no inherent advantage to pressing certain directional keys, any combination will give the same amount of total speed. Therefore if you see something in the distance you want to reach, the fastest way to get there is to point your camera directly at it. If you’re not looking at the target, your vector will almost certainly be misaligned. Imagine the goal is in the distance but slightly to the left of your crosshair. Without moving your mouse, your only two movement options are forward or diagonally to the left but both of those movement paths are suboptimal because they don’t quite align with the destination. Remember, the shortest path between two points is always a straight line. It is possible for that line to perfectly overlap with any of your 8 movement directions  - in which case you could walk diagonally to the target at full speed for example - but it’s much, much more likely to happen at the front since you can visually confirm you’re lined up correctly and make fine-tuned adjustments using your mouse.

This is already hugely consequential for the gameplay but it becomes even more important when you realize that sometimes there will be targets off the desired path which you need to shoot. Sometimes the best path through a level requires players to move in one direction while shooting an enemy elsewhere. In those cases, players are rewarded for eliminating their target as quickly as possible because this allows them to realign their view to their desired direction more quickly, which increases the effectiveness of their movement. Put simply, it pays to have good aim because this allows you to return to what you really want to be doing: looking in the direction you intend to move.

While every game is different, I think it’s an elegant and desirable outcome for a game like Neon White where part of the appeal is trimming milliseconds off your time. It makes every little delay with aiming matter because every frame spent looking elsewhere is a little less than optimal.

Comments

SteveReen

Liking these smaller blog posts so far. I really loved Neon White, I think I got something like half of the red medals before I became occupied with other things and stopped. Would be cool to go back to it and go for the rest sometime. The vector combining issue (without normalization) described here is something I started calling "square root of 2 syndrome" haha. I know GoldenEye has that issue which is why in speedruns of that game people are always running diagonally.

tatsudon

There is another aspect of movement in modern shooters that is "technically limited". I personally don't like sprint in games, but it is prevalent nowadays. And most often you can only sprint forward, which makes sense, but is so limiting. Case in point is Titanfall 2. Max speed is naturally the most desirable and most enjoyable, so I had to learn the lesson you described back there. Always look in the desired direction, otherwise you are as good as standing still.