← Back to VOLUME 13, ISSUE 11, NOVEMBER 2026
This work is licensed under a Creative Commons Attribution 4.0 International License.
A History-Based Machine Learning Approach for Dynamic Difficulty Adjustment in 2D Games
Harish Dharrsan S S, Mirulaa Srithar, Bhavitha K, S. Poornima
👁 3 views📥 2 downloads
Abstract: Fixed difficulty presets in digital games cannot adapt to individual differences in reaction speed, motor coordination, or learning progression, frequently leaving novice players frustrated by repeated early collisions and experienced players unchallenged by static obstacle layouts. Conversely, naive reactive dynamic difficulty adjustment (DDA) heuristics that modify parameters after every isolated outcome suffer from high variance, because a momentary slip does not reflect genuine skill degradation and a single successful passage does not confirm mastery. To address this problem without requiring invasive external cameras, physiological sensors, or computationally expensive deep reinforcement learning policies, this paper presents FLAPPY ADAPT, a lightweight, history-based machine learning (ML) framework for real-time adaptive difficulty control in a 2D Flappy Bird style arcade game built with Python and Pygame. During each active gameplay attempt, the system holds the vertical obstacle gap strictly constant to preserve spatial predictability and logs fine-grained interaction telemetry—including score, survival time, obstacles passed, collision outcomes, normalized vertical bird height, vertical velocity at pipe crossings, and active gap geometry—to structured CSV session records. Between attempts, a feature extraction pipeline transforms recent gameplay history into a leakage-free ten-dimensional feature vector summarizing multi-horizon rolling passage rates (R3, R5, and R10), short-term performance trends, consecutive success and failure streaks, and normalized physical state variables. A class-balanced, L2-regularized Logistic Regression classifier processes this vector to estimate the probability that the player will successfully pass the next obstacle. A decoupled difficulty controller compares the predicted pass probability against a target threshold of 0.6 and applies a bounded step adjustment to the obstacle gap for the subsequent attempt, supported by a rule-based cold-start fallback when fewer than 80 valid labeled interactions exist or class distributions are highly skewed. We evaluate FLAPPY ADAPT against a static Fixed-difficulty baseline and a streak-based Reactive heuristic controller under identical game physics. While the Fixed baseline records the highest raw numerical scores due to its unchanging geometry, the adaptive controllers intentionally regulate challenge around the target skill threshold. Between the two adaptive approaches, the proposed history-based ML controller outperforms the reactive baseline across all primary gameplay metrics, achieving a 17.0% higher average score (6.20 vs. 5.30), a 10.3% longer average survival time (12.69 s vs. 11.50 s), and a 1.98 percentage-point improvement in obstacle passage rate (86.11% vs. 84.13%). We also examine real-time HUD telemetry outputs, discuss current stability trade-offs in difficulty transition frequency, and outline future extensions for hysteresis smoothing and user engagement studies.
Keywords: Dynamic difficulty adjustment, logistic regression, player skill estimation, adaptive games, Pygame, history-based machine learning, bounded difficulty control.
Keywords: Dynamic difficulty adjustment, logistic regression, player skill estimation, adaptive games, Pygame, history-based machine learning, bounded difficulty control.
How to Cite:
[1] Harish Dharrsan S S, Mirulaa Srithar, Bhavitha K, S. Poornima, “A History-Based Machine Learning Approach for Dynamic Difficulty Adjustment in 2D Games,” International Advanced Research Journal in Science, Engineering and Technology (IARJSET), DOI: 10.17148/IARJSET.2026.131145
