RTS Unit Group Movement: Deterrence – Video Devlog 5

The fifth weekly devlog of Deterrence. This week, I go over the trials, limitations, and methods of moving groups of RTS units.

A tower defense mixed with real-time strategy where you repel attacking sentient AI robots until they give up.

The fifth weekly devlog of Deterrence. This week, I go over the trials, limitations, and methods of moving groups of RTS units.

Title

A tower defense mixed with real-time strategy where you repel attacking sentient AI robots until they give up.

Prologue

This is my first time implementing RTS unit movement and I am no expert, but I have learned the basics that hold true in many AAA RTS games. Most of the information I go over in this devlog can be found here and here.

Performance

The RTS unit pathfinding method can destroy a games frame rate if not used wisely. Having a large group of units and having each unit in that group use their own pathfinding method to go to the same place is a performance killer. Also there may be units that find an alternate route making the group split, which may not be what the player wants. This problem is simply solved by designating a leader. The leader would find the path and all other units will use the leaders path.

Figure1

One factor that can adjust the pathfinding work load is the spacing of grid nodes that units move on. By increasing the spacing, you are effectively reducing the amount of processing power to find a path between the unit and the destination; by doing this, you also sacrifice pathfinding in tight spaces. The RTS map and pathfinding grid should be made with each other in mind for the best performance.

Figure2

Unit to Unit Collisions

The pathfinding method will only take into account the terrain and structures the unit must move around, but since units are constantly moving and changing positions, their collisions are calculated as they move along their path. In this game I implement a collision prevention check to stop units from walking on top of each other. To make it work, each unit has a priority based on their distance to their goal. The unit closest to it’s goal will be given the right of way.

Figure3

There are also instances where I would allow units to pass through one another when getting into formation. I also tried resolving collisions that were not prevented, but that would result in a huge chain reaction of collision resolving in a tightly packed group. From the research, the best way to handle unit to unit collision is to have a grid that all the units shared to predict and resolve collisions with one another.

Figure4

I’m just settling with my single collision prevention method for now since this game is a tower defense at it’s core and this is my first time implementing RTS style movement.

Formations

Formations are important to allow units to flow in a group and prevent units from having the same destination point. A well thought out formation should take into consideration the terrain and structures by forming around them without splitting the group.

Figure5

If you would like to follow me on my game dev journey, don’t forget to subscribe or follow on social media!

Facebook – https://www.facebook.com/DeterrenceGame/
Twitter – https://twitter.com/DeterrenceGame
Instagram – https://www.instagram.com/deterrencegame/
Discord Server – https://discord.gg/CjAybsdq
IndieDB – https://www.indiedb.com/games/deterrence


Print Share Comment Cite Upload Translate
APA
Pisces Studios | Sciencx (2024-03-28T21:20:57+00:00) » RTS Unit Group Movement: Deterrence – Video Devlog 5. Retrieved from https://www.scien.cx/2022/04/15/rts-unit-group-movement-deterrence-video-devlog-5/.
MLA
" » RTS Unit Group Movement: Deterrence – Video Devlog 5." Pisces Studios | Sciencx - Friday April 15, 2022, https://www.scien.cx/2022/04/15/rts-unit-group-movement-deterrence-video-devlog-5/
HARVARD
Pisces Studios | Sciencx Friday April 15, 2022 » RTS Unit Group Movement: Deterrence – Video Devlog 5., viewed 2024-03-28T21:20:57+00:00,<https://www.scien.cx/2022/04/15/rts-unit-group-movement-deterrence-video-devlog-5/>
VANCOUVER
Pisces Studios | Sciencx - » RTS Unit Group Movement: Deterrence – Video Devlog 5. [Internet]. [Accessed 2024-03-28T21:20:57+00:00]. Available from: https://www.scien.cx/2022/04/15/rts-unit-group-movement-deterrence-video-devlog-5/
CHICAGO
" » RTS Unit Group Movement: Deterrence – Video Devlog 5." Pisces Studios | Sciencx - Accessed 2024-03-28T21:20:57+00:00. https://www.scien.cx/2022/04/15/rts-unit-group-movement-deterrence-video-devlog-5/
IEEE
" » RTS Unit Group Movement: Deterrence – Video Devlog 5." Pisces Studios | Sciencx [Online]. Available: https://www.scien.cx/2022/04/15/rts-unit-group-movement-deterrence-video-devlog-5/. [Accessed: 2024-03-28T21:20:57+00:00]
rf:citation
» RTS Unit Group Movement: Deterrence – Video Devlog 5 | Pisces Studios | Sciencx | https://www.scien.cx/2022/04/15/rts-unit-group-movement-deterrence-video-devlog-5/ | 2024-03-28T21:20:57+00:00
https://github.com/addpipe/simple-recorderjs-demo