Reward Shaping for Improved Learning in Attacker-Defender Game

John Kliem, Prithviraj Dasgupta · Procedia Computer Science · 2025

We investigate the effect of reward shaping in improving the performance of reinforcement learning in the context of a real-time strategy game called capture-the-flag. The game is characterized by sparse rewards that are associated with infrequently occurring events such as grabbing or capturing the fag, or tagging the opponent player. We show that appropriately designed reward shaping functions applied to different game events can significantly improve the player’s performance and training times of the player’s learning algorithm. We have validated our reward shaping functions within a simulated environment for playing a marine capture-the-flag game between two players. Our experimental results demonstrate that reward shaping can be used as an effective means to understand the importance of different sub-tasks during game-play towards winning the game, to encode a secondary objective functions such as energy efficiency into a player’s game-playing behavior, and, to improve learning generalizable policies that can perform well against different skill levels of the opponent.

Read the paper · More papers on PaperTik