0 votes

https://ibb.co/TKKxmcW <--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...

in Engine by (141 points)

1 Answer

0 votes

Look at Steering Behaviors and Flocking tutorials in general.

In particular, there are some at GDQuest, as well as this one: https://godotengine.org/asset-library/asset/488

by (1,590 points)

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).

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.