# Digital vs. Analog Thinking [CF Article]

1 Like

It struck me while reading this that good empirical science uses a digital methodology, even when measuring analog quantities.

We can test a physical theory by experimentally measuring one of the quantities that it predicts theoretically. In addition to predicting the quantity itself, the theory also always has something to say about what sort of error we should expect. In physics, if we are given the uncertainty in the input quantities, thereās usually a way to determine rigorously the theoretical error in the quantity being measured.

Once we have determined that the theoretical error is Ļ, this gives us a way to make binary evaluations of our physical theory: we consider a theory to be problematic iff the theoretical quantity is not within 2*Ļ of the measured quantity (this is partially a convention of course, e.g. thereās nothing wrong with using 3*Ļ as the cutoff).

A scroll wheel, joystick or mouse sends digital signals to the computer but theyāre approximately analog, e.g. we can push the joystick in a decent approximation of āany directionā to move our video game character around; itās not like those old games where you could only move in 4 or 8 directions, which is clearly a digital approach to movement.

I think the relevant distinction between digital and analog in this case is that an analog system can be adjusted in increments that are too small for you to easily distinguish. If the minimum amount you can turn a character with your joystick is 1/1000 of a degree then there are lots of directions you can point the joystick that are hard to tell apart.

1 Like

# Video Game Movement Jump to Universality

Most video games let you move in 2, 4, 8 or all directions, not counting jumping. Jumping is different than a regular movement key. Regular movement keys let you go in a direction, and you stop when you let go. You can go any amount in that direction that you want and stop when you want. Jumping has both minimum and maximum heights, and by default you fall back down.

So thereās a jump to universality where you can either move in a small number of directions or all directions. Jumping wouldnāt affect this because counting it would only increase the number of directions by a small amount.

There are a few more notable cases. One is hex grids. Most top-down games use a square grid and either allow 4 directional movement (compass directions) or also allow diagonals (so adding in north-west, south-east, etc.). This is done with the 4 arrow keys on the keyboard, plus holding pairs of keys that arenāt opposites. Itās also done with d-pads, like the NES had. Hex grid games are uncommon but they let you move in 6 directions rather than 4 or 8. Rather than dividing the area up into squares, they use hexagons, so you can move to any adjacent hexagon. With square grids, diagonal movement is faster than straight movement. You get to go further with āoneā step. Thatās an issue for turn-based games that give you a specific number of steps per turn. Thatās one of the things hex grids try to improve on. You can also make steps cost 2 actions points and diagonal steps cost 3, which still makes diagonals a better deal than moving non-diagonally twice (e.g. NW is cheaper than N+W), but that matches IRL reality. And it makes NW+NE cost more than N+N, which also fits our intuition that going out of the way should take longer than going in a straight line. A downside of hex games is that you canāt travel in a straight line in any compass direction, which people find confusing and unintuitive.

Another notable case is 8-directional movement (arrow keys plus diagonals) with analog camera turn (plus usually jumping). A lot of games do this like Doom or World of Warcraft. Some games do this but also do analog movement if you have a joystick ā they can work both ways depending on whether you play with a keyboard on PC, or a joystick with PC or console. Having to turn your camera to access additional directions generally seems to work fine. If we arenāt going forward, 8 directions is generally fine grained enough. If we are going forward, we can turn our camera to face directly where we want to go and hold forward.

An old shooter named Descent allowed keyboard controls without using a mouse. Unlike most first person shooter games, you were in a spaceship that could fly up and down. Instead of jumping, you had actual movement in a third dimension. You could play it with a mouse, and there were analog turn buttons. But consider what itās like with just a keyboard and no turning. You have 6 movement buttons plus you can press 2 or 3 at a time for diagonals. You can move in the 4 compass directions, plus up or down, plus combinations. How many total directions can you move? 26. There are the 8 flat directions, plus up or down adds 2 more, plus you can take any of the 8 flat directions and combine it with either up (8 more options) or down (8 more options). 8+2+8+8 = 26.

Where did this number 26 come from? It looks a bit arbitrary or weird. The previous main numbers were 2, 4 and 8. They are powers of 2. Why didnāt it turn out to be 16 or 32 next?

When we went from 2 to 4, it was due to doubling the number of dimensions you can move in. We went from 1d to 2d. Going from 4 to 8 was due to allowing diagonals instead of only moving in one dimension at a time. If a 3d game didnāt allow diagonals, itād have 6 directions of movement. The pattern without diagonals is 2/4/6 ā each additional dimension adds 2 more ways to move since you can only use one dimension at a time. The pattern here is adding 2.

