Implementasi Logika Finite State Machine Dalam Perilaku Enemy Boss Dalam Game 2D

Main Article Content

Reka Adrian
Mutaqin Akbar

Abstract





This study presents the implementation of a Finite State Machine (FSM) to control enemy behavior in a 2D game environment based on the player’s attack patterns. FSM is applied to manage dynamic transitions between states such as Idle, Attack, Teleport, and Summon. Each state is triggered by contextual gameplay variables including player proximity, number of consecutive hits, and enemy health level. The AI system was developed using the Godot Engine and GDScript, incorporating visual assets via sprite sheets linked to each behavioral state. The FSM framework allows the enemy character to react adaptively teleporting after repeated attacks and summoning reinforcements thus simulating intelligent behavior. System evaluation was conducted using black-box testing in simulated combat scenarios. Results demonstrate that the FSM-based AI provides enhanced gameplay variability, responsiveness, and strategic challenge, while maintaining system modularity and scalability. The findings support the effectiveness of FSM for real-time enemy behavior modeling in 2D games and offer a reference framework for future development of adaptive AI in interactive digital environments.





Article Details

Section
Articles

References

Muhammad B. Rizqi Alvian, S. Bukhori, & M. A. Furqon, “Implementasi Finite State Machine untuk Menentukan Perilaku NPC pada Game Simulasi Kepemimpinan,” J. Simulasi Kepemimpinan, Nov. 2023.

A. Akram, R. Tehseen, S. Saqib, F. Nazir, dan

M. Mehr Awan, “Advanced AI Mechanics in Unity 3D for Immersive Gameplay: A Study on Finite State Machines & Artificial Intelligence,” Int. J. Innov. Sci. Technol., vol. 6, no. 4, hlm. 2047–2068, Des. 2024.

Russell, S. J., & Norvig, P. (2021). Artificial Intelligence: A Modern Approach. Pearson.

Champandard, A. J. (2004). AI Game Development: Synthetic Creatures with Learning and Reactive Behaviors. New Riders.

D. Aversa, Unity Artificial Intelligence Programming: Add Powerful, Believable, and Fun AI Entities in Your Game, 5th ed., Birmingham: Packt, 2022. (meskipun bukan jurnal, edisi 2022 ini relevan untuk penerapan FSM di Unity.

Orkin, J. (2006). Three States and a Plan: The AI of

F.E.A.R. GDC Lecture.

Rabin, S. (2015). Game AI Pro: Collected Wisdom of Game AI Professionals. CRC Press.

Godot Engine Documentation. https://docs.godotengine.org.

Menouar, H. et al. (2017). UAV-enabled intelligent transportation systems. IEEE Communications Magazine.

P. Qureshi, “Gameplay Analysis Using Finite State Machines,” Conference on Automata Theory in Game Development, Jun. 2024.

Wijaya, R. (2020). Pengembangan AI Musuh dalam Game Menggunakan FSM. Jurnal Ilmu Komputer.

C. Nugraha, A. I. Purnamasari, A. Bahtiar, dan E. Tohidi, “Implementation of Finite State Machine on NPCs to Improve Game Productivity,” J. Artif. Intell. Eng. Appl., vol. 4, no. 3, pp. 1673–1677, Jun. 2025.

Priambodo, A. (2021). FSM Implementation on Enemy AI in 2D Action Game. IEEE Explore.

Hartanto, A. & Suryani, L. (2020). Design Pattern dan FSM dalam Game Development. Jurnal Teknologi Informasi.

Budiman, R. (2022). Adaptive Enemy AI Behavior in 2D Games Using FSM. International Conference on Game Technology.

Statista, “Gaming Market Size Worldwide 2022–2027.” [Online]. Available: https://www.statista.com.