Klofkac Posted September 18, 2020 Share Posted September 18, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
Fey Posted September 19, 2020 Share Posted September 19, 2020 5 hours ago, Klofkac said: research 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... Quote Link to comment Share on other sites More sharing options...
Klofkac Posted September 19, 2020 Author Share Posted September 19, 2020 15 hours ago, Fey said: 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... 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.