So I finally did a research on SPEED.BIN file, because I wanted to make an editor for it. This file is really small and structure is pretty simple, so finding out what it does was a piece of cake.
Here is the structure:
- 32 floating-point numbers (4 bytes each)
- 4 strings for speed names (32 bytes each): "Infantry", "Tracked", "Wheeled", "Flying"
- 128 zero bytes (probably unused)
All investigation was just about those 32 floating-point numbers. And, here is the tabular visualization of them:
The rows are "Speed Modifier value" and columns are speed types. And numbers in cells are speed multipliers, for example, if the number is 0.5 it means that unit can move half its original speed.
Now I will explain what does the "Speed Modifier value" mean. Remember tile attribute editor and those last three attributes that affect the unit speed?
These three attributes are in fact Speed Modifier bits. Three bits can make a value from 0 to 7:
Rock = bit 1 (value of 1)
Dunes = bit 2 (value of 2)
Rough Rock = bit 3 (value of 4)
The speed modifier value is sum of those bits. If all three attributes are set, the value is (1 + 2 + 4) = 7, if no attributes are set, the value is 0, and for example if "Rock" and "Rough Rock" are set, the value is (1 + 4) = 5.
Then for the speed modifier value, respective row from table is selected. So for example if "Rock" and "Rough Rock" attributes are set, then infantry will move 0.7 of their original speed, and both tracked and wheeled will move 0.5 of their original speed.
And for example if you select all three attributes, surprisingly all the units will move their full speed.