# What do distance units mean?

In XCOM configuration files, distances are expressed in some obscure units, that do not translate to grid cells easily.

Example values:

• most weapons range: 27
• sniper rifle range: 100
• soldier (and most enemies) run distance: 12
• thin man run distance: 15
• cryssalid run distance: 20

A soldier definitely does not run 12 grid cells straight.

So, what are distance units in grid cells, and how distances are calculated diagonally?

-
I couldn't really make sense of it from in-game. I think the soldier moves 7 tiles in a straight line in a half-move or 15 while sprinting. This doesn't seem to line up well with these numbers. Additionally, there appears to be some cost for changing height - even if it's a gentle slope instead of a step up or jump down. – agent86 Oct 29 '12 at 1:16

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)

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

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.

-
Also, mutons just helped me to check that a shotgun does not have a shorter range than an assault rifle. The range is the same as rifle and as vision range. – Orc JMR Nov 27 '12 at 16:16
Summarized your findings, Orc JMR. Sadly, not much to add. – David B Nov 28 '12 at 16:50
This is brilliant. How would this work if there was a 3rd axis? How do you calculate that? – Sam Mar 8 at 21:59

My own theory was 0.625... But then I went and asked.

@SolomonJake A tile in XCOM is 96 unreal units squared, which is 1.5m in real world units.

So it is 1.5 meters per cell. But the calculations are trickier. Let's assume config files state meters:

• Single move: 12 meters / 1.5 = 8.
• Double move: 24 meters / 1.5 = 16.
• Vision range: 27 meters / 1.5 = 18.

All values off by one. A ghost of additive modifier is upon us again :-)

After reading Jake's response, I have been laying out calculations and for some reason have set 0,64 as cell-to-config-unit ratio (as if a meter was 64, and a cell was 100 unreal units, which is false). And numbers made sense - 7.68, 15.36, and 17.28, just round down and voila. But it is wrong :-(

-
It's 5/8. Why 5/8? No idea. – Raven Dreamer Nov 28 '12 at 12:29

Unit is tiles.

`move distance`
A normal (without any move bonus) soldier move 6 tiles twice, or dash 12 tiles once.

`Visual range`
my experience about 17 tiles, but mission almost at dark night, attenuate is possible.
(Yesterday, I'm LUCKY catch a different test.
council mission, Russia, territory is a radar station, 2:00 AM seem Dawn not so dark.
When my soldiers climbed to the roof of station, they FOUND some enemy still inside fog of war, just near edge, only red frame showed.
The most interesting was, there was no encounter trigger, and no one can shoot them. Still need send someone to encounter them laster.
I guess that's long visual range mean, SEE enemy inside fog of war.)

`weapon range`
Can't test exactly.

-
Soldier moves 7 or 15 tiles, not 6 or 12. Test again. Units are NOT tiles - or else a shotgun would fire for 27 tiles. – Orc JMR Dec 10 '12 at 6:23
The tiles witch soldier standing distance 0, and can move out 6 tiles, it's looks like blue movable area has 7 radius. Can't shoot enemy out of sight, so normal weapon range unimportant. – Tiger_Zhao Dec 11 '12 at 1:27
Think in steps, not distance. A cell next to a soldier is distance one, then two.. there are seven cells between the soldier and movement zone edge. Make sure your soldier is not changing height - vertical movement is also counted. Weapon range is important, but it is equal to sight radius. Sniper rifle has range 100, and a soldier CAN shoot ouside his own sight. – Orc JMR Dec 11 '12 at 8:01
SO STRANGE. archangel armor soldier 6, ghost armor(+3) soldier 9. whatever it's called tiles/cells/steps, on deck of Supply Barge, I hold down right-button and count carefully, that's my result. – Tiger_Zhao Dec 12 '12 at 2:13
Here are my screenshots, new game, rookies: imgur.com/a/22L1W To be honest, I've modded the game some time ago, but never changed `mobility`, and the mod should've been overwritten with updates. – Orc JMR Dec 12 '12 at 15:04