Design and Application Research of Dynamic NPC System Based on Local Large Language Models
DOI:
https://doi.org/10.62051/5qe7kq62Keywords:
Large Language Model; NPC; Viedo game; Artificial Intelligence.Abstract
With the Development of the video game industry, the problem of traditional Non-Player Characters (NPCs) became rigid because they rely on pre-written scripts. Although the Large Language Models (LLMs) offer a new way to generate dynamic conversations, most useful ways nowadays from using cloud-base solutions suffer from high response delay (>500ms) and privacy risks. Recent research has highlighted the need for on-device AI solutions to address these performance and security concerns. This study explores a local deployment approach by using the DeepSeek model with localized model compression, the paper successfully ran LLM-powered NPC dialogues within the game environment. Tests show that our method reduces response delay to 14% of the cloud-based methods. Meanwhile, it achieves diversity scores of 0.22 and 0.35 based on TF-IDF and BERT, significantly enhancing the use of using LLMs in video games. Our findings demonstrate that this approach significantly improves the use of LLMs in games. It provides a low-latency, privacy-friendly solution and presents a new way to integrate AI into the gaming industry.
Downloads
References
[1] A. Radford, K. Narasimhan, T. Salimans, et al., Improving language understanding by generative pre-training, (2018).
[2] J. van Stegeren, J. Myśliwiec, Fine-tuning GPT-2 on annotated RPG quests for NPC dialogue generation, in: Proc. 16th Int. Conf. Foundations of Digital Games, (2021), pp. 1–8.
[3] M.F. Hasani, Y. Udjaja, Immersive experience with non-player characters dynamic dialogue, in: Proc. 1st Int. Conf. Computer Science and Artificial Intelligence (ICCSAI), IEEE, (2021), pp. 418–421.
[4] M. Deriu, F. Bachis, M. Massa, Improving the user engagement in a fully immersive experience by the means of a conversational non-playable character used as a tourist guide, in: 2021 IoT Vertical and Topical Summit for Tourism, IEEE, (2021), pp. 1–4.
[5] D. Ogunlesi, X. Wang, GPT-NPC: Enhancing NPC Human-Likeness and Autonomy in Video Games, (2024).
[6] B. Kim, M. Kim, D. Seo, et al., Leveraging Large Language Models for Active Merchant Non-player Characters, arXiv preprint arXiv: 2412.11189, (2024).
[7] L.M. Csepregi, The effect of context-aware LLM-based NPC conversations on player engagement in role-playing video games, Unpublished manuscript, (2021).
[8] F.R. Christiansen, L.N. Hollensberg, and N.B. Jensen, et al., Exploring presence in interactions with LLM-driven NPCs: A comparative study of speech recognition and dialogue options, in: Proc. 30th ACM Symp. Virtual Reality Software and Technology, (2024), pp. 1–11.
[9] M. Agarwal, A. Qureshi, L.L.N. Sardana, et al., LLM inference performance engineering: Best practices, URL: https://www.databricks.com/blog/llm-inference-performanceengineering-best-practices, (2023).
[10] D. Guo, D. Yang, H. Zhang, and et al., Deepseek-R1: Incentivizing reasoning capability in LLMs via reinforcement learning, arXiv preprint arXiv: 2501.12948, (2025).
Downloads
Published
Conference Proceedings Volume
Section
License
Copyright (c) 2025 Transactions on Computer Science and Intelligent Systems Research

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.







