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

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

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

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

Post 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?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

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

Post 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
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

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

Post 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
Post Reply

Return to “AI”