
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
An Adaptive Swarm Clustering Algorithm for Game AI Based on Reinforcement Learning Godot and Particle Swarm Optimization (RLGPSO)
Corresponding Author(s) : Trisna Gelar
Kinetik: Game Technology, Information System, Computer Network, Computing, Electronics, and Control,
Vol. 11, No. 2, May 2026 (Article in Progress)
Abstract
Managing extensive agent swarms presents a significant difficulty in dynamic, real-time situations, especially in gaming artificial intelligence, such as real-time strategy. Traditional Particle Swarm Optimization (PSO) techniques, while effective for optimization tasks, often exhibit suboptimal convergence and inadequate flexibility in complex, demanding situations. This study introduces an innovative hybrid approach that integrates Reinforcement Learning (RL) with PSO to create an adaptive swarm clustering system. This approach employs a Deep Deterministic Policy Gradient (DDPG) agent to dynamically modify PSO parameters, enabling the swarm to adeptly maneuver and cluster within a procedurally generated 2D simulation environment featuring physical obstacles, in contrast to earlier studies that depend on static mathematical benchmarks. A rigorous quantitative analysis using Mixed Linear Model Regression (MLMR) demonstrates that this hybrid method significantly and statistically outperforms conventional, manually tuned PSO in terms of convergence time and diversity value. For example, the RLGPSO model achieved an 11.46% reduction in convergence time on high-complexity maps, a result confirmed as statistically significant with a p-value of 0.002 from the MLMR analysis. This study offers a pragmatic approach for the implementation of intelligent, self-organizing agent swarms, directly applicable to improving the realism and efficacy of present-day gaming AI.
Keywords
Download Citation
Endnote/Zotero/Mendeley (RIS)BibTeX
- E. Z. Elfeky et al., “A Systematic Review of Coevolution in Real-Time Strategy Games,” IEEE Access, vol. 9, pp. 136647–136665, 2021, doi: 10.1109/ACCESS.2021.3115768
- Y. Zhen, Z. Wanpeng, and L. Hongfu, “Artificial Intelligence Techniques on Real-time Strategy Games,” in Proceedings of the 2018 2nd International Conference on Computer Science and Artificial Intelligence, New York, NY, USA: ACM, Dec. 2018, pp. 11–21. doi: 10.1145/3297156.3297188. Available: https://dl.acm.org/doi/10.1145/3297156.3297188
- J. Tang, G. Liu, and Q. Pan, “A Review on Representative Swarm Intelligence Algorithms for Solving Optimization Problems: Applications and Trends,” IEEE/CAA J. Autom. Sin., vol. 8, no. 10, pp. 1627–1643, Oct. 2021, doi: 10.1109/JAS.2021.1004129. Available: https://ieeexplore.ieee.org/document/9498989/
- A. Xu, H. Li, Y. Hong, and G. Liu, “Autonomous Decision-Making for Air Gaming Based on Position Weight-Based Particle Swarm Optimization Algorithm,” Aerospace, vol. 11, no. 12, p. 1030, Dec. 2024, doi: 10.3390/aerospace11121030. Available: https://www.mdpi.com/2226-4310/11/12/1030
- A. G. Gad, “Particle Swarm Optimization Algorithm and Its Applications: A Systematic Review,” Arch. Comput. Methods Eng., vol. 29, no. 5, pp. 2531–2561, Aug. 2022, doi: 10.1007/s11831-021-09694-4. Available: https://link.springer.com/10.1007/s11831-021-09694-4
- M. R. Bonyadi and Z. Michalewicz, “Particle Swarm Optimization for Single Objective Continuous Space Problems: A Review,” Evol. Comput., vol. 25, no. 1, pp. 1–54, Mar. 2017, doi: 10.1162/EVCO_r_00180. Available: https://direct.mit.edu/evco/article/25/1/1-54/1040
- M. Kamosi, A. B. Hashemi, and M. R. Meybodi, “A New Particle Swarm Optimization Algorithm for Dynamic Environments,” 2010, pp. 129–138. doi: 10.1007/978-3-642-17563-3_16. Available: http://link.springer.com/10.1007/978-3-642-17563-3_16
- B. F. Azevedo, A. M. A. C. Rocha, and A. I. Pereira, “Hybrid approaches to optimization and machine learning methods: a systematic literature review,” Mach. Learn., vol. 113, no. 7, pp. 4055–4097, Jul. 2024, doi: 10.1007/s10994-023-06467-x. Available: https://link.springer.com/10.1007/s10994-023-06467-x
- Z. Jiang, D. Zhu, X.-Y. Li, and L.-B. Han, “A Hybrid Adaptive Particle Swarm Optimization Algorithm for Enhanced Performance,” Appl. Sci., vol. 15, no. 11, p. 6030, May 2025, doi: 10.3390/app15116030. Available: https://www.mdpi.com/2076-3417/15/11/6030
- K. Shao, Z. Tang, Y. Zhu, N. Li, and D. Zhao, “A Survey of Deep Reinforcement Learning in Video Games,” no. 61573353, pp. 1–13, 2019, Available: http://arxiv.org/abs/1912.10944
- N. Justesen, P. Bontrager, J. Togelius, and S. Risi, “Deep Learning for Video Game Playing,” IEEE Trans. Games, vol. 12, no. 1, pp. 1–20, Mar. 2020, doi: 10.1109/TG.2019.2896986. Available: https://ieeexplore.ieee.org/document/8632747/
- O. Aoun, “Deep Q-Network-Enhanced Self-Tuning Control of Particle Swarm Optimization,” Modelling, vol. 5, no. 4, pp. 1709–1728, 2024, doi: 10.3390/modelling5040089
- W. Li, Y. Xiong, and Q. Xiong, “Reinforcement Learning-Guided Particle Swarm Optimization for Multi-Objective Unmanned Aerial Vehicle Path Planning,” Symmetry (Basel)., vol. 17, no. 8, p. 1292, Aug. 2025, doi: 10.3390/sym17081292. Available: https://www.mdpi.com/2073-8994/17/8/1292
- Z. Dong, Q. Wu, and L. Chen, “Reinforcement Learning-Based Formation Pinning and Shape Transformation for Swarms,” Drones, vol. 7, no. 11, p. 673, Nov. 2023, doi: 10.3390/drones7110673. Available: https://www.mdpi.com/2504-446X/7/11/673
- F. Zhang and Z. Chen, “A Novel Reinforcement Learning-Based Particle Swarm Optimization Algorithm for Better Symmetry between Convergence Speed and Diversity,” Symmetry (Basel)., vol. 16, no. 10, p. 1290, Oct. 2024, doi: 10.3390/sym16101290. Available: https://www.mdpi.com/2073-8994/16/10/1290
- K. H. Sharif and S. Yousif Ameen, “Game Engines Evaluation for Serious Game Development in Education,” in 2021 International Conference on Software, Telecommunications and Computer Networks (SoftCOM), IEEE, Sep. 2021, pp. 1–6. doi: 10.23919/SoftCOM52868.2021.9559053. Available: https://ieeexplore.ieee.org/document/9559053/
- Y. Chen and H. Sundaram, “Estimating Complexity of 2D Shapes,” in 2005 IEEE 7th Workshop on Multimedia Signal Processing, IEEE, Oct. 2005, pp. 1–4. doi: 10.1109/MMSP.2005.248668. Available: https://ieeexplore.ieee.org/document/4014089/
- M. Rothgänger, A. Melnik, and H. Ritter, “Shape Complexity Estimation Using VAE,” 2024, pp. 35–45. doi: 10.1007/978-3-031-47715-7_3. Available: https://link.springer.com/10.1007/978-3-031-47715-7_3
- R. Poli, J. Kennedy, and T. Blackwell, “Particle swarm optimization,” Swarm Intell., vol. 1, no. 1, pp. 33–57, Oct. 2007, doi: 10.1007/s11721-007-0002-0. Available: http://link.springer.com/10.1007/s11721-007-0002-0
- E. H. Sumiea et al., “Deep deterministic policy gradient algorithm: A systematic review,” Heliyon, vol. 10, no. 9, p. e30697, May 2024, doi: 10.1016/j.heliyon.2024.e30697. Available: https://linkinghub.elsevier.com/retrieve/pii/S2405844024067288
- S. Yin et al., “Reinforcement-learning-based parameter adaptation method for particle swarm optimization,” Complex Intell. Syst., vol. 9, no. 5, pp. 5585–5609, Oct. 2023, doi: 10.1007/s40747-023-01012-8. Available: https://link.springer.com/10.1007/s40747-023-01012-8
- E. Beeching, J. Debangoye, O. Simonin, and C. Wolf, “Godot Reinforcement Learning Agents,” Dec. 2021, doi: https://doi.org/10.48550/arXiv.2112.03636. Available: http://arxiv.org/abs/2112.03636
- M. Ranaweera and Q. H. Mahmoud, “Deep Reinforcement Learning with Godot Game Engine,” Electronics, vol. 13, no. 5, p. 985, Mar. 2024, doi: 10.3390/electronics13050985. Available: https://www.mdpi.com/2079-9292/13/5/985
- A. Rafiq, T. Asmawaty Abdul Kadir, and S. Normaziah Ihsan, “Pathfinding Algorithms in Game Development,” IOP Conf. Ser. Mater. Sci. Eng., vol. 769, no. 1, p. 012021, Feb. 2020, doi: 10.1088/1757-899X/769/1/012021. Available: https://iopscience.iop.org/article/10.1088/1757-899X/769/1/012021
- S. R. Lawande, G. Jasmine, J. Anbarasi, and L. I. Izhar, “A Systematic Review and Analysis of Intelligence-Based Pathfinding Algorithms in the Field of Video Games,” Appl. Sci., vol. 12, no. 11, p. 5499, May 2022, doi: 10.3390/app12115499. Available: https://www.mdpi.com/2076-3417/12/11/5499
References
E. Z. Elfeky et al., “A Systematic Review of Coevolution in Real-Time Strategy Games,” IEEE Access, vol. 9, pp. 136647–136665, 2021, doi: 10.1109/ACCESS.2021.3115768
Y. Zhen, Z. Wanpeng, and L. Hongfu, “Artificial Intelligence Techniques on Real-time Strategy Games,” in Proceedings of the 2018 2nd International Conference on Computer Science and Artificial Intelligence, New York, NY, USA: ACM, Dec. 2018, pp. 11–21. doi: 10.1145/3297156.3297188. Available: https://dl.acm.org/doi/10.1145/3297156.3297188
J. Tang, G. Liu, and Q. Pan, “A Review on Representative Swarm Intelligence Algorithms for Solving Optimization Problems: Applications and Trends,” IEEE/CAA J. Autom. Sin., vol. 8, no. 10, pp. 1627–1643, Oct. 2021, doi: 10.1109/JAS.2021.1004129. Available: https://ieeexplore.ieee.org/document/9498989/
A. Xu, H. Li, Y. Hong, and G. Liu, “Autonomous Decision-Making for Air Gaming Based on Position Weight-Based Particle Swarm Optimization Algorithm,” Aerospace, vol. 11, no. 12, p. 1030, Dec. 2024, doi: 10.3390/aerospace11121030. Available: https://www.mdpi.com/2226-4310/11/12/1030
A. G. Gad, “Particle Swarm Optimization Algorithm and Its Applications: A Systematic Review,” Arch. Comput. Methods Eng., vol. 29, no. 5, pp. 2531–2561, Aug. 2022, doi: 10.1007/s11831-021-09694-4. Available: https://link.springer.com/10.1007/s11831-021-09694-4
M. R. Bonyadi and Z. Michalewicz, “Particle Swarm Optimization for Single Objective Continuous Space Problems: A Review,” Evol. Comput., vol. 25, no. 1, pp. 1–54, Mar. 2017, doi: 10.1162/EVCO_r_00180. Available: https://direct.mit.edu/evco/article/25/1/1-54/1040
M. Kamosi, A. B. Hashemi, and M. R. Meybodi, “A New Particle Swarm Optimization Algorithm for Dynamic Environments,” 2010, pp. 129–138. doi: 10.1007/978-3-642-17563-3_16. Available: http://link.springer.com/10.1007/978-3-642-17563-3_16
B. F. Azevedo, A. M. A. C. Rocha, and A. I. Pereira, “Hybrid approaches to optimization and machine learning methods: a systematic literature review,” Mach. Learn., vol. 113, no. 7, pp. 4055–4097, Jul. 2024, doi: 10.1007/s10994-023-06467-x. Available: https://link.springer.com/10.1007/s10994-023-06467-x
Z. Jiang, D. Zhu, X.-Y. Li, and L.-B. Han, “A Hybrid Adaptive Particle Swarm Optimization Algorithm for Enhanced Performance,” Appl. Sci., vol. 15, no. 11, p. 6030, May 2025, doi: 10.3390/app15116030. Available: https://www.mdpi.com/2076-3417/15/11/6030
K. Shao, Z. Tang, Y. Zhu, N. Li, and D. Zhao, “A Survey of Deep Reinforcement Learning in Video Games,” no. 61573353, pp. 1–13, 2019, Available: http://arxiv.org/abs/1912.10944
N. Justesen, P. Bontrager, J. Togelius, and S. Risi, “Deep Learning for Video Game Playing,” IEEE Trans. Games, vol. 12, no. 1, pp. 1–20, Mar. 2020, doi: 10.1109/TG.2019.2896986. Available: https://ieeexplore.ieee.org/document/8632747/
O. Aoun, “Deep Q-Network-Enhanced Self-Tuning Control of Particle Swarm Optimization,” Modelling, vol. 5, no. 4, pp. 1709–1728, 2024, doi: 10.3390/modelling5040089
W. Li, Y. Xiong, and Q. Xiong, “Reinforcement Learning-Guided Particle Swarm Optimization for Multi-Objective Unmanned Aerial Vehicle Path Planning,” Symmetry (Basel)., vol. 17, no. 8, p. 1292, Aug. 2025, doi: 10.3390/sym17081292. Available: https://www.mdpi.com/2073-8994/17/8/1292
Z. Dong, Q. Wu, and L. Chen, “Reinforcement Learning-Based Formation Pinning and Shape Transformation for Swarms,” Drones, vol. 7, no. 11, p. 673, Nov. 2023, doi: 10.3390/drones7110673. Available: https://www.mdpi.com/2504-446X/7/11/673
F. Zhang and Z. Chen, “A Novel Reinforcement Learning-Based Particle Swarm Optimization Algorithm for Better Symmetry between Convergence Speed and Diversity,” Symmetry (Basel)., vol. 16, no. 10, p. 1290, Oct. 2024, doi: 10.3390/sym16101290. Available: https://www.mdpi.com/2073-8994/16/10/1290
K. H. Sharif and S. Yousif Ameen, “Game Engines Evaluation for Serious Game Development in Education,” in 2021 International Conference on Software, Telecommunications and Computer Networks (SoftCOM), IEEE, Sep. 2021, pp. 1–6. doi: 10.23919/SoftCOM52868.2021.9559053. Available: https://ieeexplore.ieee.org/document/9559053/
Y. Chen and H. Sundaram, “Estimating Complexity of 2D Shapes,” in 2005 IEEE 7th Workshop on Multimedia Signal Processing, IEEE, Oct. 2005, pp. 1–4. doi: 10.1109/MMSP.2005.248668. Available: https://ieeexplore.ieee.org/document/4014089/
M. Rothgänger, A. Melnik, and H. Ritter, “Shape Complexity Estimation Using VAE,” 2024, pp. 35–45. doi: 10.1007/978-3-031-47715-7_3. Available: https://link.springer.com/10.1007/978-3-031-47715-7_3
R. Poli, J. Kennedy, and T. Blackwell, “Particle swarm optimization,” Swarm Intell., vol. 1, no. 1, pp. 33–57, Oct. 2007, doi: 10.1007/s11721-007-0002-0. Available: http://link.springer.com/10.1007/s11721-007-0002-0
E. H. Sumiea et al., “Deep deterministic policy gradient algorithm: A systematic review,” Heliyon, vol. 10, no. 9, p. e30697, May 2024, doi: 10.1016/j.heliyon.2024.e30697. Available: https://linkinghub.elsevier.com/retrieve/pii/S2405844024067288
S. Yin et al., “Reinforcement-learning-based parameter adaptation method for particle swarm optimization,” Complex Intell. Syst., vol. 9, no. 5, pp. 5585–5609, Oct. 2023, doi: 10.1007/s40747-023-01012-8. Available: https://link.springer.com/10.1007/s40747-023-01012-8
E. Beeching, J. Debangoye, O. Simonin, and C. Wolf, “Godot Reinforcement Learning Agents,” Dec. 2021, doi: https://doi.org/10.48550/arXiv.2112.03636. Available: http://arxiv.org/abs/2112.03636
M. Ranaweera and Q. H. Mahmoud, “Deep Reinforcement Learning with Godot Game Engine,” Electronics, vol. 13, no. 5, p. 985, Mar. 2024, doi: 10.3390/electronics13050985. Available: https://www.mdpi.com/2079-9292/13/5/985
A. Rafiq, T. Asmawaty Abdul Kadir, and S. Normaziah Ihsan, “Pathfinding Algorithms in Game Development,” IOP Conf. Ser. Mater. Sci. Eng., vol. 769, no. 1, p. 012021, Feb. 2020, doi: 10.1088/1757-899X/769/1/012021. Available: https://iopscience.iop.org/article/10.1088/1757-899X/769/1/012021
S. R. Lawande, G. Jasmine, J. Anbarasi, and L. I. Izhar, “A Systematic Review and Analysis of Intelligence-Based Pathfinding Algorithms in the Field of Video Games,” Appl. Sci., vol. 12, no. 11, p. 5499, May 2022, doi: 10.3390/app12115499. Available: https://www.mdpi.com/2076-3417/12/11/5499