Adversarial Hierarchical-Task Network Planning for Complex Real-Time Games

Santiago Ontañón, Michael BuroIJCAI 2015

Abstract

Real-time strategy (RTS) games are hard from an AI point of view because they have enormous state spaces, combinatorial branching factors, allow simultaneous and durative actions, and players have very little time to choose actions. For these reasons, standard game tree search methods such as alphabeta search or Monte Carlo Tree Search (MCTS) are not sufficient by themselves to handle these games. This paper presents an alternative approach called Adversarial Hierarchical Task Network (AHTN) planning that combines ideas from game tree search with HTN planning. We present the basic algorithm, relate it to existing adversarial hierarchical planning methods, and present new extensions for simultaneous and durative actions to handle RTS games. We also present empirical results for the µRTS game, comparing it to other state of the art search algorithms for RTS games.

Introduction

Real-Time Strategy (RTS) games like StarCraft represent a frontier for artificial intelligence research. Unlike discrete games such as Chess or Go, RTS environments feature enormous branching factors—often exceeding $10^{50}$ possible action combinations per frame—alongside simultaneous moves and durative actions. Standard search algorithms like Alpha-Beta pruning or Monte Carlo Tree Search (MCTS) struggle in these domains because they typically operate on "raw" unit-level actions, failing to capture the strategic abstractions necessary for long-term planning.

This paper addresses this gap by introducing Adversarial Hierarchical-Task Network (AHTN) planning. AHTN is a hybrid framework that merges the strategic decomposition of HTN planning with the adversarial search principles of Minimax, allowing for effective play in complex, real-time environments.

The core of the AHTN algorithm lies in its ability to search through a space of high-level strategic "tasks" rather than individual unit clicks.

Hierarchical Task Network (HTN) Planning

In HTN planning, the AI does not search through all possible primitive actions. Instead, it uses a domain definition to decompose high-level goals (e.g., "destroy-player") into smaller sub-tasks (e.g., "harvest" and "worker-rush") until primitive actions are reached. This hierarchical structure significantly reduces the effective branching factor.

Example of an HTN domain where a high-level task is decomposed into sub-tasks for parallel execution.

Adversarial Search Tree

AHTN treats these task decompositions as "moves" in a game tree. The algorithm explores various ways a player could decompose their tasks while simultaneously anticipating the opponent's potential strategic responses. By structuring the problem this way, standard optimizations like alpha-beta pruning can be applied to skip unpromising strategic branches.

The AHTN search tree structure showing how task decompositions are explored across Max and Min layers.

Handling RTS Dynamics

To accommodate the specific requirements of RTS games, the authors extended AHTN to handle:

  • Durative Actions: The search uses a "simulate until next choice point" approach to account for actions that take time.
  • Simultaneous Moves: The framework allows multiple units to be assigned tasks within the same search node, reflecting the concurrent nature of RTS gameplay.

Experimental Evaluation

The researchers evaluated AHTN using $μ$RTS, a minimalistic environment designed for AI research, across various map sizes ($8 \times 8$, $12 \times 12$, and $16 \times 16$). They compared several AHTN configurations—ranging from low-level unit control (AHTN-LL) to high-level strategy portfolios (AHTN-P)—against state-of-the-art baselines like ABCD (Alpha-Beta Considering Durations) and NaiveMCTS.

Key Results

  • Superior Performance: The "Flexible" AHTN (AHTN-F) variant was the clear winner, achieving an average win-rate score of 0.90, significantly outperforming specialized methods like NaiveMCTS (0.56).
  • Deeper Lookahead: Due to the reduced branching factor, AHTN achieved much deeper lookahead. While low-level search might only project 13 game cycles ahead, portfolio-based AHTN could look ahead over 180 cycles.
  • Scalability: Unlike non-hierarchical methods that degrade as map size and unit counts increase, AHTN maintained high performance because its strategic tasks remain stable regardless of the physical scale of the map.

Conclusion and Future Work

AHTN provides a robust framework for bridging the gap between hardcoded "scripted" play and raw search-based AI. By searching through strategies rather than actions, it achieves a level of strategic depth previously unattainable in RTS games.

Current limitations include a dependency on human-authored HTN domains and a focus on perfect-information scenarios. Future research aims to automate the extraction of HTN hierarchies from human game replays and extend the algorithm to handle partial observability (Fog of War).

Summary updated

BibTeX
@inproceedings{ontanon2015adversarial,
  author = {Santiago Ontañón and Michael Buro},
  title = {{Adversarial Hierarchical-Task Network Planning for Complex Real-Time Games}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2015},
  url = {https://openreview.net/forum?id=S1WqSXGuWH},
}
Figure