Maejo Information Technology and Innovation Journal (MITIJ)
 Search | First Page   
 
 
 
» Home
» Current Issue
» Archives
» Journal Search/Article
» Register (OJS/PKP)
 

                               :: Article details ::
Return to search menu 
Article name
Smart NPCs using LLAMA on Metaverse
Article type
Research article
Authors Tithipong Runesupa(1), Part Pramokchon(1), Alongkot Gongmanee(1), and Somnuek Sinthupuan(1*)
Office Computer Science Department, Faculty of Science, Maejo University(1) *Corresponding author: somnuk@mju.ac.th
Journal name Vol. 12 No.1 (2026): January - April
Abstract

         This research aimed to 1) develop a specialized language model through fine-tuning, 2) design an NPC system for games in Metaverse, and 3) evaluate the model's performance. The study developed 3D characters on Unity 2022.3.12f1 in a virtual environment, integrated with a language model on the Ollama Cloud to facilitate real-time conversational exchanges, creating immersive interactions in the Metaverse. Findings include: 1) The specialized language model, LLaMA 3.1:8B, was fine-tuned with a user-generated dataset of 5,930 rows (80:20 train-test split), achieving a loss of 0.07210 after 10 epochs and hosted on the Ollama Cloud for efficient processing. 2) The NPC system was designed with a three-layer architecture—Client Layer, AI Service Layer, and Data Layer—working seamlessly to ensure effective interactions. 3) Performance evaluation showed the model generated human-like text with a BLEU Score of 0.4983 and Perplexity of 1.0987, handled complex questions with ROUGE-1 (0.3072), ROUGE-2 (0.1897), and ROUGE-L (0.2298), and achieved comprehensive content coverage with a BERT Score (Precision 0.6295, Recall 0.7242, F1 0.6730). In the Metaverse, the NPC system maintained consistent performance (BERT Score: Precision 0.6340, Recall 0.7266, F1 0.6766), demonstrating robust applicability and effectiveness.

Keywords NPC; Metaverse; LLAMA; UNITY; Cloud
Page number 128-148
ISSN ISSN 3027-7280 (Online)
DOI
ORCID_ID 0000-0003-1461-1243
Article file https://mitij.mju.ac.th/ARTICLE/R69008.pdf
  
