Analisis Perbandingan Metode Finite State Machine dan Behavior Tree untuk Pengembangan Kecerdasan Musuh dalam Ganyang Setan Alas! The Game!
Muhammad Luthfi Azzahra R., Yusron Fuadi, S. Sn., M.Sn.
2025 | Tugas Akhir | D4 Teknologi Perangkat Lunak
Gim merupakan salah satu bentuk hiburan yang dinikmati oleh masyarakat luas pada era digital zaman ini dengan jumlah pemain gim yang selalu meningkat setiap tahunnya di seluruh dunia. Oleh karena itu, dari tahun ke tahun, jumlah gim yang dikeluarkan semakin banyak. Sebagian besar dari gim yang keluar tersebut memiliki NPC (Non-Player Character) yang berfungsi untuk memperdalam interaksi pemain dengan gim. Salah satu bentuk NPC (Non-Player Character) yang ditemui di dalam gim adalah musuh yang bertujuan untuk menghambat pemain dalam mencapai tujuannya di dalam gim. Karena diperlukannya pengembangan musuh di dalam gim maka pengembangan musuh dapat dilakukan melalui teknik hard-coding. Akan tetapi, teknik ini sangat sulit untuk dipelihara ketika kompleksitas gim bertambah. Sehingga, diperlukannya metode pengembangan kecerdasan musuh yang memudahkan proses tersebut, seperti metode FSM (Finite State Machine) dan BT (Behavior Tree) yang umum digunakan dalam industri gim yang masing-masing memiliki keuntungan beserta kelemahannya tersendiri. Salah satu gim yang sedang mencari metode pengembangan musuh yang sesuai adalah Ganyang Setan Alas! The Game! dari PT Pabrik Imaji Akasacara sehingga dilakukanlah ujicoba perbandingan FSM (Finite State Machine) dan BT (Behavior Tree) dalam aspek reaktivitas, performa dan skalabilitas untuk menentukan metode yang sesuai. Dari ujicoba tersebut, didapatkan bahwa BT (Behavior Tree) lebih unggul pada aspek reaktivitas karena lebih tahan terhadap kegagalan (fault-tolerant) dan aspek skalabilitas karena jumlah garis edges yang lebih rendah daripada FSM (Finite State Machine). Sedangkan FSM (Finite State Machine) hanya unggul dalam aspek performa saja dengan rata-rata waktu pengunaan CPU (Central Processing Unit) sebesar 0,372ms dan penggunaan memory sebesar 8,33KB dibandingkan BT (Behavior Tree) yang meraih rata-rata waktu penggunaan CPU (Central Processing Unit) sebesar 1,823ms dan penggunaan memory sebesar 9,56KB. Karena BT (Behavior Tree) lebih unggul pada 2 dari 3 metrik yang diujicoba, maka digunakanlah metode BT (Behavior Tree)
untuk pengembangan Ganyang Setan Alas! The Game!.
Games are a form of entertainment enjoyed by the wider community in today’s digital era with the number of game players always increasing every year worldwide. Therefore, the number of games released every year is continously increasing. Most of these games feature NPCs (Non-Player Characters) that serve to deepen the interaction between players with the game. One of them are enemies which main objective is to hinder players from achieving their goals within the game. Since it is necessary to develop enemy behavior in games, it is commonly done using hard-coding techniques. However, this technique becomes very difficult to maintain as the complexity in the game increases. Therefore, it is required a method that simplifies enemy intelligence development to be implemented, common methods used in the games industry includes methods such as FSM (Finite State Machine) and BT (Behavior Tree), each of which comes with a set of advantages and disadvantages. One game currently seeking an appropriate method to develop enemy intelligence in Ganyang Setan Alas! The Game! from PT Pabrik Imaji Akasacara. In order to choose the appropriate method, a comparative test was conducted between FSM (Finite State Machine) and BT (Behavior Tree) in terms of reactivity, performance, and scalability. From the test, it was found that BT (Behavior Tree) is superior in terms of reactivity because it is more fault-tolerant and in terms of scalability due to the lower number of edges compared to FSM (Finite State Machine). Meanwhile, FSM (Finite State Machine) in the other hand only excels in terms of performance with an average CPU usage time of 0.372ms and memory usage of 8.33KB compared to BT (Behavior Tree), which achieved an average CPU usage time of 1.823ms and
memory usage of 9.56KB. Since BT (Behavior Tree) is superior in 2 out of 3 metrics tested, the BT (Behavior Tree) method was used for the development of Ganyang Setan Alas! The Game!
Kata Kunci : Gim, Kecerdasan Musuh, Action, Finite State Machine, Behavior Tree, Ujicoba, Pengembangan, Implementasi, Reaktivitas, Performa, Skalabilitas