MMOrpg Combat Lab
Technical Specification · Space

Space

Player position plays a significant role in MMORPG combat strategy. For this simulation, we are going to start with a simple, two dimensional coordinate system.

§ 08.01

The Grid

We'll represent the arena as a 32×32 square grid, in which only one entity (player/boss/minion) may occupy a given square at any point in time. This should be large enough for most scenarios but can be expanded as we define more complex encounters if needed.

32 × 32 Grid — hover to explore coordinates  
Boss Cleave Zone Tank Melee DPS Ranged A* Path
§ 08.02

Movement

Meters per Tick

To define movement within the grid, we need to first define player speed. MMORPGs like WoW set a base movement rate around 6.4 meters per second (or 7 yards/s). Using a standard speed of 6.4 meters per second, a player moves 0.64 meters per single 0.1s engine tick.

Ticks per Square

If we establish that each square of the grid is 2 × 2 meters, we can determine the number of ticks it takes to move one square in an orthogonal direction (North/East/South/West):

To find the diagonal movement speed across squares (North-East, South-East, South-West, North-West), we use the Euclidean distance formula to find the diagonal length of the square:

Then we can find the number of ticks it takes to move across 1 square diagonally:

Simplifying for Stability

Since our game engine ticks every 0.1 seconds, it won't resolve movement gracefully if there are floating points in our tick math. A common best practice is to round these to whole numbers and accept a slight amount of error. For our simulation we'll set the following rules:

Orthogonal Movement
3 Ticks per Square
N / E / S / W  — rounded down from 3.125
Diagonal Movement
5 Ticks per Square
NE / SE / SW / NW  — rounded up from 4.4

This makes orthogonal movement a tiny bit slower and diagonal movement a tiny bit faster, but overall makes for a much more stable state for entity position.

Implementing Movement

Every engine tick of 0.1s we'll increment a counter and only when we've reached the number of ticks per square (3 for orthogonal, 5 for diagonal) will we actually move the entity to the next square in the path. This ensures that an entity is always occupying only a single grid space, not overlapping.

§ 08.03

Pathing

Under the hood, we'll be using a pathfinding method known as A* (A-star) pathing in order to determine the shortest path between starting and destination coordinates, taking into consideration obstacles an entity must navigate around. We've put together a simple interactive demo using easystarjs.com to illustrate the basics — click any cell to place a wall, then watch A* route around it in real time.

A* Pathing Demo — mmorpgcombatlab.com

Editor's Note

Pathing Logic / Gambits TBD.

Reference Table