ETA for unit arrival? does such widget exist?

ETA for unit arrival? does such widget exist?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

ETA for unit arrival? does such widget exist?

Post by TradeMark »

we have ETA for building getting finished.

now we need ETA for unit arrival to the location you click it

could someone do that?

would be awesome.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: ETA for unit arrival? does such widget exist?

Post by manolo_ »

TradeMark wrote:we have ETA for building getting finished.

now we need ETA for unit arrival to the location you click it

could someone do that?

would be awesome.
+1, would be cool
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: ETA for unit arrival? does such widget exist?

Post by Pako »

Just happened to make that in the morning.

Widget displays the ETA for move, fight and build commands. Current building ETA is added but not a queued buildings ETA. There seems to be a consistent ~ +10% error in the ETA.
Last edited by Pako on 08 Aug 2009, 17:34, edited 1 time in total.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: ETA for unit arrival? does such widget exist?

Post by manolo_ »

upped, when there is an average flaw of +10%, why dont u subtrahete it?

edit: tested it, it seems that it ignores hills - i mean when com climbs a hill, hes slower
SkyStar
Engines Of War Developer
Posts: 23
Joined: 08 Jul 2009, 15:05

Re: ETA for unit arrival? does such widget exist?

Post by SkyStar »

You would have to get the real move speed instead of the max speed in a units unitdefs to most accurately estimate arrival time?
So count how far the unit moves on the x,z axis for 1 second, then divide the distance by how far it moved?
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: ETA for unit arrival? does such widget exist?

Post by TradeMark »

does it calculate the time from the path spring calculates for each unit? because its the only way to make it accurate, idk is that possible with lua yet?

notice that higher slopes makes units move slower etc.

also the acceleration should be added to calculations, some units might have really slow acceleration...
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: ETA for unit arrival? does such widget exist?

Post by Pako »

SkyStar wrote:You would have to get the real move speed instead of the max speed in a units unitdefs to most accurately estimate arrival time?
So count how far the unit moves on the x,z axis for 1 second, then divide the distance by how far it moved?
That would be the most fail approach.
does it calculate the time from the path spring calculates for each unit? because its the only way to make it accurate, idk is that possible with lua yet?

notice that higher slopes makes units move slower etc.

also the acceleration should be added to calculations, some units might have really slow acceleration...
Path length is calculated.
Acceleration is hard to calculate because the unit can be initially moving to any direction and map specifications can affect the velocity. Vertical deceleration could be easily calculated in the pathing loop if the specifications is known.

I didnt think those imperfections would be important as because human perception of time is very distorded and units often get slown down by other units or be transported by air trans etc. Also the ETA doesnt seem to have any real usage/purpose other than more advanced players can more accurately compare the units cost effectiness in long paths from lab to the battlefield. Most of all I dont think I would be perverse enough coder to fix those distortions. Getting those last few seconds of accuracy will be 90% of more work to put in the widget as I dont know shit about Spring moving algorithms or pathing. This widget was made only to improme existing widget and it works fine even for that.
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: ETA for unit arrival? does such widget exist?

Post by R-TEAM »

Hi,

T#H#A#N#K#S ;)
Not bad .. but with a couple of quirks ...
First it crashed after ca.30min playing ->
Error in Update(): [string "E:\Games\Spring\LuaUI\Widgets\gui_move_eta...."]:94: attempt to index field '?' (a nil value)

Second, i have the good Build-ETA widget and so realy dont need a
second that show me anything build related ....

Third, it would o.k. to display the eta ONLY to way points or to the FIRST build point (the build time is unknow and hard to get - so all ETA after the build order is senseles ...)

With this all sortet it would a very good widget IMHO ;)

Regards
R-TEAM
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: ETA for unit arrival? does such widget exist?

Post by Pako »

Update

-fixed some bugs
-more consistent building eta
-meta key enables non-cumulative ETA
Attachments
gui_move_eta.lua
(5.9 KiB) Downloaded 28 times
Post Reply

Return to “Lua Scripts”