Research Article

A model for automatic agent generation based on machine learning in simulation games

Siyuan Wang*
Xi’an Jiaotong-Liverpool University

* Corresponding author: [email protected]

Abstract

With the continuous promotion of Artificial Intelligence (AI) technology in games, researchers are generally willing to pay attention to the effect of AI on game picture quality and man-machine games. However, how to generate a large number of non-player characters (NPC) in a game, especially in a simulation game, is still a problem. Even if some people use machine learning to discover solutions, most answers tend to be limited to copying finite-state machines established by programmers. This paper explores techniques, such as machine learning and maze algorithms, for 2D in-game environments to construct a model that can quickly generate NPCs with 'personality' and adapt to the environment when developing a game. In the process of model construction, the temporal difference algorithm and the depth-first algorithm are used to customize the decision structure for the NPC. At the same time, a simple node-style map generation algorithm is added to restrain NPC. Moreover, an optional neural network model gives the NPC a memory that can be updated. This model successfully realizes the rapid construction of NPC in developing some simple 2D games. In addition, NPCs have a fair amount of intelligence. It can be used during game development or while the game is running and generate a certain number of NPCs in an unfamiliar environment with differences in behavior.

Keywords: machine learning; non-player characters; automatic generation
Published: February 26, 2024
DOI: 10.54254/2755-2721/43/20230846
Volume: ACE Vol.43
pp. 277-283
Download PDF

References

  1. Annart J. (2020) A brief cultural and industrial history of video games. La Revue Nouvelle.;1(1):56-69. doi:10.3917/rn.201.0056
  2. Risi, S. and Preuss, M. (2020) ‘From Chess and Atari to StarCraft and Beyond: How Game AI is Driving the World of AI’. doi:10.1007/s13218-020-00647-w.
  3. N. A. Barriga, M. Stanescu, F. Besoain and M. Buro, (2019) "Improving RTS Game AI by Supervised Policy Learning, Tactical Search, and Deep Reinforcement Learning," in IEEE Computational Intelligence Magazine, vol. 14, no. 3, pp. 8-18, doi: 10.1109/MCI.2019.2919363.
  4. C. Hu et al., (2023)"Reinforcement Learning With Dual-Observation for General Video Game Playing," in IEEE Transactions on Games, vol. 15, no. 2, pp. 202-216, doi: 10.1109/TG.2022.3164242.
  5. V. Mnih, A. P. Badia, M. Mirza, A. Graves, T. Lillicrap, T. Harley, et al., (2016) "Asynchronous methods for deep reinforcement learning", International Conference on Machine Learning, pp. 1928-1937.
  6. R. R. Torrado, P. Bontrager, J. Togelius, J. Liu and D. Perez-Liebana, (2018)"Deep Reinforcement Learning for General Video Game AI," 2018 IEEE Conference on Computational Intelligence and Games (CIG), Maastricht, Netherlands, pp. 1-8, doi: 10.1109/CIG.2018.8490422.
  7. P. Xu, Q. Yin, J. Zhang and K. Huang, (2022) "Deep Reinforcement Learning With Part-Aware Exploration Bonus in Video Games," in IEEE Transactions on Games, vol. 14, no. 4, pp. 644-653, doi: 10.1109/TG.2021.3134259.
  8. BUDIMAN, J. S.; LAURENSIA, M.; ARTHAYA, B. M. Maze Mapping Based Modified Depth First Search Algorithm Simulator for Agricultural Environment. 2021 International Conference on Mechatronics, Robotics and Systems Engineering (MoRSE), Mechatronics, Robotics and Systems Engineering (MoRSE), 2021 International Conference on, [s. l.], p. 1–6, 2021. DOI 10.1109/MoRSE50327.2021.9766000. Disponível em: https://search-ebscohost-com-s.elink.xjtlu.edu.cn:443/login.aspx?direct=true&db=edseee&AN=edseee.9766000&site=eds-live&scope=site. Acesso em: 8 jul. 2023.
  9. R. Sutton and A. Barto, (2018) Reinforcement Learning: An Introduction ser. Adaptive Computation and Machine Learning series, MIT Press.
  10. Li, H. et al. (2023) ‘An Improved Artificial Bee Colony Algorithm With Q-Learning for Solving Permutation Flow-Shop Scheduling Problems’, IEEE Transactions on Systems, Man, and Cybernetics: Systems, Systems, Man, and Cybernetics: Systems, IEEE Transactions on, IEEE Trans. Syst. Man Cybern, Syst, 53(5), pp. 2684–2693. doi:10.1109/TSMC.2022.3219380.
  11. Mahmud, M.S. et al. (2012) ‘A Greedy Approach in Path Selection for DFS Based Maze-map Discovery Algorithm for an autonomous robot’, 2012 15th International Conference on Computer and Information Technology (ICCIT), Computer and Information Technology (ICCIT), 2012 15th International Conference on, pp. 546–550. doi:10.1109/ICCITechn.2012.6509798.
  12. Uludağlı, M.Ç. and Oğuz, K. (2023) ‘Non-player character decision-making in computer games,’ Artificial Intelligence Review: An International Science and Engineering Journal, pp. 1–33. doi:10.1007/s10462-023-10491-7.
  13. Chen Y-Y, Lin Y-H, Kung C-C, Chung M-H, Yen I-H. (2019) Design and implementation of cloud analytics-assisted smart power meters considering advanced artificial intelligence as edge analytics in demand-side management for smart homes. Sensors; 19; 9: 2047. 2019Senso.19.2047C. 10.3390/s19092047. 31052502. 6539684
  14. Hamadani, A., Ganai, N.A. and Bashir, J. (2023) ‘Artificial neural networks for data mining in animal sciences,’ Bulletin of the National Research Centre, 47(1), pp. 1–8. doi:10.1186/s42269-023-01042-9.