RTS unit group movement

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CassanovaWong

ctm hosted at ImgBB — ImgBB <–link to image

My units struggle to reach their destination. I’ve included a picture of what I want them to do (marked with a green check-mark) and what they currently do (marked with a red x).

If I can’t get the ideal situation, I’d at least like them to, A: stop slowing down or otherwise altering each others alignments while moving, and, or, B: to stop jittering or otherwise infintely adjusting themselves because they are prevented from reaching the destination.

Also, at this point, when they are in big groups, the ones in the middle can’t get out, individually, without manually moving some of the outer ones.

I’m probably just too much of a beginner but I’ve exhausted my search for this solution in tutorials and such, so I decided to start asking around the forums… I would think there is a simple solution. Every RTS game I’ve played has something like this…

:bust_in_silhouette: Reply From: sash-rc

Look at Steering Behaviors and Flocking tutorials in general.

In particular, there are some at GDQuest, as well as this one: 2D Flocking Demo - Godot Asset Library

Thank you very much for your suggestion.

Yes, yes, steering behaviors and flocking… It does solve some of this issue(keeping a steady distance in transit), but what I need is for my units to remain in approximately the same formation when they arrive at their destination as they were when they started moving toward it(keeping same distance on arrival). And, if the behaviors you mentioned help solve this, I certainly don’t see how. Can you elaborate on which specific behavior I should try implementing here?

The units I’m using are going to be spaceships. So, if you imagine the way several command ships (battleships, carriers, destroyers, frigates, etc) would move in formation, that’s what I want. Though, of course, I’m working in 2D…

Again, I see this “formation” mechanic in almost all rts games. So, I thought there would be some simple equation to work out a range of destinations allocated per unit instead of a single destination given to all units (which is what I have currently).

CassanovaWong | 2021-01-09 23:09