Research and Development of Software Behavioral Components in Computer Gaming Systems

2025;
: pp. 242 - 254
1
Lviv Polytechnic National University, Department of Electronic Computing Machines, Ukraine
2
Lviv Polytechnic National University, Department of Electronic Computing Machines, Ukraine

The article presents the results of a study on the possibilities of building software behavioral components based on large language models (LLMs) and their use in gaming systems. The subject of the research is the behavioral component of non-player characters (NPCs) in computer games, integrated with an LLM. The aim is to explore and analyze the features of applying LLMs to simplify NPC development. The study examines game AI types – reactive, state-driven, and learning-based. Interaction with NPCs through LLMs for chat communication is considered, and analogues of such characters’ behavior and dialogue are explored. The outcome is a designed and implemented API service for interaction with LLMs and an external gaming system with a corresponding software behavioral component that provides functionality for LLM-based interaction. Testing has shown that this system works with 54 unique contextual properties, achieves a maximum system prompt generation time of up to 60 ms, a maximum LLM response parsing and validation time of up to 30 ms, and supports models with at least 14 billion parameters.

  1. Martin Černý, Tomáš Plch, Matěj Marko, Jakub Gemrot, Petr Ondráček, Cyril Brom, “Using Behavior Objects to Manage Complexity in Virtual Worlds”, Cornell University, Aug 3, 2015. DOI: 10.48550/arXiv.1508.00377. URL: https://arxiv.org/abs/1508.00377. Accessed: May 2025.
  2. Khalifa H. B., Khayati O., Ghezala H. H. B. “A Behavioral and Structural Components Retrieval Technique for Software Reuse,” 2008 Advanced Software Engineering and Its Applications, Hainan, China, 2008, pp. 134–137. DOI: 10.1109/ASEA.2008.45. URL: https://ieeexplore.ieee.org/document/4721328. Accessed: May 2025.
  3. Manchana, Ramakrishna. (2019). Behavioral Design Patterns: Enhancing Software Interaction and Communication. International Journal of Science Engineering and Technology. 7. 1–18. DOI: 10.61463/ijset.vol.7.issue6.243. URL: https://www.researchgate.net/publication/384318655. Accessed: May 2025.
  4. Zhou, Jiansong. (2024). Intelligent Agent and NPC Behavior Modeling: From Traditional Methods to AI Driven Interactive Game Design. Applied and Computational Engineering. 112. 85–91. DOI: 10.54254/2755- 2721/2024.17913. URL: https://www.researchgate.net/publication/386513039. Accessed: May 2025.
  5. Zeng, G. (2023). A review of AI-based game NPCs research. Applied and Computational Engineering, 15, 155–159. DOI: 10.54254/2755-2721/15/20230827. URL:  https://www.ewadirect.com/proceedings/ace/article/view/ 4569. Accessed: May 2025.
  6. Sindhu R. M., Annabel L. S. P., Monisha G. “Development of a 2D Game using Artificial Intelligence in Unity,” 2022 6th International Conference on Trends in Electronics and Informatics (ICOEI), Tirunelveli, India, 2022, pp. 1031–1037. DOI: 10.1109/ICOEI53556.2022.9776750. URL: https://ieeexplore.ieee.org/document/9776750. Accessed: May 2025.
  7. Gao, T., Mi, Q. (2020). Enemy Attack Management Algorithm for Action Role-Playing Games. In: Barolli, L., Hellinckx, P., Enokido, T. (eds) Advances on Broad-Band Wireless Computing, Communication and Applications. BWCCA 2019. Lecture Notes in Networks and Systems, vol. 97. Springer, Cham. DOI: 10.1007/978-3-030-33506-9_28. URL: https://link.springer.com/chapter/10.1007/978-3-030-33506-9_28. Accessed: May 2025.
  8. Ganapathi A., Sivakumar P., Elango A., Gupta H., Panda N. “Exploring NPC Behaviors in Games through Finite Automata,” 2024 5th IEEE Global Conference for Advancement in Technology (GCAT), Bangalore, India, 2024, pp. 1–8. DOI: 10.1109/GCAT62922.2024.10923923. URL: https://ieeexplore.ieee.org/document/10923923. Accessed: May 2025.
  9. Marcotte, R., Hamilton, H.J. Behavior Trees for Modelling Artificial Intelligence in Games: A Tutorial. Comput Game J 6, 171–184 (2017). DOI: 10.1007/s40869-017-0040-9. URL: https://link.springer.com/article/10.1007/ s40869-017-0040-9. Accessed: September 2025.
  10. Sekhavat, Yoones. (2017). Behavior Trees for Computer Games. International Journal on Artificial Intelligence Tools. 26. DOI: 10.1142/S0218213017300010. URL: https://www.worldscientific.com/doi/abs/ 10.1142/S0218213017300010. Accessed: September 2025.
  11. Meshram R., Krishna S., Kulkarni O., Patil R. R., Kaur G. and Maheshwari S. “NPC Behavior in Games Using Unity ML-Agents: A Reinforcement Learning Approach,” 2025 International Conference on Automation and Computation (AUTOCOM), Dehradun, India, 2025, pp. 1519–1523. DOI: 10.1109/AUTOCOM64127.2025.10956320. URL: https://ieeexplore.ieee.org/document/10956320. Accessed: May 2025.
  12. “Dialogue System for Unity”, Pixel Crushers. URL: https://www.pixelcrushers.com/dialogue_system/ manual2x/html. Accessed: May 2025.
  13. “Docs – inworld.ai”, inworld. URL: https://docs.inworld.ai/docs. Accessed: May 2025.
  14. “Unity Plug 'n' Play SDK Docs”, сharisma.ai. URL: https://docs.charisma.ai/plug-n-play/unity. Accessed: May 2025.