The pattern with diagonals ā with moving in more than one dimension at once ā is 2/8/26. For 1d games, there are no diagonals, so allowing them doesnāt make any difference. Thereās a pattern here but it isnāt actually related to the number 2.

The apparent pattern with doubling ā 2/4/8 ā was due to doing two different types of changes. The first change was adding a dimension and the second change was adding multi-dimensional movement. Those arenāt the same kind of thing. The proper patterns come from just adding a dimension multiple times ā the same change repeatedly ā and seeing how the number of movement options goes up. The rule about multi-dimensional movement shouldnāt be changed ā either have it allowed or disallowed the whole time.

The pattern for 2/8/26 is powers of 3 minus 1. Why? The minus one is because we arenāt counting standing still as a movement option. We left out one way of moving. Arguably, the correct numbers are 3/9/27 ways to move, once you count standing still.

Why is it based on powers of 3? Youād expect powers of 2 when you think of it in terms of 2 choices per dimension. E.g. you can go north or south. But itās really 3 choices: north, south, or donāt move in that dimension. We need to be able to stop moving in the north-south dimension, not only to stand still, but also to go east without it being a diagonal like north-east.

So for each dimension, we have 3 choices, which we could call forward, backward or donāt move. So thatās why itās based on powers of 3. If you have 3 options in 3 dimensions, you get 3^3=27 total combinations.

You can look at movement as trits (in balanced ternary) not bits. Thereās 1 for forward, 0 for still, and -1 for backwards. For a 3d game, your movement inputs are 3 trits which form a 3 digit ternary number.

Another possible way to add directions without a jump to universality would be half-diagonals like NNW (north-north-west). NNW is halfway between N and NW. The point is to take the 8 angles you can move at and split them all in half so you have 16 directions. One way to achieve this is by having two adjustments keys: clockwise-adjustment and counter-clockwise-adjustment. If you hold one of those keys while moving, your movement will be angled an additional 22.5 degrees (1/16th of a full circle). So E is 0 degrees, E + counter-clockwise adjust is 22.5 degrees, NE is 45 degrees, NE + counter-clockwise adjust is 67.5 degrees, and N is 90 degrees. You actually only need one adjustment key but it seems convenient to have the angle adjustments in both directions, so you can also get 67.5 degrees by doing N plus clockwise adjustment.

Do any games have half-angle adjustment keys? Probably something, but Iāve never heard of it. People either seem to find that level of detail unnecessary or they want full analog movement. The one exception I know of is special custom-made controllers for Super Smash Bros. Melee. The game itself expects analog movement inputs with a joystick, but people have created custom hardware to control the game, and at least one of the controllers (the Smash Box) has only buttons with no joysticks. It has a tilt-modifier system which is a bit like half-angle adjustment buttons but more sophisticated and complicated, and it uses more buttons to do it. It enables you to have a lot more than 8 directional input choices without being analog. Thereās some reasonably small, clearly-finite number of total options like 128 (I donāt know the actual number). Although systems like this are possible, Iām unaware of any game that uses them ā the Smash Box implements them in the controller itself (the game expects joystick inputs, and the Smash Box provides any of e.g. 128 joystick inputs based on which buttons are held ā it does not use the full range of joystick input values). The Smash Box also has angle customization features ā if none of the ~128 possible directional inputs do what you want, you can customize the buttons so they do different inputs. You donāt get a larger number of inputs but they can have different values. E.g. if you really need to move at exactly an 11 degree angle, and that isnāt one of the 128 default options, then you could customize it to make 11 degrees one of the options. This is useful (and debatably an unfair competitive advantage) because SSBM has tricks that require, or are done fully optimally, using very specific angles that cannot be reliably/perfectly done with a joystick. For this reason, some joystick users cut precise notches in the plastic around the joystick so the joystick can be held in a notch to get a specific angle (itās hard to do this really precisely, so people pay experts to add notches and do some other improvements to controllers, and then the notches or another part of the controller wears out and they buy it again). Gamecube controllers are designed with 8 built in notches ā the joystick housing is an octagon not a circle ā which is really helpful for letting users reliably/consistently input the standard 8 directions like N or SW. It helps high skill players in a bunch of games. But I donāt think any of the modern consoles have notches anymore, just circles, so itās hard to e.g. move directly forward; I donāt know why they made this worse.