
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Scalable Multi-Agent Formation Control in RTS Games: A Virtual Anchor and Fluid-Based Allocation
Corresponding Author(s) : Ibnu Athaillah
Kinetik: Game Technology, Information System, Computer Network, Computing, Electronics, and Control,
Vol. 11, No. 3, August 2026 (Article in Progress)
Abstract
The control system for troop formation movement is a critical component in Real-Time Strategy (RTS) games, directly impacting gameplay quality and player experience. However, implementing these systems presents significant challenges, particularly in balancing rigid formation structure with pathfinding efficiency in dynamic environments containing complex obstacles. This study proposes an integrated framework for troop formation movement that synthesizes a virtual "Anchor" navigation paradigm with a "Fluid-Based Formation Position Allocation" algorithm. Unlike traditional leader-follower methods, the proposed system utilizes a virtual anchor to calculate global pathfinding via NavMesh, while constituent agents dynamically adjust their positions relative to this reference point. To mitigate trajectory conflicts during formation changes, the system employs a fluid-dynamics-inspired sorting strategy that deterministically maps agents to target slots using parallel processing. The architecture is optimized for real-time performance using the Unity Job System, allowing for the coordination of large-scale agent aggregates. Experimental validation was conducted through behavioral scenarios—including Tunnel, Split, and Crowd tests and stress tests involving up to 4,096 agents. The results demonstrate that the system successfully maintains formation integrity, executes autonomous regrouping after obstacle traversal, and ensures collision-free movement. Performance analysis indicates that the control logic remains computationally stable at scale, with the primary limitations shifting to graphical rendering overhead rather than algorithmic complexity.
Keywords
Download Citation
Endnote/Zotero/Mendeley (RIS)BibTeX
- M. van der Heijden, S. Bakkes, and P. Spronck, “Dynamic formations in real-time strategy games,” in 2008 IEEE Symposium On Computational Intelligence and Games, 2008, pp. 47–54. doi: 10.1109/CIG.2008.5035620.
- N. Xie, Y. Hu, and L. Chen, “A Distributed Multi-Agent Formation Control Method Based on Deep Q Learning,” Front Neurorobot, vol. Volume 16-2022, 2022, [Online]. Available: https://www.frontiersin.org/journals/neurorobotics/articles/10.3389/fnbot.2022.817168
- C. Huang, T. Xu, and X. Wu, “Leader–Follower Formation Control of Magnetically Actuated Millirobots for Automatic Navigation,” IEEE/ASME Transactions on Mechatronics, vol. 29, no. 2, pp. 1272–1282, 2024, doi: 10.1109/TMECH.2023.3300010.
- A. Askari, M. Mortazavi, and H. A. Talebi, “UAV Formation Control via the Virtual Structure Approach,” J Aerosp Eng, vol. 28, p. 4014047, 2015, [Online]. Available: https://api.semanticscholar.org/CorpusID:110374391
- D. Xu, X. Zhang, Z. Zhu, C. Chen, and P. Yang, “Behavior-Based Formation Control of Swarm Robots,” Math Probl Eng, vol. 2014, no. 1, p. 205759, Jan. 2014, doi: https://doi.org/10.1155/2014/205759.
- E. W. Rivas and R. Souza, “Map Marker: a Multi-Agent Pathfinder for Cohesive Groups in Real-Time Strategy Games,” in 2021 20th Brazilian Symposium on Computer Games and Digital Entertainment (SBGames), 2021, pp. 97–106. doi: 10.1109/SBGames54170.2021.00021.
- M. Colledanchise, D. V Dimarogonas, and P. Ögren, “Obstacle avoidance in formation using navigation-like functions and constraint based programming,” in 2013 IEEE/RSJ International Conference on Intelligent Robots and Systems, 2013, pp. 5234–5239. doi: 10.1109/IROS.2013.6697113.
- C. Cruz Hernández, A. Medina, L. Cardoza Avendaño, and R. M. López-gutiérrez, “Flocking Behavior of Boids Driven by Hyperchaotic MACM System,” Chaos Theory and Applications, vol. 6, no. 2, pp. 152–158, 2024, doi: 10.51537/chaos.1376145.
- D. Foead, A. Ghifari, M. B. Kusuma, N. Hanafiah, and E. Gunawan, “A Systematic Literature Review of A* Pathfinding,” Procedia Comput Sci, vol. 179, pp. 507–514, 2021, doi: https://doi.org/10.1016/j.procs.2021.01.034.
- M. Faria, I. Maza, and A. Viguria, “Applying Frontier Cells Based Exploration and Lazy Theta* Path Planning over Single Grid-Based World Representation for Autonomous Inspection of Large 3D Structures with an UAS,” J Intell Robot Syst, vol. 93, no. 1, pp. 113–133, 2019, doi: 10.1007/s10846-018-0798-4.
- Sujeong Kim et al., “BRVO: Predicting pedestrian trajectories using velocity-space reasoning,” Int J Rob Res, vol. 34, no. 2, pp. 201–217, Dec. 2014, doi: 10.1177/0278364914555543.
- P. Ram and K. Sinha, “Revisiting kd-tree for Nearest Neighbor Search,” in Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, in KDD ’19. New York, NY, USA: Association for Computing Machinery, 2019, pp. 1378–1388. doi: 10.1145/3292500.3330875.
- H.-C. Song, “A Study on Optimized Multi-Thread Porgramming - Information and The Use of Unitiy DOTS,” Journal of Digital Contents Society, vol. 22, no. 10, pp. 1715–1719, 2021, doi: 10.9728/dcs.2021.22.11.1715.
- N. D. orević, “Usability: Key characteristic of software quality,” Vojnotehnicki glasnik/Military Technical Courier, vol. 65, no. 2, pp. 513–529, 2017.
- W. Hasselbring, “Software architecture: Past, present, future,” in The essence of software engineering, Springer International Publishing Cham, 2018, pp. 169–184.
- D. Jagdale, “Finite state machine in game development,” International Journal of Advanced Research in Science, Communication and Technology, vol. 10, no. 1, 2021.
- M. Marcellino, D. W. Pratama, S. S. Suntiarko, and K. Margi, “Comparative of Advanced Sorting Algorithms (Quick Sort, Heap Sort, Merge Sort, Intro Sort, Radix Sort) Based on Time and Memory Usage,” in 2021 1st International Conference on Computer Science and Artificial Intelligence (ICCSAI), 2021, pp. 154–160. doi: 10.1109/ICCSAI53272.2021.9609715.
- V. K. Shopov and V. D. Markova, “Application of Hungarian Algorithm for Assignment Problem,” in 2021 International Conference on Information Technologies (InfoTech), 2021, pp. 1–4. doi: 10.1109/InfoTech52438.2021.9548600.
- W. Wei, “A new formation control strategy based on the virtual-leader-follower and artificial potential field,” in 2019 34rd Youth Academic Annual Conference of Chinese Association of Automation (YAC), 2019, pp. 485–492. doi: 10.1109/YAC.2019.8787593.
- M. Li, K. Meng, J. Chen, and H. Wang, “Ship Formation Algorithm Based on the Leader–Follower Method,” IEEE Access, vol. 11, pp. 21655–21668, 2023, doi: 10.1109/ACCESS.2023.3246093.
- James Nutaro and Ozgur Ozmen, “Race conditions and data partitioning: risks posed by common errors to reproducible parallel simulations,” Simulation, vol. 99, no. 4, pp. 417–427, Nov. 2022, doi: 10.1177/00375497221132566.
- T. Xie, N. Tillmann, and P. Lakshman, “Advances in unit testing: theory and practice,” in Proceedings of the 38th International Conference on Software Engineering Companion, in ICSE ’16. New York, NY, USA: Association for Computing Machinery, 2016, pp. 904–905. doi: 10.1145/2889160.2891056.
- H. Wei, J. Timmis, and R. Alexander, “Evolving test environments to identify faults in swarm robotics algorithms,” in 2017 IEEE Congress on Evolutionary Computation (CEC), 2017, pp. 929–935. doi: 10.1109/CEC.2017.7969408.
- S. Pargaonkar, “A comprehensive review of performance testing methodologies and best practices: software quality engineering,” International Journal of Science and Research (IJSR), vol. 12, no. 8, pp. 2008–2014, 2023.
- J. Marques and S. Yelisetty, “An analysis of software requirements specification characteristics in regulated environments,” International Journal of Software Engineering & Applications (IJSEA), vol. 10, no. 6, pp. 1–15, 2019.
- D. Ilett, “Advanced Texturing,” in Building Quality Shaders for Unity®: Using Shader Graphs and HLSL Shaders, D. Ilett, Ed., Berkeley, CA: Apress, 2022, pp. 141–192. doi: 10.1007/978-1-4842-8652-4_6.
- A. Maulana, S. Mardi, E. M. Yuniarno, and Y. K. Suprapto, “Behavior NPC Prediction Using Deep Learning,” in 2022 International Conference on Computer Engineering, Network, and Intelligent Multimedia (CENIM), 2022, pp. 1–5. doi: 10.1109/CENIM56801.2022.10037328.
References
M. van der Heijden, S. Bakkes, and P. Spronck, “Dynamic formations in real-time strategy games,” in 2008 IEEE Symposium On Computational Intelligence and Games, 2008, pp. 47–54. doi: 10.1109/CIG.2008.5035620.
N. Xie, Y. Hu, and L. Chen, “A Distributed Multi-Agent Formation Control Method Based on Deep Q Learning,” Front Neurorobot, vol. Volume 16-2022, 2022, [Online]. Available: https://www.frontiersin.org/journals/neurorobotics/articles/10.3389/fnbot.2022.817168
C. Huang, T. Xu, and X. Wu, “Leader–Follower Formation Control of Magnetically Actuated Millirobots for Automatic Navigation,” IEEE/ASME Transactions on Mechatronics, vol. 29, no. 2, pp. 1272–1282, 2024, doi: 10.1109/TMECH.2023.3300010.
A. Askari, M. Mortazavi, and H. A. Talebi, “UAV Formation Control via the Virtual Structure Approach,” J Aerosp Eng, vol. 28, p. 4014047, 2015, [Online]. Available: https://api.semanticscholar.org/CorpusID:110374391
D. Xu, X. Zhang, Z. Zhu, C. Chen, and P. Yang, “Behavior-Based Formation Control of Swarm Robots,” Math Probl Eng, vol. 2014, no. 1, p. 205759, Jan. 2014, doi: https://doi.org/10.1155/2014/205759.
E. W. Rivas and R. Souza, “Map Marker: a Multi-Agent Pathfinder for Cohesive Groups in Real-Time Strategy Games,” in 2021 20th Brazilian Symposium on Computer Games and Digital Entertainment (SBGames), 2021, pp. 97–106. doi: 10.1109/SBGames54170.2021.00021.
M. Colledanchise, D. V Dimarogonas, and P. Ögren, “Obstacle avoidance in formation using navigation-like functions and constraint based programming,” in 2013 IEEE/RSJ International Conference on Intelligent Robots and Systems, 2013, pp. 5234–5239. doi: 10.1109/IROS.2013.6697113.
C. Cruz Hernández, A. Medina, L. Cardoza Avendaño, and R. M. López-gutiérrez, “Flocking Behavior of Boids Driven by Hyperchaotic MACM System,” Chaos Theory and Applications, vol. 6, no. 2, pp. 152–158, 2024, doi: 10.51537/chaos.1376145.
D. Foead, A. Ghifari, M. B. Kusuma, N. Hanafiah, and E. Gunawan, “A Systematic Literature Review of A* Pathfinding,” Procedia Comput Sci, vol. 179, pp. 507–514, 2021, doi: https://doi.org/10.1016/j.procs.2021.01.034.
M. Faria, I. Maza, and A. Viguria, “Applying Frontier Cells Based Exploration and Lazy Theta* Path Planning over Single Grid-Based World Representation for Autonomous Inspection of Large 3D Structures with an UAS,” J Intell Robot Syst, vol. 93, no. 1, pp. 113–133, 2019, doi: 10.1007/s10846-018-0798-4.
Sujeong Kim et al., “BRVO: Predicting pedestrian trajectories using velocity-space reasoning,” Int J Rob Res, vol. 34, no. 2, pp. 201–217, Dec. 2014, doi: 10.1177/0278364914555543.
P. Ram and K. Sinha, “Revisiting kd-tree for Nearest Neighbor Search,” in Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, in KDD ’19. New York, NY, USA: Association for Computing Machinery, 2019, pp. 1378–1388. doi: 10.1145/3292500.3330875.
H.-C. Song, “A Study on Optimized Multi-Thread Porgramming - Information and The Use of Unitiy DOTS,” Journal of Digital Contents Society, vol. 22, no. 10, pp. 1715–1719, 2021, doi: 10.9728/dcs.2021.22.11.1715.
N. D. orević, “Usability: Key characteristic of software quality,” Vojnotehnicki glasnik/Military Technical Courier, vol. 65, no. 2, pp. 513–529, 2017.
W. Hasselbring, “Software architecture: Past, present, future,” in The essence of software engineering, Springer International Publishing Cham, 2018, pp. 169–184.
D. Jagdale, “Finite state machine in game development,” International Journal of Advanced Research in Science, Communication and Technology, vol. 10, no. 1, 2021.
M. Marcellino, D. W. Pratama, S. S. Suntiarko, and K. Margi, “Comparative of Advanced Sorting Algorithms (Quick Sort, Heap Sort, Merge Sort, Intro Sort, Radix Sort) Based on Time and Memory Usage,” in 2021 1st International Conference on Computer Science and Artificial Intelligence (ICCSAI), 2021, pp. 154–160. doi: 10.1109/ICCSAI53272.2021.9609715.
V. K. Shopov and V. D. Markova, “Application of Hungarian Algorithm for Assignment Problem,” in 2021 International Conference on Information Technologies (InfoTech), 2021, pp. 1–4. doi: 10.1109/InfoTech52438.2021.9548600.
W. Wei, “A new formation control strategy based on the virtual-leader-follower and artificial potential field,” in 2019 34rd Youth Academic Annual Conference of Chinese Association of Automation (YAC), 2019, pp. 485–492. doi: 10.1109/YAC.2019.8787593.
M. Li, K. Meng, J. Chen, and H. Wang, “Ship Formation Algorithm Based on the Leader–Follower Method,” IEEE Access, vol. 11, pp. 21655–21668, 2023, doi: 10.1109/ACCESS.2023.3246093.
James Nutaro and Ozgur Ozmen, “Race conditions and data partitioning: risks posed by common errors to reproducible parallel simulations,” Simulation, vol. 99, no. 4, pp. 417–427, Nov. 2022, doi: 10.1177/00375497221132566.
T. Xie, N. Tillmann, and P. Lakshman, “Advances in unit testing: theory and practice,” in Proceedings of the 38th International Conference on Software Engineering Companion, in ICSE ’16. New York, NY, USA: Association for Computing Machinery, 2016, pp. 904–905. doi: 10.1145/2889160.2891056.
H. Wei, J. Timmis, and R. Alexander, “Evolving test environments to identify faults in swarm robotics algorithms,” in 2017 IEEE Congress on Evolutionary Computation (CEC), 2017, pp. 929–935. doi: 10.1109/CEC.2017.7969408.
S. Pargaonkar, “A comprehensive review of performance testing methodologies and best practices: software quality engineering,” International Journal of Science and Research (IJSR), vol. 12, no. 8, pp. 2008–2014, 2023.
J. Marques and S. Yelisetty, “An analysis of software requirements specification characteristics in regulated environments,” International Journal of Software Engineering & Applications (IJSEA), vol. 10, no. 6, pp. 1–15, 2019.
D. Ilett, “Advanced Texturing,” in Building Quality Shaders for Unity®: Using Shader Graphs and HLSL Shaders, D. Ilett, Ed., Berkeley, CA: Apress, 2022, pp. 141–192. doi: 10.1007/978-1-4842-8652-4_6.
A. Maulana, S. Mardi, E. M. Yuniarno, and Y. K. Suprapto, “Behavior NPC Prediction Using Deep Learning,” in 2022 International Conference on Computer Engineering, Network, and Intelligent Multimedia (CENIM), 2022, pp. 1–5. doi: 10.1109/CENIM56801.2022.10037328.