
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
Abstract
The control system for troop formation movement is a critical component of Real-Time Strategy (RTS) games, directly affecting gameplay quality and player experience. However, traditional CPU-bound pathfinding algorithms fail to maintain 60 FPS when handling more than 1,000 agents in dynamic environments, particularly when balancing rigid formation structure with pathfinding efficiency amid 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—as well as 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 further 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. https://doi.org/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.
- 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. https://doi.org/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.
- 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. 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. https://doi.org/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. https://doi.org/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. https://doi.org/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. 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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/10.1177/00375497221132566
- M. Schäfer, S. Nadi, A. Eghbali, and F. Tip, “An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generation,” IEEE Transactions on Software Engineering, vol. 50, no. 1, pp. 85–105, 2024. https://doi.org/10.1109/TSE.2023.3334955
- M. H. A. Majid, M. R. Arshad, and R. M. Mokhtar, “Swarm Robotics Behaviors and Tasks: A Technical Review,” in Control Engineering in Robotics and Industrial Automation: Malaysian Society for Automatic Control Engineers (MACE) Technical Series 2018, M. Mariappan, M. R. Arshad, R. Akmeliawati, and C. S. Chong, Eds., Cham: Springer International Publishing, 2022, pp. 99–167. https://doi.org/https://doi.org/10.1007/978-3-030-74540-0_5
- 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. https://doi.org/10.21275/SR23822111402
- A. R. Cheraghi, S. Shahzad, and K. Graffi, “Past, Present, and Future of Swarm Robotics,” in Intelligent Systems and Applications, K. Arai, Ed., Cham: Springer International Publishing, 2022, pp. 190–233. https://doi.org/10.48550/arXiv.2101.00671
- 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. https://doi.org/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. https://doi.org/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. https://doi.org/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.
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. https://doi.org/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.
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. 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. https://doi.org/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. https://doi.org/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. https://doi.org/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. 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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/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. https://doi.org/10.1177/00375497221132566
M. Schäfer, S. Nadi, A. Eghbali, and F. Tip, “An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generation,” IEEE Transactions on Software Engineering, vol. 50, no. 1, pp. 85–105, 2024. https://doi.org/10.1109/TSE.2023.3334955
M. H. A. Majid, M. R. Arshad, and R. M. Mokhtar, “Swarm Robotics Behaviors and Tasks: A Technical Review,” in Control Engineering in Robotics and Industrial Automation: Malaysian Society for Automatic Control Engineers (MACE) Technical Series 2018, M. Mariappan, M. R. Arshad, R. Akmeliawati, and C. S. Chong, Eds., Cham: Springer International Publishing, 2022, pp. 99–167. https://doi.org/https://doi.org/10.1007/978-3-030-74540-0_5
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. https://doi.org/10.21275/SR23822111402
A. R. Cheraghi, S. Shahzad, and K. Graffi, “Past, Present, and Future of Swarm Robotics,” in Intelligent Systems and Applications, K. Arai, Ed., Cham: Springer International Publishing, 2022, pp. 190–233. https://doi.org/10.48550/arXiv.2101.00671
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. https://doi.org/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. https://doi.org/10.1109/CENIM56801.2022.10037328