beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
220 stars 101 forks source link

Mobile units behave like they are tennis balls. Would there be options to improve the pathfinding system? #822

Open Sipke82 opened 1 year ago

Sipke82 commented 1 year ago

The attached video show the weird (light weight) behavior of the units, they don't behave like heavy tanks. Below this is an video of 1997 OTA where the tanks don't push each other around and move around obstacles (other units). Perhaps we can get ideas from their approach.

https://github.com/beyond-all-reason/spring/assets/30873812/400f3854-8a67-4a86-826b-27806ab977db

OTA:

https://github.com/beyond-all-reason/spring/assets/30873812/66a26f78-64ca-483f-8c81-615ed4d3d415

lhog commented 1 year ago

Have you tried to play around with https://springrts.com/wiki/Movedefs.lua tags related to unit avoidance ?

Sipke82 commented 1 year ago

Yes, tried many different settings there, unfortunately no significant improvement is obtained. I had high hopes for avoidmobile, didn't work.

On Mon, 22 May 2023 at 21:44, lhog @.***> wrote:

Have you tried to play around with https://springrts.com/wiki/Movedefs.lua tags related to unit avoidance ?

— Reply to this email directly, view it on GitHub https://github.com/beyond-all-reason/spring/issues/822#issuecomment-1557853888, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLRRVF2QM7DQDWODHXQQNLXHO63XANCNFSM6AAAAAAYICZS5E . You are receiving this because you authored the thread.Message ID: @.***>

GoogleFrog commented 1 year ago

Two ideas

MaDDoXbr commented 1 year ago

Unity’s NavMesh Agent component has a “stopping distance” which basically defines how far from the goal is “good enough”, if there are other units (agents) blocking its pathing or if it got stuck somehow. OTA’s default behavior is basically what ctrl+rightclick does in the engine by default, except for making all units use it’s max speed, instead of being limited to the slowest unit in the selection. I believe something like "stopping distance" added to the movedefs options would be preferrable, in this case.

lhog commented 1 year ago

Do the suggestions above help you @Sipke82 ?

MaDDoXbr commented 1 year ago

To clarify, "stopping distance" basically makes the AI-agent (unit, in our case) quit trying to move closer than that threshold to the target position, just as if it had arrived there. It's just a distance threshold applied to the "are we there yet" calculation really. As for my other suggestion, "Move formation" is what C&C3 (if memory doesn't fail me) called moving units while trying to keep their current positions and relative distances, but the units speed wouldn't be normalized by the slowest, there was a 'planning mode' for that. We already have 'formation move' by right-click-dragging with a bunch of units selected, in a sense this 'relative move' would be the same, but simply using the existing unit positions and copying them over (as well as possible) to the destination-click.