fa icon indicating copy to clipboard operation
fa copied to clipboard

Feature/persist ferry

Open Crotalus opened this issue 4 years ago • 9 comments

Persistent ferry routes, #3631

I resurrected an old branch I had on persistent ferry routes. Half of the work (simcallbacks, helper unit) was already merged years ago. The dummy unit wasn't destroyed correctly then but I fixed that now.

Needs to be tested, especially with multiple routes in same ferry route. Unfortunately we cannot access command queue on the UI side

Crotalus avatar Dec 30 '21 18:12 Crotalus

Interesting - I'm not entirely sure how it works yet but I'll have a look 😄 .

Garanas avatar Dec 30 '21 19:12 Garanas

It creates a hidden dummy unit that is part of the ferry order so even when the original transport(s) are dead the dummy unit keeps it alive.

I was about to try the same with persistent building orders but never got to it :)

Crotalus avatar Dec 30 '21 19:12 Crotalus

What building orders would you want to be persistent?

Garanas avatar Dec 30 '21 19:12 Garanas

Had an idea of making orders persistent so you can so if the engineers died you could just right click the order with some new engineers and they continue on the same stuff

But I've noticed that many orders creates a bit lag when you shift and it needs to show blueprints on map (when you queue up 100 t2 fabs etc)

Crotalus avatar Dec 30 '21 19:12 Crotalus

Yes - the command queue is quite hefty on the simulation. I'll look into this PR next week.

Garanas avatar Dec 30 '21 19:12 Garanas

I'll need to test that the dummy units doesn't count as real unit (not winning game until it's dead etc), maybe it should have INSIGNIFICANTUNIT or what the flag is called

Crotalus avatar Dec 30 '21 19:12 Crotalus

I think it should have both INSIGNIFICANTUNIT and DUMMYUNIT. That way they're not picked up by the players or script in a meaningful way.

Garanas avatar Dec 30 '21 19:12 Garanas

I've tested this with annihilation / supremacy / assassination now.

victory.lua checks the flag CanBeKilled when looking for still alive units so I use this flag on the transport beacon and ferry helper to make them not count.

Unfortunately I cannot set INSIGNIFICANTUNIT on the helper, it seems to make the ferry beacon order invisible

Crotalus avatar Jan 03 '22 13:01 Crotalus

There's some odd behavior:

  • (1) If you remove the transport beacon when transports are still attached they still try and transport - but there is no beacon anymore
  • (2) If you queue a transport sequence, then reselect the unit, and queue up the remainder of the transport sequence it creates a new queue instead

I think we can fix (1) by issuing a stop order to all guarding units. Not sure how to approach (2).

Garanas avatar Jan 06 '22 18:01 Garanas