Jump to content

SPEED.BIN research


Klofkac

Recommended Posts

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:

obrazek.png.aeaa5a40f21ed74669bb46e6741b85fe.png

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?

obrazek.png.e5ae33ca4321177008e96097a7a05f66.png

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.

  • Like 1
Link to comment
Share on other sites

5 hours ago, Klofkac said:

research

Awesome, Klof. :D 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...

Link to comment
Share on other sites

15 hours ago, Fey said:

Awesome, Klof. :D 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...

Yeah, it's purely about terrain affecting unit speed. The speed in low HP can he a hardcoded thing. Units in red HP moving their full speed might be a bug.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...