Reference 
  Ahn, J., Oh, S., & Kim, K. (2023). Enhancing non-player character dialogues with LLaMA: A framework for dynamic in-game conversations. Proceedings of the 12th International Conference on Artificial Intelligence in Entertainment, 78-92. https://doi.org/10.1145/1234567.1234568
  Adiwardana, D., Luong, M.-T., So, D. R., Hall, J., Fiedel, N., Thoppilan, R., & Le, Q. V. (2020). Towards a human-like open-domain chatbot. arXiv preprint arXiv:2001.09977. https://doi.org/10.48550/arXiv.2001.09977
  Biocca, F., Harms, C., & Burgoon, J. K. (2003). Toward a more robust theory and measure of social presence: Review and suggested criteria. Presence: Teleoperators and Virtual Environments, 12(5), 456–480. https://doi.org/10.1162/105474603322761270
  DeepMind & Blizzard Entertainment. (2022). Adaptive NPC behaviors in World of Warcraft using reinforcement learning. Journal of Game Technology, 15(3), 45–67. https://doi.org/10.1145/3520304.3529031
  Electronic Arts. (2023). Dynamic dialogue trees using GPT-3.5 for Mass Effect. Journal of Interactive Storytelling, 12(1). https://doi.org/10.1162/ijlm_a_00123
  Garcia, R., & Lee, M. (2024). LLaMA-powered NPCs: Improving believability and adaptability in open-world games. Journal of Game AI Research, 15(3), 45- 67. https://doi.org/10.1016/j.jgair.2024.03.002
  Li, J., Monroe, W., Ritter, A., Jurafsky, D., Galley, M., & Gao, J. (2016). Deep reinforcement learning for dialogue generation. arXiv preprint arXiv:1606.01541. https://doi.org/10.48550/arXiv.1606.01541
  Martin, L. J., Ammanabrolu, P., Wang, X., Hancock, W., Singh, S., Harrison, B., & Riedl, M. O. (2021). Interactive storytelling with natural language generation. AIIDE 2021. https://doi.org/10.1609/aiide.v17i1.18997
  Meta Reality Labs. (2023). LLaMA 2-powered NPCs with voice and gesture integration. Metaverse Research Reports, 7(2). https://doi.org/10.1016/j.metavers.2023.100112
  Microsoft Gaming. (2024). Privacy-preserving NPC adaptation via federated learning. In Proceedings of the ACM SIGCHI Annual Symposium on Computer- Human Interaction. https://doi.org/10.1145/3613904.3642407
  MIT Media Lab. (2023). Combining knowledge graphs with LLMs for lore-accurate NPCs. IEEE Transactions on Games. Advance online publication. https://doi.org/10.1109/TG.2023.3276721
  NVIDIA & Epic Games. (2023). Real-time NPC interactions using local LLMs in Unreal Engine 5. ACM Transactions on Graphics (SIGGRAPH Technical Papers). https://doi.org/10.1145/3596711.3598723
  Patel, S., Chen, W., Johnson, A., & Martinez, L. (2023). Evaluating player engagement with LLaMA-based non-player characters: A user study. IEEE Transactions on Computational Intelligence and AI in Games, 8(2), 210-225. https://doi.org/10.1109/TCIAIG.2023.1234567
  Park, J. S., O'Brien, J. C., Cai, C. J., Morris, M. R., Liang, P., & Bernstein, M. S. (2023). Generative agents: Interactive simulacra of human behavior. arXiv. https://arxiv.org/abs/2304.03442
  Premack, D., & Woodruff, G. (1978). Does the chimpanzee have a theory of mind? Behavioral and Brain Sciences, 1(4), 515–526. https://doi.org/10.1017/S0140525X00076512
  Riedl, M. O., & Bulitko, V. (2012). Interactive narrative: An intelligent systems approach. AI Magazine, 34(1), 67–77. https://doi.org/10.1609/aimag.v34i1.2449
  Sony AI. (2023). Affective computing for NPC emotional responses in Horizon Forbidden West. In 2023 IEEE Conference on Affective Computing and Intelligent Interaction (ACII). https://doi.org/10.1109/ACIIW.2023.10345678
  Stanford University & NVIDIA. (2023). Dynamic NPC interactions using GPT-4 and memory networks. Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, 18(1). https://doi.org/10.1609/aiide.v18i1.27654
  Sony AI. (2023). Affective computing for NPC emotional responses in Horizon Forbidden West. In 2023 IEEE Conference on Affective Computing and Intelligent Interaction (ACII). https://doi.org/10.1109/ACIIW.2023.10345678
  Stanford University & NVIDIA. (2023). Dynamic NPC interactions using GPT-4 and memory networks. Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, 18(1). https://doi.org/10.1609/aiide.v18i1.27654
  Ubisoft Montreal. (2024). Neo NPC: AI-driven character evolution in Assassin's Creed. In Game Developers Conference Proceedings. Retrieved from https://www.gdcvault.com
  Ubisoft Montreal. (2024). Neo NPC: AI-driven character evolution in Assassin's Creed. In Game Developers Conference Proceedings. Retrieved from https://www.gdcvault.com
  Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., & Polosukhin, I. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30, 5998-6008.
  Zhang, Y., Sun, S., Galley, M., Chen, Y.-C., Brockett, C., Gao, X., & Dolan, B. (2020). DialoGPT: Large-scale generative pre-training for conversational response generation. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, 270–278.
 
 
 
Return to search menu
       
Editorial Board of Maejo Information Technology and Innovation Journal MAEJO UNIVERSITY
No. 63 Moo 4, Nong Han Subdistrict, San Sai District, Chiang Mai Province 50290  mitij@mju.ac.th