Page 1 of 1

Any relationship between Unit::GetMaxSpeed and Unit::GetPos?

Posted: 11 Sep 2014, 14:11
by lamer
What's the relationship between unit speed (Unit::GetMaxSpeed) and terrain coordinates (Unit::GetPos)?
Is unit speed relative to frame (as time metric)?
How can i calculate unit's approximate (flat straight line) move distance after 300 frames (10 seconds with normal game speed) with Unit::GetMaxSpeed?

Re: Any relationship between Unit::GetMaxSpeed and Unit::Get

Posted: 11 Sep 2014, 14:24
by Beherith
MaxSpeed is in elmos (the Spring unit of 1) per frame (30 frames per sec).
GetPos will return the coords xyz in elmos.
So the 10 sec move distance will be GetMaxSpeed*300

Re: Any relationship between Unit::GetMaxSpeed and Unit::Get

Posted: 11 Sep 2014, 14:39
by lamer
Thanks Beherith.
Also got few replies in chat channel (as addon just in case)

Code: Select all

GoogleFrog: space is measured in elmos
    time is all confused because sometimes it refers to frames
    and there are 30 frames a second
    but some stuff happens every 32 frames and calls itself per second
Anarchid: there are also heightmap units which are 8 elmos i think
    that's not relevant in most gamedev things but it's relevant in aidev