Journal of Multiscale Materials Informatics
Vol. 3 No. 2 (2026): October (In Progress)

Implementation of a Finite State Machine for Controlling NPC Customer Behavior in the 2D Game "Cooking Chaos"

Syakira Tasya (Universitas Suryakancana)
Diny Syarifah Sany (Universitas Suryakancana)



Article Info

Publish Date
03 Sep 2026

Abstract

Non-Player Characters (NPC) are components in games that can be used to create interactions and gameplay dynamics. NPC behavior control is required to enable characters to respond appropriately to conditions occurring during gameplay. This study aims to implement a Finite State Machine (FSM) to control customer NPC behavior in the Unity-based 2D game Cooking Chaos. The implemented FSM consists of four states: Waiting, Angry, Chasing, and Attack. State transitions are influenced by the customer’s patience system and interaction conditions with the player. When the patience time expires, the customer changes behavior from waiting to becoming angry, chasing, and potentially attacking the player. The implementation was evaluated using Black Box Testing, FSM Transition Testing, and Multi-Customer Testing. The Black Box Testing results showed that all 12 functional scenarios were valid. FSM Transition Testing on seven scenarios, each tested 10 times, resulted in 70 successful trials out of 70. Multi-Customer Testing demonstrated that the order, patience, and FSM mechanisms operated independently with up to three active customers simultaneously. The results indicate that the implemented FSM consistently controls customer NPC behavior transitions under the defined test scenarios and integrates the service mechanism with direct gameplay consequences for the player.

Copyrights © 2026






Journal Info

Abbrev

jimat

Publisher

Subject

Chemical Engineering, Chemistry & Bioengineering Computer Science & IT Industrial & Manufacturing Engineering Materials Science & Nanotechnology

Description

Journal of Multiscale Materials Informatics (JIMAT) is a peer-reviewed, open-access, free of APC (until December 2025), and published 2 times (April and October) in one year. JIMAT is an interdisciplinary journal emphasis on cutting-edge research situated at the intersection of materials science and ...