Gaming with AI: A Hybrid Reinforcement Learning, Large Language Model, and Procedural Content Generation Framework for Enhancing Player Engagement and User Experience
Abstract
Most existing game AI research examines individual mechanisms—Dynamic Difficulty Adjustment (DDA), large language model (LLM)-driven NPC dialogue, and Procedural Content Generation (PCG)—in isolation, leaving open the question of how these subsystems interact when evaluated together against a shared user-experience (UX) measure. This paper presents and evaluates a Hybrid AI Gaming Framework that runs three complementary modules asynchronously: (1) a Proximal Policy Optimisation (PPO) reinforcement-learning agent for real-time difficulty calibration, (2) a vector-grounded Memory Repository that anchors LLM-based NPC dialogue to the game's canonical world state, and (3) a deep-learning player-behaviour model that drives PCG-based content variety. The system was deployed in Unreal Engine 5, using a quantised Llama-3-8B-Instruct model served over a Python microservice, with Qdrant as the vector store. A double-blind user study (N = 80) yielded statistically significant improvements across all seven Game Experience Questionnaire (GEQ) dimensions (p < 0.001), with Flow State reaching 3.64/4.0 and Immersion 3.78/4.0. Average session length increased by 42.5%, and Day-14 retention reached 78.4% versus 22.5% for the scripted baseline. The Memory Repository held narrative hallucination to just 0.4% across 25 dialogue turns, and an ablation study confirmed that every architectural component makes a distinct, non-redundant contribution. Together, the results suggest that hybrid, task-differentiated AI architectures yield engagement gains that no single paradigm can match.