Aiming to address pedagogical challenges in programming education and the limitations of static feedback mechanisms, this study designed and evaluated an AI-supported adaptive Role-Playing Game (RPG) for teaching C++. The Design-Based Research methodology was adopted to bridge the gap between theoretical design and practice. Across five iterative cycles involving 70 participants, a dynamic feedback system responsive to student performance was created by integrating Retrieval-Augmented Generation (RAG) architecture and Large Language Models. Findings indicated that the short-term game intervention did not yield a statistically significant change in academic attitude and motivation. However, in later stages where system stability was secured, qualitative data indicated a shift in student focus from interface issues to deeper learning of programming concepts. In-game log data suggested that adaptive mechanisms and reflective elements helped transition students from inefficient trial-and-error strategies toward more analytical behavior. Crucially, the findings imply that the reflection mechanism contributed to establishing a psychologically safe space where mistakes were treated as an intrinsic part of the learning process rather than failures. This personalized support appeared to show potential in mitigating the cycle of learned helplessness by supporting students' emotional resilience. The study offers a set of evidence-based principles for designers by illuminating the behavioral effects of using generative AI as an educational scaffold.
Aydemir et al. (Sun,) studied this question.