2D Movement Systems (and how to steal ideas)

2D Movement Systems (and how to steal ideas)

By Brian J. Lancaster (December 2026)

 

I decided to go 2D with Warlordocracy so I could spend less time making maps and more time writing branching dialogue and scripts. And naturally I went with real-time-with-pause since it is objectively superior to turn-based in every conceivable way.

However, there are two important kinds of 2D movement: tile-based and vector-based. Warlordocracy is tile-based because it's easier, and the calculations are much simpler. This will have a noticeable effect on framerate when there are 100 soldiers fighting each other in real time, running AI scripts to decide which items/abilities to use, etc.

Movement in a real-time, tile-based game will require a delay after each move. The best way to represent this delay is a gradual shift to the next tile, preferably while the sprite plays a walking animation. Movement in this system is limited to 8 directions. Examples include Warcraft 1 and 2, as well as StarCraft 1, though each tile in the latter was sub-divided into 16 sub-tiles to make it smoother.

 

Each tile in StarCraft is subdivided into 16 mini-tiles, and they fixed movement speed with trig, but units can still only move in 8 directions.

 

Tile-Based 2D

Warlordocracy is tile-based 2D, no trigonometry required in the code. Distance is measured by whichever axis is further away: X or Y. You don't even need A^2 + B^2 = C^2. There should really be a different name for it, because it takes too long to say and Pythagoras just stole the concept and used it to start a sex cult that counted beans.

 

Oldest known record of A^2 + B^2 = C^2, from ancient Babylon, 2000 BCE


Without trigonometry, unfortunately, it is impossible to move diagonally at the same speed. This would require the square root of 2, which yields an irrational floater:

1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727...

This could be solved in a half-assed manner by multiplying the diagonal movement speed by 1 / the square root of 2, which is pretty close to x0.7071 movement speed, but it will never be perfect because it's still an irrational number.

In Warcraft 1 and 2, diagonal movement was always faster. Moving a peon diagonally from one corner of the map to the opposite corner will take the same amount of time as moving him straight across the map, despite the difference in physical distance.

StarCraft 1 fixed this by finally using trig. It still uses tile-based movement, and units can still only move in 8 directions. However, when moving diagonally, StarCraft adjusts an invisible variable for unit rotation by 45 degrees, and then it calculates the distance with forward vector movement (trig).

Chrono Trigger does the same thing without tile-based movement, so diagonal movement is the same speed, though I hear the PC port kind of fucked this up.

Chrono Trigger PC Port: https://www.youtube.com/watch?v=nSg2D7PWnpY

Even 3D games that require trig for other tasks often forget to calculate diagonal movement using trig. This is apparent in games like Golden Eye, where pressing two directional buttons at once will make the player move faster. The game uses trig to make the player move normally, like all gridless FPS games, but it forgets to normalize movement when pressing two directions at once (not sure why).

Prime examples of 2D games with tile-based movement include Warcraft 1+2, StarCraft, Final Fantasy 6 (and older JRPGs), as well as most tactical RPGs. The main disadvantage of tile-based movement is that you can't have satisfying vehicle mechanics due to the 8-direction limitation (though admittedly I still have not played Cataclysm: Dark Days Ahead).


Cataclysm: Dark Days Ahead vehicle rotation

 

Vector-based 2D

With gridless movement, you can have 360 degrees of rotation, making for smooth vehicle mechanics. You don't need to worry about diagonal movement, since all movement is handled the same way. Unless your chosen engine has a command called something like "move sprite forward", you will need to copy/paste the following trigonometry equation for forward movement (where D is distance or speed):

The Andrew Yang Algorithm

 

Oddly, DarkBASIC had a "move sprite forward" command, which moved the sprite based on its current rotation. When I started making my 2D mobile game with vehicles on AppGameKit, by the same company (www.thegamecreators.com), there was no such command. Instead, I had to copy/paste the above trig equation.

Examples of 2D games with gridless movement include Baldur's Gate 1+2 (and all Infinity Engine games), as well as Chrono Trigger and newer JRPGs.

There are two ways to animate sprites in vector-based 2D movement. You could use spritesheets with the character facing 4 or 8 directions, like Warlordocracy, StarCraft, and Chrono Trigger. This is useful because you can see the characters in much greater detail, including their faces.

The other animation method is showing the characters from a complete top-down perspective, so you only see the tops of their heads. This is useful because you can rotate them 360 degrees and you won’t have to animate each direction. The downside, of course, is you can’t see their face on the map. Examples of this include Hotline Miami, as well as Grand Theft Auto 1 and 2.

The phone game I started a couple years ago and shelved uses vector-based 2D movement with a top-down perspective, and it was my first time coding vehicle mechanics with 360 degrees of rotation, acceleration, etc. The prototype is a sci-fi setting and includes a desert map, a jungle map, and a space map with asteroids. There should be something out early next year, maybe for free.

 

Appendix A: Ripping Off Ideas

Everybody rips of ideas for their games, but it's important to remember that there is an objective hierarchy of source material. The most prestigious place to steal ideas from is real life, and the most scummy is generative AI. Behold the list:

1) Real life = Ultimate

2) History = Prestige

3) Novels = Educated

4) Movies = Cultured

5) Other games = Average

6) Musical theater = Trashy 

7) Gen AI = Scum (acceptable for generating long lists of character and geography names only)


Appendix B: Shameless Plug

Warlordocracy Chapter 6 is out now!

 


Steam: https://store.steampowered.com/app/2498150/Warlordocracy_Ch_6/




 


 

Comments