AllowUnitTransport(Load/Unload)

AllowUnitTransport(Load/Unload)

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
[Fx]Doo
Posts: 56
Joined: 30 Aug 2013, 16:39

AllowUnitTransport(Load/Unload)

Post by [Fx]Doo » 02 Sep 2018, 13:48

Hello!
This post is related to https://springrts.com/mantis/view.php?id=6012:
I'll sum up the mantis report a bit here:

Unloading with air transports:
-Sometimes it will just take much more time (up to 10 seconds sometimes) to unload a unit, when the transport is roughly over the unload spot. It doesn't seem to be linked to the spot being impassable to the loaded unit, as in the end the transport will unload in that spot.
- Maybe related, but there is still an issue with hovering aircrafts, i'm guessing this hasn't been fully patched perhaps? They sometime can take very high time to reach their waypoint (and therefor never land) while they already passed over it. Giving the exact same move command ("refreshing" the queue) seems to "fix" it for the current move command.

I had reported this and Kloot had offered a mean to take full control of transportations with gadgets:
https://github.com/spring/spring/commit ... 0b39c6390e

BA will soon move to a more recent maintenance version, so the time has come to complete the fix for air transports.

I tried a few things first: Echoing when do the calling happen, playing with the loadingradius in UnitDefs, returning true/false in certain situations.
All is well except for one thing: I cannot find a way to know for sure the position the unit will actually be unloaded at.

It seems when a "CMD.UNLOAD_UNITS" is given, it is not necessarily the position the unit will be unloaded on. That much is important, as sometimes your command can be in an unreachable spot and the engine attempts to find a possible spot next to it.

The problem is that if I want to fully take control over the unload process, I may want to know the position the engine wants to unload at, not the one of the command (which might even be an area), ie for disallowing unloading of units underwater by transport ships, I cannot simply check cmd's y position vs 0.
In the case of the air transport, if I want to take complete control of the physics during the load and unload process without the exact position picked by the engine, I won't be able to do much (where should my transport descend to? When should I allow the unload?)

Did I miss something and the coords are already available ?

In any case, complementary informations about these callins would very much help me. If there is some documentation or someone willing to offer help with understanding how exactly should it be used, that would be lovely !
0 x

Kloot
Spring Developer
Posts: 1842
Joined: 08 Oct 2006, 16:58

Re: AllowUnitTransport(Load/Unload)

Post by Kloot » 02 Sep 2018, 15:32

Did I miss something
Nope, I did. Coordinates are available in 686-g3fbba69.
2 x

[Fx]Doo
Posts: 56
Joined: 30 Aug 2013, 16:39

Re: AllowUnitTransport(Load/Unload)

Post by [Fx]Doo » 16 Sep 2018, 11:28

I've started with a simple distance check and allowing if 3D distance is under said value for air transports. It seems to be doing the trick for now!
I'm planning on improving via MoveCtrl-ing the loading/unloading planes if needed. That should allow consistency of load/unload times.

Thank you :)
0 x

Post Reply

Return to “Game Development”