Abstract
Procedural Content Generation via Reinforcement Learning (PCGRL) has traditionally relied on single-agent architectures that struggle with computational efficiency and generalization to larger or differently shaped environments. This paper proposes a paradigm shift, reimagining level design as a cooperative multi-agent task. By utilizing multiple agents with restricted local views and shared rewards, the researchers achieved faster training cycles, higher quality level generation, and superior generalization to out-of-distribution (OOD) map configurations. The framework, implemented in JAX, demonstrates that local coordination can effectively solve global design problems while significantly reducing the computational overhead associated with traditional PCGRL.
Introduction
Procedural Content Generation (PCG) is essential for creating expansive, varied game worlds without the prohibitive cost of manual labor. PCGRL specifically uses reinforcement learning to train agents to build levels by modifying tiles to maximize a reward function. However, single-agent PCGRL faces a significant bottleneck: as map sizes grow, the "horizon" (the number of steps required to complete a level) increases, and the computational cost of calculating global rewards (such as pathfinding) after every single tile change becomes $O(N^2)$.
This research addresses these limitations by introducing a multi-agent framework where several agents work simultaneously to construct a level. This approach not only parallelizes the construction process but also changes how agents perceive and interact with the environment, leading to more robust design capabilities.
Methodology
The authors implemented their framework using JAX, allowing the entire training loop—including the environment and the agents—to run in parallel on the GPU. This architecture supports several key technical components:
- MAPPO (Multi-Agent Proximal Policy Optimization): Agents utilize a shared policy and a shared reward function, ensuring they work toward a common goal rather than competing.
- "Turtle" Representation: Agents are mobile entities that move to adjacent tiles and decide whether to modify the current tile (e.g., placing a wall, an enemy, or a path).
- Local Observations: Instead of a global view, agents are restricted to a small $3 \times 3$ egocentric patch. This restriction forces agents to learn local design patterns that are applicable regardless of their absolute position on the map.
- Reward Frequency Tuning: To mitigate the cost of global heuristic calculations, the system allows rewards to be calculated only after a set number of environment steps. This "batching" of edits significantly improves training efficiency.
- Stigmergy: Coordination is achieved through the environment itself. Agents observe the changes made by their peers and react accordingly, allowing for emergent cooperation without explicit communication protocols.
Experimental Setup
The approach was evaluated across two distinct PCGRL domains:
- Binary Domain: Agents must create a maze with the longest possible path (diameter) while ensuring all empty tiles remain connected.
- Dungeon Domain: A complex task involving the placement of a player, a key, a door, and enemies. The level must be functional: the player must be able to reach the key and then the door while avoiding enemies.
Training was conducted on fixed $16 \times 16$ grids. To test generalization, the models were evaluated on "Out-of-Distribution" (OOD) scenarios, including randomized rectangular shapes and larger $32 \times 32$ maps.
Key Insights and Results
The Power of Locality
One of the paper's most significant findings is that restricted visibility is a benefit. By providing agents with only a $3 \times 3$ view, they are prevented from memorizing specific map layouts. Instead, they learn fundamental "design rules"—such as how to extend a corridor or create a room. This focus on local motifs allows the agents to maintain high performance when moved to maps of entirely different shapes and sizes.
Performance and Generalization
In the Dungeon domain, a three-agent team achieved a mean episode reward of 364.47 on $32 \times 32$ maps, whereas a single-agent baseline only reached 213.78. The multi-agent approach also showed dramatic resilience in OOD tests; on random $32 \times 32$ mazes, the multi-agent system scored 88.43, significantly outperforming the single agent's 68.36.
Computational Efficiency
The transition to a multi-agent JAX-based system resulted in a ~17x speedup in training time compared to traditional CPU-based Python implementations. Furthermore, the researchers found that rewards could be calculated as infrequently as every 10 steps without a loss in performance, suggesting that the system can scale to complex domains where reward calculation is computationally taxing.
Conclusion and Future Work
By framing level design as a multi-agent problem, this research overcomes the primary scaling and generalization hurdles of PCGRL. The agents demonstrate emergent cooperation, effectively dividing the map into regions and applying learned design patterns to create coherent global structures.
Future research directions include:
- Hierarchical Roles: Implementing "manager" agents to oversee high-level layout while "worker" agents handle tile-level details.
- Heterogeneous Agents: Equipping different agents with different "tools" or brushes to increase design variety.
- Co-Creative Tools: Integrating these multi-agent models into human-AI collaborative editors, where a human designer acts as one of the agents in the collective process.
Summary updated