Treffer: Development of Two Dimension (2D) Game Engine with Finite State Machine (FSM) Based Artificial Intelligence (AI) Subsystem.
Weitere Informationen
With Al becoming more and more relevant in today's world, this project aims to develop a 2D game engine with an Al subsystem for state-driven agents, which is rarely implemented by a lot of 2D engines out there. In this study, a 2D game engine was designed with an FSM (Finite State Machine)--based AL subsystem using state-driven game agents. The engine was implemented using the Javascript programming language and the WebGL 2.0 graphics library/API. It is targeted at web-based games/simulations. Components and subsystems include physics, audio, math, rendering, and AI (based on finite-state machines). The FSM-based AI subsystem is a solution aimed at reducing the ambiguity and performance hits associated with creating 2D game AI in the naive approach. The AI subsystem creates an interface for 2D games to be created with a common paradigm, and simulated with a great level of realism. The state machine used in this study is used to represent a variety of behaviours, such as wandering, attacking, and fleeing. The following conclusions were drawn as regards the impact of the AI approach used on rendering performance; the naive approach to implementing game AI is also compared with the FSM approach in terms of rendering (frames per second/ FPS, or frame rate). With the naive approach (vector math) being used to implement AI, there was a drop in the rendering frame rate to 50 FPS. The FSM approach didn't affect the frame rate, which is usually at 60FPS. With a well-developed FSM (Finite State Machine), game agents can transition between states easily as a response to user input or stimulus from the game environment. The proposed method was tested by creating a prototype game with the 2D game engine. The prototype game was a straightforward side-scrolling platformer featuring a cast of non-player characters (NPCs). This approach to implementing 2D game AI goes a long way toward improving performance and mitigating ambiguity in the code. [ABSTRACT FROM AUTHOR]