4th International Symposium on Graduate Research (DEUISGR2025), İzmir, Türkiye, 17 - 19 Aralık 2025, ss.25, (Özet Bildiri)
This study investigates the use of reinforcement learning for high-level enemy decision-making in a first-person horror game developed using the Unity engine. In many commercial games, enemy behavior is created using handcrafted rule-based logic. These systems typically rely on predefined conditions, such as distance thresholds or line-of-sight checks, to determine when the enemy should switch between behaviors, such as patrolling and chasing. While such approaches are computationally efficient and reliable, they often result in predictable behavior that reduces tension and replayability, particularly in horror game contexts where uncertainty and adaptive responses are essential. To address this limitation, this work introduces a hybrid artificial intelligence architecture in which reinforcement learning is applied exclusively to high-level behavioral decisions. At the same time, low-level movement, navigation, animation, and audio feedback remain under deterministic control. With Unity Machine Learning Agents and Proximal Policy Optimization, the enemy is modeled as an autonomous agent that observes continuous spatial information. The data used is the enemy's own position, the player's position, and the normalized direction vector between them. Based on these observations, the learned policy outputs a binary decision indicating whether the enemy should continue patrolling or initiate a chase. The training process employs episodic resets with randomized spawn locations and a distance-aware reward structure that encourages context-sensitive chasing behavior while penalizing unnecessary or implausible actions. Experimental observations indicate that the trained agent develops more adaptive and less predictable chase decisions when compared to traditional rule-based systems. At the same time, motion, animation, and presentation remain under complete designer control. A key contribution of this study is the observation that applying reinforcement learning only at the decision level yields effective results. This approach improves perceived behavior without requiring changes to existing control or design structures. The results show that hybrid artificial intelligence architectures provide a practical and scalable approach to integrating machine learning into real-time game environments. This is particularly relevant in horror games, where maintaining a degree of unpredictability contributes to player engagement.