Abstract
Introduction of Behavior Trees (BTs) impacted the field of Artificial Intelligence (AI) in games, by providing flexible and natural representation of non-player characters (NPCs) logic, manageable by game-designers. Recent trends in the field focused on automatic creation of AI-agents: from deep- and reinforcement-learning techniques to combinatorial (constrained) optimization and evolution of BTs. In this paper, we present a novel approach to semi-automatic construction of AI-agents, that mimic and generalize given human gameplays by adapting and tuning of expert-created BT under a developed similarity metric between source and BT gameplays. To this end, we formulated mixed discrete-continuous optimization problem, in which topological and functional changes of the BT are reflected in numerical variables, and constructed a dedicated hybrid-metaheuristic. The performance of presented approach was verified experimentally in a prototype real-time strategy game. Carried out experiments confirmed efficiency and perspectives of presented approach, which is going to be applied in a commercial game.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
In a performed experiment (not showed here) we obtain 4 Hz sampling rate had no effect on the convergence of the presented algorithm, while it dramatically increased its run-time, due to \(O(n^3)\) complexity of similarity metric. On the other hand, with 1 Hz sampling frequency the algorithm was not able to find a good solution.
References
Blum, C., Roli, A., Sampels, M.: Hybrid Metaheuristics: An Emerging Approach to Optimization, vol. 114. Springer, Cham (2008)
Buckland, M., Collins, M.: AI Techniques for Game Programming. Premier Press (2002)
Colledanchise, M., Ögren, P.: Behavior Trees in Robotics and AI: An Introduction. CRC Press (2018)
Cowling, P.I., Devlin, S., Powley, E.J., Whitehouse, D., Rollason, J.: Player preference and style in a leading mobile card game. IEEE Trans. Comput. Intell. AI Games 7(3), 233–242 (2014)
Gow, J., Baumgarten, R., Cairns, P., Colton, S., Miller, P.: Unsupervised modeling of player style with LDA. IEEE Trans. Comput. Intell. AI Games 4(3), 152–166 (2012)
Harmer, J., et al.: Imitation learning with concurrent actions in 3D games. In: IEEE Conference on Computational Intelligence and Games (CIG), pp. 1–8 (2018)
Hirai, T., Sawada, S.: Melody2Vec: distributed representations of melodic phrases based on melody segmentation. J. Inf. Process. 27, 278–286 (2019). https://doi.org/10.2197/ipsjjip.27.278
Jun, S., Hwang, E.: Music segmentation and summarization based on self-similarity matrix. In: Proceedings of the 7th International Conference on Ubiquitous Information Management and Communication, pp. 1–4 (2013)
Justesen, N., Risi, S.: Learning macromanagement in StarCraft from replays using deep learning. In: 2017 IEEE Conference on Computational Intelligence and Games (CIG), pp. 162–169. IEEE (2017)
Kirkpatrick, S., Gelatt, C.D., Vecchi, M.P.: Optimization by simulated annealing. Science 220(4598), 671–680 (1983)
Liu, S., Louis, S.J., Ballinger, C.A.: Evolving effective microbehaviors in real-time strategy games. IEEE Trans. Comput. Intell. AI Games 8(4), 351–362 (2016)
Luke, H.D.: The origins of the sampling theorem. IEEE Commun. Mag. 37(4), 106–108 (1999)
McPartland, M., Gallagher, M.: Reinforcement learning in first person shooter games. IEEE Trans. Comput. Intell. AI Games 3(1), 43–56 (2010)
Millington, I.: AI for Games. CRC Press (2019)
Moscato, P.: Memetic Algorithms: A Short Introduction, pp. 219–234. McGraw-Hill Ltd. (1999)
Oh, I.S., Cho, H., Kim, K.J.: Playing real-time strategy games by imitating human players’ micromanagement skills based on spatial analysis. Expert Syst. Appl. 71, 192–205 (2017)
Ontañón, S., Synnaeve, G., Uriarte, A., Richoux, F., Churchill, D., Preuss, M.: RTS AI problems and techniques. In: Lee, N. (ed.) Encyclopedia of Computer Graphics and Games. Springer, Cham (2019). https://doi.org/10.1007/978-3-319-08234-9_17-1
Robertson, G., Watson, I.: Building behavior trees from observations in real-time strategy games. In: 2015 International Symposium on Innovations in Intelligent Systems and Applications (INISTA), pp. 1–7. IEEE (2015)
Sagredo-Olivenza, I., Gómez-Martín, P.P., Gómez-Martín, M.A., González-Calero, P.A.: Trained behavior trees: programming by demonstration to support AI game designers. IEEE Trans. Games 11(1), 5–14 (2017)
Shoulson, A., Garcia, F.M., Jones, M., Mead, R., Badler, N.I.: Parameterizing behavior trees. In: Allbeck, J.M., Faloutsos, P. (eds.) Motion in Games, pp. 144–155. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-25090-3_13
Song, S., Weng, J., Su, H., Yan, D., Zou, H., Zhu, J.: Playing FPS games with environment-aware hierarchical reinforcement learning. In: Proceedings of the 28th International Joint Conference on Artificial Intelligence, pp. 3475–3482. AAAI Press (2019)
Tomai, E., Flores, R.: Adapting in-game agent behavior by observation of players using learning behavior trees. In: Mateas, M., Barnes, T., Bogost, I. (eds.) Proceedings of the 9th International Conference on the Foundations of Digital Games, FDG 2014, Liberty of the Seas, Caribbean, 3–7 April 2014, Society for the Advancement of the Science of Digital Games (2014)
Vinyals, O., Babuschkin, I., Czarnecki, M.W., et al.: Grandmaster level in StarCraft II using multi-agent reinforcement learning. Nature 575, 350–354 (2019)
Yannakakis, G.N., Togelius, J.: Artificial Intelligence and Games. Springer, Cham (2018)
Acknowledgments
The work was financially supported by the National Centre of Research and Development in Poland within GameINN programme under grant no. POIR.01.02.00-00-0108/16.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Machalewski, T., Marek, M., Ochmann, A. (2023). Optimization of Parameterized Behavior Trees in RTS Games. In: Rutkowski, L., Scherer, R., Korytkowski, M., Pedrycz, W., Tadeusiewicz, R., Zurada, J.M. (eds) Artificial Intelligence and Soft Computing. ICAISC 2022. Lecture Notes in Computer Science(), vol 13588. Springer, Cham. https://doi.org/10.1007/978-3-031-23492-7_33
Download citation
DOI: https://doi.org/10.1007/978-3-031-23492-7_33
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-23491-0
Online ISBN: 978-3-031-23492-7
eBook Packages: Computer ScienceComputer Science (R0)