Manuscript Offprint

arXiv:2610.11663

Constrained Command-Conditioned Reinforcement Learning with Bandit Strategy Selection in Real-Time Strategy Games

Nick Leenders, Roy Lindelauf, Joost van Oijen, Boris Cule

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Deep reinforcement learning agents reach strong performance in real-time strategy games but can be brittle against opponents outside their training distribution. Separating strategic command selection from learned unit control allows different strategies to be selected for different opponents while reusing the same execution policy. This requires an executor that can follow different commands and measurable criteria for assessing whether it does so. We introduce a constrained command-conditioned Proximal Policy Optimization (PPO) policy, the executor, for MicroRTS, a real-time strategy environment. Discrete commands specify strategic objectives and behavioral requirements for economy, army composition, military posture, and worker policy over multiple environment steps; the executor determines the unit-level actions used to fulfill them. A Thompson-sampling bandit acts as the strategist, selecting command tuples from an estimate of the opponent's strategy built from in-game observations rather than opponent identity. In a controlled comparison with a flat PPO baseline trained with the same architecture, budget, curriculum and self-play league, the strategist-executor system wins significantly more often against three of the four strongest opponents on a training map, including the two strongest held-out ones (0.55 → 0.97 and 0.01 → 0.34), with no significant difference against the others.

1 INTRODUCTION

Real-time strategy (RTS) games have been a challenging benchmark for showcasing advances in Reinforcement Learning (RL), with exemplary applications such as OpenAI Five (OpenAI et al., 2019a) and DeepMind's AlphaStar (Vinyals et al., 2019a). Although these agents often reach superhuman performance, they still have limitations in several areas. First, while some post-hoc analysis of learned strategies is possible (OpenAI, 2018), it remains difficult to understand why these agents make particular decisions or to directly steer their behavior. Secondly, these agents show strategic brittleness: they become optimized against recent training opponents but fail against strategies they have not encountered recently. This is typically addressed by maintaining a diverse population of agents during self-play training (Vinyals et al., 2019b), which makes robustness a property of the training distribution rather than something the agent can adapt at play time.

Separating strategic choice from unit control is the logical answer to both problems, but existing separations each sacrifice something. Hierarchical RL (Dayan & Hinton, 1992; Bugeja et al., 2019) makes the goal explicit, yet rewards following it with a bonus that, in an adversarial game, trades off directly against winning, and gives no criterion for whether it was followed at all. Portfolio-based search and programmatic strategies (Churchill & Buro, 2013; Mariño et al., 2021) provide an

*Corresponding author: nick.leenders@nlr.nl interpretable and verifiable choice space, but rely on scripted execution that cannot match learned policies in unit-level control.

We introduce a framework for strategic control built around three components: a fixed, human-readable command space with explicit, state-measurable success criteria; an executor trained across commands to maximize game performance subject to a separate success-rate constraint for each command; and a strategist that adjusts command selection in response to observed opponent behavior without retraining the executor. We evaluate the framework in microRTS (Huang et al., 2021), an RTS environment used in the annual IEEE Conference on Games competitions. We highlight the following main contributions:

  • A command system with measurable outcomes. The strategist selects a four-slot command tuple covering economy, unit composition, military posture, and worker policy, with 16 commands across the four slots. Each command specifies when it may be issued and what the executor must achieve within an execution window, such as producing the requested unit composition. Game-state measurements determine whether the command succeeds, fails, or times out, allowing us to measure how reliably the executor follows each command and, by holding commands fixed, which strategies win against which opponents.

  • A constrained command-conditioned executor. A RL policy trained to maximize game performance subject to a separate success-rate constraint for each command. Per-command Lagrange multipliers adapt to measured adherence shortfalls and weight normalized adherence advantages, with a heuristic guard for persistently stalled constraints.

• An observation-based bandit strategist. A bandit strategist learns how well command tuples perform against different opponent behaviors, sharing information across combinations through their individual commands. During training, it explores promising and uncertain combinations using Thompson sampling. During evaluation, the frozen strategist selects command tuples from its learned estimates and the opponent behavior suggested by current observations, without opponent identity or retraining the executor.

  • A controlled comparison with flat PPO. We compare the complete strategist–executor system against a flat PPO baseline using the same base architecture, environment-step budget, curriculum, and self-play league. Our strategist–executor achieves significantly higher win rates against three of the four strongest opponents, two of them unseen during training, and matches flat PPO against the weaker ones.

References (68)