Методи машинного навчання для керування поведінкою неігрових персонажів у багатокористувацькій рольовій відеогрі
Date
Journal Title
Journal ISSN
Volume Title
Publisher
Видавництво Львівської політехніки
Lviv Politechnic Publishing House
Lviv Politechnic Publishing House
Abstract
Розглянуто розроблення системи, що керуватиме неігровими персонажами для багатокористувацької рольової гри (англ. Role-Playing Game, RPG). У галузі відеоігор, зокрема жанрі RPG, комерційні проєкти рідко застосовують моделі машинного навчання для реалізації поведінки персонажів. Зазвичай використовують примітивні наперед запрограмовані правила або реалізується примітивний скінченний автомат. Такі підходи не дають гравцям відчути, що вони грають із розумними істотами, оскільки різні наперед задані правила стають передбачуваними. Хороший ігровий штучний інтелект повинен створити у гравця враження, ніби він взаємодіє зі справжніми персонажами, які приймають різноманітні, часом непередбачувані, рішення. У статті розглянуто застосування різних моделей машинного навчання для досягнення цієї мети у поєднанні із традиційно використовуваними скінченними автоматами. Поставлене завдання реалізується на прикладі попередньо розробленої відеогри. Здійснено огляд досліджень у галузі ігрового штучного інтелекту, відтак описано систему, яку розробили автори, та її реалізації, що застосовують декілька відібраних і успішно навчених моделей машинного навчання. Для навчання випробувано кілька моделей. Зрештою відібрано модель дерев рішень та нейронної мережі, оскільки вони дали найкращі результати. Описано також навчання цих моделей та наведено огляд результатів. Для цього здійснено випробувальні бої між різними моделями. Результати моделі дерева рішень були трохи кращими, ніж традиційного скінченного автомата, тоді як результати нейромережі набагато кращі. Запропоновані рішення можна розвивати далі, залучаючи складніші моделі та поліпшуючи навчання, щоб створити “розумніших” персонажів, участь яких у грі якісно покращує ігровий процес. Отриману систему інтегровано у відеогру, яка потенційно може стати комерційним продуктом.
This article covers the problem of developing a control system for non-player characters in a multiplayer RPG. Commercial projects in the field of videogames and RPG (Role-Playing Game) projects in particular seldom use machine learning models for the implementation of character behaviour. The most common approach is to use primitive preprogrammed rules, or to implement a finite state machine. Such approaches ruin the immersion of playing with real creatures, since various predefined rules make the characters predictable. A good game AI is supposed to give the player an impression of interacting with real characters, that make various decisions, sometimes unpredictable. To achieve this goal, this article covers an approach with using various machine learning models in conjunction with a traditional finite state machine. A videogame developed earlier is used as the basis for problem solution. The article conducts an analysis of the existing works in the field of videogame AI. Next, the implementation of control system is described. This system utilizes a couple selected and successfully trained machine learning models. A multitude of models were tested, eventually a decision tree model and a neural network were selected, since they yielded the best results. The process of development and implementation of a control system involving machine learning models is then described. The approaches of teaching such models are described, and finally the achieved results are analyzed. To gauge the results, different models were compared against eachother in test battles. The decision tree model showed results slightly better than the traditional finite state machine. Meanwhile, the neural network performed significantly better, beating other models far more often. Achieved results can be developed further, utilizing more complex models and improving training methods, which will result in even more sophisticated characters. Presence of such characters in the game will qualitatively improve the gameplay. Obtained system was integrated into the videogame, that may potentially become a commercial product.
This article covers the problem of developing a control system for non-player characters in a multiplayer RPG. Commercial projects in the field of videogames and RPG (Role-Playing Game) projects in particular seldom use machine learning models for the implementation of character behaviour. The most common approach is to use primitive preprogrammed rules, or to implement a finite state machine. Such approaches ruin the immersion of playing with real creatures, since various predefined rules make the characters predictable. A good game AI is supposed to give the player an impression of interacting with real characters, that make various decisions, sometimes unpredictable. To achieve this goal, this article covers an approach with using various machine learning models in conjunction with a traditional finite state machine. A videogame developed earlier is used as the basis for problem solution. The article conducts an analysis of the existing works in the field of videogame AI. Next, the implementation of control system is described. This system utilizes a couple selected and successfully trained machine learning models. A multitude of models were tested, eventually a decision tree model and a neural network were selected, since they yielded the best results. The process of development and implementation of a control system involving machine learning models is then described. The approaches of teaching such models are described, and finally the achieved results are analyzed. To gauge the results, different models were compared against eachother in test battles. The decision tree model showed results slightly better than the traditional finite state machine. Meanwhile, the neural network performed significantly better, beating other models far more often. Achieved results can be developed further, utilizing more complex models and improving training methods, which will result in even more sophisticated characters. Presence of such characters in the game will qualitatively improve the gameplay. Obtained system was integrated into the videogame, that may potentially become a commercial product.
Description
Citation
Будник Р. Методи машинного навчання для керування поведінкою неігрових персонажів у багатокористувацькій рольовій відеогрі / Роман Будник, Віталій Яковина // Вісник Національного університету "Львівська політехніка". Інформаційні системи та мережі. — Львів : Видавництво Львівської політехніки, 2023. — № 13. — С. 79–92.