Open GoogleFrog opened 1 month ago
Something to be aware of: there's StartSkidding
and StopSkidding
. Perhaps the engine confuses the two states and only produces events for going from either of them to stationary, but not between moving and skidding?
In MF i have a workaround for this that checks every few frames whether the unit is moving and calls startmoving/stopmoving https://github.com/springraaar/metal_factions/blob/master/luarules/gadgets/unit_physics_handler.lua#L484
in my case startmoving just sets a flag and doesn't trigger piece movement directly. There's a unit scripting thread testing it periodically and handling the animations.
It seems to me that StartMoving is already the callin that does what you're asking.
Apparently the issue to fix is it not triggering when it should, like when the unit started trying to move but it was already moving due to being pushed by external forces.
Ok. I'm responding because you addressed me and I feel like one was expected, but I have nothing to add.
See: https://github.com/ZeroK-RTS/Zero-K/blob/master/scripts/reliableStartMoving.lua
Previous engine devs thought this was working as intended, so perhaps a new callin could be added. I would also be happy for StartMoving to be modified to fix this edge case, so that it was 100% reliable for telling units when to animate.
Ok thanks. I wasn't sure if ZK was using any workaround.
I agree with you but i'd put fixing the current callins ahead of adding new ones.
Figure out whta the current design is and if there is anything to fix by experimenting with Start/StopSkidding
.
Previous ticket: https://springrts.com/mantis/view.php?id=4458
Sometimes units can be thrown through the air, land, then move along the ground, all without calling StartMoving. This can be reproduced with weapons that deal a bit of impulse damage, since it only takes a moment of losing contact with the ground to trigger the bug.
This is particularly important for any kind of deployment mechanic that depends on whether a unit is moving or not. But it is also relevant to all units, as any unit can end up skating along the ground this way.
I found a reliable way to reproduce it.
Replay:
The replay shows that StartMoving and StopMoving are not adequate for knowing when ground units should play their walk animations. Previous engine devs thought this was working as intended, so perhaps a new callin could be added. I would also be happy for StartMoving to be modified to fix this edge case, so that it was 100% reliable for telling units when to animate.