What do distance units mean?

how distances are calculated diagonally?

They are simply calculated with pythagorian distance equation, rounded.

In A column and 1 row, I put 1 to 15. Then I put this formula in B2, and copy pasted it down and to the right: =ROUND(SQRT($A2*$A2+B$1*B$1),0)

straight line travel distance for half move and full move

A full move is 15 squares and a half-move is 7 squares (15/2, round down). The diagonal half-move is highlighted red - you can move 5 squares diagonally in a half-move, because that square is 7 units distant from the origin of movement. Obstacles and elevation use some of the 15 unit move allowance, as the soldier no longer moves in a straight line (look at the glow trail before moving).


what are distance units in grid cells

various unit conversions

A couple theories are show in the above picture. We can be pretty sure that a config unit is between 90 and 96 fictional units, between 0.625 and 0.667 cells. This might be precise enough to do whatever you want to do with config units. In game with the default ini, the only distance we don't understand is: at what range does a squadspotted sniper rifle shot fail (62-67 cells - approx 4 full moves). All the other distances are verifiable by examination. Embrace the pragmatic - if you want some distance to be longer, increase the value.


Here is an answer that explains all apparent issues with arithmetic, e.g. the "off by 1" issue, or ghosts of additive modifiers.

The exact conversion factor of tiles/mobility is 0.666. This differs from the intended factor of 1/1.5 (or 2/3), which equals 0.666(6) in decimal, with an infinite number of trailing 6's. Since the game cannot process infinite precision numbers, it truncates it to 0.666, with 3 or more trailing 6's. Because of this, we now have 1/0.666 or 1.5015 mobility points per tile.

For example, with mobility 12 we have:

blue move: 12 * 0.666 = 12/1.5015 = 7.99 => round_down(7.99) = 7 tiles yellow dash: 12 * 0.666 * 2 = 15.98 => round_down(15.98) = 15 tiles

So we get the actual 7/15 tile movement instead of the intended 8/16 tiles for mobility value of 12.

I tested all movements (single/double for straight and diagonal) for all mobility values between 3-30, and have confirmed that the factor of 0.666 correctly predicts 100% of the cases with the assumption that fractional number of tiles are always rounded down.

I've updated the ufopaedia.org page on Movement, and said more about this in the discussion page

This conversion also works for the range and radius of throwables (e.g. grenades). For example, an AP grenade has a blast radius of 5.6 mobility, which equals 5.6 * 0.666 = 3.73 straight tiles, which rounds down to a 3 tiles, and also 5.6*0.666/1.414 = 2.6 diagonal tiles which rounds down to 2 diag tiles.