Implementation of Fuzzy Logic Algorithm to Improve NPC Decision-Making in 2D Adventure Games Using Unity

  • Kevin
  • Octara Pribadi
  • Hendri
N/ACitations
Citations of this article
14Readers
Mendeley users who have this article in their library.

Abstract

In 2D adventure games, Non-Playable Characters (NPCs) play a crucial role in creating a more immersive and interactive experience. However, static and non-adaptive NPC behavior may reduce the game quality. This study aims to enhance NPC artificial intelligence by implementing the Fuzzy Logic algorithm in decision-making processes. The input parameters include the distance between the NPC and the player, the player's health level, and the player's level, with four possible outputs: chase, evade, defend, and wait. A fuzzy rule base consisting of 27 rules was developed and implemented in a Unity-based game. Testing was conducted on various input combinations to evaluate the NPC’s responses. Results indicate that NPCs respond more adaptively, such as evading when the player has high health and level at a close range, or waiting when the situation is unfavorable. This implementation improves interaction dynamics between NPCs and players, and adds strategic depth to the gameplay.

Cite

CITATION STYLE

APA

Kevin, Octara Pribadi, & Hendri. (2025). Implementation of Fuzzy Logic Algorithm to Improve NPC Decision-Making in 2D Adventure Games Using Unity. Journal of Artificial Intelligence and Engineering Applications (JAIEA), 4(3), 2376–2381. https://doi.org/10.59934/jaiea.v4i3.1175

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free