Awesome, Klof. Thanks for looking into this. I take it this has to do with the way terrain interacts with unit speed, not necessarily the units' speed itself, judging from the research done. If that's the case, I guess the behavior that lowers units' speed below half HP, but not in the red, may be elsewhere then...
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.
I already posted the meaning of bytes in the other thread, so building art is at position 20 and barrel art at position 24 (decimal). Turret base are values 10, 12, 28, 30, 46, 48 and barrels are 11, 13, 29, 31, 47, 49 (all decimal, you need to concert these to hex if you use hex editor). Only first two of base and barrel are used, othe others are unused and can be replaced by any custom stuff.
No, this is not possible. Building and unit arts are strictly distinct.
I already posted it in my unit template research, this is one of the many flags. This one makes the unit completely ignored by AI, the unit is not even in guarding mode if placed on map for some player with AI. There are some more flags, some of them also affecting AI, for example one makes AI always assign group 1 to that unit (so it is only in guarding mode and not doing anything else) and one turns the unit into attack mode (if placed on map, the unit goes to attack immediately). I'm not sure whether those flags can be reasonably used for any purpose, so I did not place them as checkboxes, but you can still enter them manually with Flags field.
I played a map where tiberium was rare. But there where plenty of tiberium spikes. Simply take them over was the goal.
This map was imbalance though, because Nod could easily blow the spikes up that enemies had under control.