{"title":"Leveraging deep reinforcement learning for dynamic NPC behavior and enhanced player experience in unity3d","authors":"Ahmad Affandi Supli, Xu Siqi","doi":"10.1016/j.entcom.2025.101007","DOIUrl":null,"url":null,"abstract":"<div><div>With the innovation of information technology and the improvement of computer hardware and software, players’ needs gradually change from pursuing the ultimate visual and auditory feast to the inner performance, gameplay, interactive elements, etc. As an essential part of game content, game AI plays the role of communication and interaction with players. Since the emergence of game AI, it has been paid attention to by game developers. However, it is also a difficult job to make brilliant game AI. The common approaches to implementing game AI are finite state machines and behavior trees. Still, these two approaches require much work to implement flexible game AI and are difficult to maintain later. Therefore, this paper aims to investigate machine learning to train a compliant and flexible game AI. Specifically, this paper adopts a method to train game AI in Unity scenes using machine learning methods such as deep reinforcement learning with the help of the ML-Agents toolkit and Python programming interface. In order to better test the performance of the machine learning method, this study designs a game based on the Unity game engine, which includes a game AI implemented using behavior trees and machine learning. Through the production process and the final implementation results, this paper compares the differences in design ideas and implementation process between using behavior trees and using machine learning to implement game AI, as well as the advantages and disadvantages of each. The purpose of this study is to promote machine learning in the field of game research and achieve higher operational efficiency. Relevant existing principles and guidelines inform the game design process. In addition, the game proposed in this paper can be used as future research to promote machine learning in games to achieve a more efficient, more straightforward design and better player experience. After the game implementation, a quantitative research method is used to measure the players’ immersion in the game and the players’ satisfaction with the designed game AI. The evaluation results showed that most respondents believed that the proposed agents performed well against both human players and inbuilt game agents.</div></div>","PeriodicalId":55997,"journal":{"name":"Entertainment Computing","volume":"55 ","pages":"Article 101007"},"PeriodicalIF":2.4000,"publicationDate":"2025-07-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Entertainment Computing","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S1875952125000874","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"COMPUTER SCIENCE, CYBERNETICS","Score":null,"Total":0}
引用次数: 0
Abstract
With the innovation of information technology and the improvement of computer hardware and software, players’ needs gradually change from pursuing the ultimate visual and auditory feast to the inner performance, gameplay, interactive elements, etc. As an essential part of game content, game AI plays the role of communication and interaction with players. Since the emergence of game AI, it has been paid attention to by game developers. However, it is also a difficult job to make brilliant game AI. The common approaches to implementing game AI are finite state machines and behavior trees. Still, these two approaches require much work to implement flexible game AI and are difficult to maintain later. Therefore, this paper aims to investigate machine learning to train a compliant and flexible game AI. Specifically, this paper adopts a method to train game AI in Unity scenes using machine learning methods such as deep reinforcement learning with the help of the ML-Agents toolkit and Python programming interface. In order to better test the performance of the machine learning method, this study designs a game based on the Unity game engine, which includes a game AI implemented using behavior trees and machine learning. Through the production process and the final implementation results, this paper compares the differences in design ideas and implementation process between using behavior trees and using machine learning to implement game AI, as well as the advantages and disadvantages of each. The purpose of this study is to promote machine learning in the field of game research and achieve higher operational efficiency. Relevant existing principles and guidelines inform the game design process. In addition, the game proposed in this paper can be used as future research to promote machine learning in games to achieve a more efficient, more straightforward design and better player experience. After the game implementation, a quantitative research method is used to measure the players’ immersion in the game and the players’ satisfaction with the designed game AI. The evaluation results showed that most respondents believed that the proposed agents performed well against both human players and inbuilt game agents.
期刊介绍:
Entertainment Computing publishes original, peer-reviewed research articles and serves as a forum for stimulating and disseminating innovative research ideas, emerging technologies, empirical investigations, state-of-the-art methods and tools in all aspects of digital entertainment, new media, entertainment computing, gaming, robotics, toys and applications among researchers, engineers, social scientists, artists and practitioners. Theoretical, technical, empirical, survey articles and case studies are all appropriate to the journal.