Jump to content
  • Advertisement
Sign in to follow this  
calculemus1988

Navigating more units as a group in RTS

This topic is 2519 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a question related to navigating more units at once in RTS. You know you select your army in Warcraft and you send it to go somewhere on the map.

Navigating one unit on the map is easy because it starts at where it is and it goes exactly to the position where it is told to, with right mouse button click. When you have more units things are a bit complicated. You can't just plan path for all units to go exactly to the spot where you tell them too. In Warcraft for example you see units first make a formation, like archers go behind and others in front for example, and then I guess one unit is picked as leader and they all follow the leader with some offset. There is such steering behavior called follow leader with offset or something you can apply. I guess the core part here is the formation thing, once you have the formation then they will all just follow one unit which is picked as leader. The leader is the one that will plan a path to where you clicked with right mouse button, but the rest will just follow him.

So give me some opinions guys

Share this post


Link to post
Share on other sites
Advertisement
I think what you are looking for are Boids and flocking behavior. http://www.red3d.com/cwr/boids/ looks to be a good explanation. You can set the leader to a specific position and then have the others in the group "flock" around him keeping the Separation and Cohesion constants to give them a loose grouping.

Googling "Boids" or :flocking" will give you more resources to look at.

Share this post


Link to post
Share on other sites
What do you think makes it more complicated than flocking outlined in the link? If you want to have certain units types to be fixed relative some other unit (e.g. archers behind fighters) then that might introduce some additional checking but nothing too far from the typical algorithm.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!