Reinforcement Learning for AI NPC Literacy Educational Game

Closed

Septian Enggar Sukmana, Muh. Shulhan Khairy, Muh. Hasyim Ratsanjani, Cahya Rahmad, Maskur, M. Afada Nur S. Saiva

2024 Proceedings - IEIT 2024 - 2024 International Conference on Electrical and Information Technology Conference paper Cited by 4 Quartile

Abstract

Player engagement and enjoyment are critical factors in game design, significantly enhanced by the presence of adaptive AI. Reinforcement Learning (RL) facilitates game development by enabling non-Player Characters (NPCs) to adapt to dynamic in-game situations, thereby maintaining player interest and preventing monotony. This adaptability is also crucial for educational games that aim to improve literacy. This paper details the implementation of RL using the Q-Learning algorithm to improve NPC behavior in the 2D Cyberpunk-themed game, CyberHero. The study focuses on the DroneEnemy agent, defining states such as isGrounded, Distance To Player, isFacingRight, and isWallDetected, and actions including ShootLaser, Move Left, and Move Right. The Q-Learning model produced diverse and adaptive behaviors, significantly outperforming the hardcoded approach. During a single training episode, the Q-Table recorded 1,280 entries, demonstrating varied actions with an average player-agent distance of 17.09 and an average reward of -0.05. In contrast, hardcoded NPCs exhibited limited actions and lower average rewards. Additionally, a Security Awareness minigame was integrated, providing interactive education on strong password selection. The findings affirm RL's effectiveness in generating dynamic NPC behaviors, enhancing gameplay, and delivering educational value in CyberHero. © 2024 IEEE.

Affiliations

Jurusan Teknologi Informasi, Politeknik Negeri Malang, Malang, Indonesia; Jurusan Teknologi Informasi, Politeknik Negeri Malang, Malang, Indonesia