# Learned level and map generation (PCGRL, MarioGPT, LLM generators)

*Technique* · `learned-level-generation` · status: **sourced**

Generators trained by reinforcement learning or on example levels, including small and large language models that emit tile maps from text prompts, produce playable levels and maps without hand-written generation rules.

| field | value |
|---|---|
| aliases | PCGRL, MarioGPT, ARLPCG, Word2World, text-to-level, LLM level generation |
| category | Procedural content generation |
| year | 2023 |
| maturity | Research |
| trl | 4 |
| runtime | Offline authoring, Design assist, Client real-time |
| determinism impact | Mitigable |
| horizon | 1-2 years |
| risks | Controllability, Evaluation difficulty, IP / provenance, Player trust / reception |
| affects count *(computed)* | 4 |

## Summary

Generators trained by reinforcement learning or on example levels, including small and large language models that emit tile maps from text prompts, produce playable levels and maps without hand-written generation rules.

## Mechanism

PCGRL treats level design as a sequential decision problem: an agent edits a tile grid step by step (narrow, turtle, or wide representations of where it may edit) and is rewarded by the change in a quality score such as playability, path length, or region count, so the trained generator builds a level in fast forward passes without example levels. ARLPCG adds a solver agent and rewards the generator for levels that are challenging but solvable, with auxiliary control inputs. Language-model generators serialize levels as text and train or prompt a model to continue them: MarioGPT fine-tunes DistilGPT2 with cross-attention to a prompt naming pipes, enemies, blocks, and elevation; Sokoban generators fine-tune on level corpora; Word2World prompts a general LLM to write a story, extract characters and tiles, and place them. Outputs are checked by search agents or solver bots and rejected or repaired if unplayable. Conditional generators such as EA SEED's match-3 cVAE take size, symmetry, and target difficulty as inputs.

## Limitations

- Example data is scarce: MarioGPT trained on 37 levels and LLM Sokoban results scaled with dataset size, so a new game's handful of authored maps may not suffice.
- Validity is not guaranteed: about 12% of MarioGPT levels were not completed by an A* agent, so every output needs a solver check.
- Conditional control is weak: difficulty conditioning hit its target a third of the time and lowered size and tile-distribution accuracy.
- Results are mostly 2D tile grids for small games; large simulation maps with resources, rivers, and settlement suitability carry global constraints these models do not represent.
- Training on existing commercial levels such as Super Mario Bros raises IP and platform disclosure questions for shipped use.

## Sources

- src-khalifa-2020-pcgrl
- src-sudhakaran-2023-mariogpt
- src-todd-2023-llm-level-generation
- src-nasir-2024-word2world
- src-villanueva-2024-match3-conditional-generation
- src-gisslen-2021-arlpcg

## Relations

**affects**

- [Procedural terrain](../mechanic/procedural-terrain.md) (Replaces substrate): Hand-written noise and placement rules give way to a generator trained on example maps or prompted with text, so a seed becomes a prompt plus a sample, and validity must be checked by a solver instead of guaranteed by construction.
- [Scenario objectives](../mechanic/scenario-objectives.md) (Cuts authoring cost): Scenario maps can be produced from a written description of the situation, Word2World-style story to world, with an agent playthrough confirming the stated goal is reachable.
- [Adaptive threat scaling](../mechanic/adaptive-threat-scaling.md) (Deepens): Difficulty-conditioned generators let the next map or wave be built at a target difficulty instead of multiplying enemy counts, though EA SEED's match-3 model hit the requested difficulty only a third of the time.
- [Generative content on demand](../mechanic/generative-content.md) (Deepens): Text-to-level models small enough to run on the client (MarioGPT has 96M parameters) let players request maps in words at runtime, extending generated content from text and items to playable space.

## Backlinks (computed)

**applied in:** [Learned build assist for cities](../opportunity/learned-build-assist.md), [Quality-diversity scenario libraries](../opportunity/qd-scenario-libraries.md)

## Claims

- PCGRL (2020) framed level design as a Markov decision process with three editing representations tested on three games, giving a fast generator that needs few or no example levels. *(confidence: high)* [[181](../source/src-khalifa-2020-pcgrl.md)]
- MarioGPT (2023) fine-tuned a 96M-parameter DistilGPT2 model on 37 Super Mario Bros levels; 88.4% of 250 generated levels were completed by an A* agent versus about 31% for an LSTM baseline, and output followed text prompts. *(confidence: high)* [[182](../source/src-sudhakaran-2023-mariogpt.md)]
- LLM Sokoban level generation improved sharply with training-set size, and scarce level data was the main obstacle (FDG 2023). *(confidence: high)* [[183](../source/src-todd-2023-llm-level-generation.md)]
- Word2World (2024) used off-the-shelf LLMs without fine-tuning to write a story and place tiles into a coherent, playable 2D world. *(confidence: medium)* [[184](../source/src-nasir-2024-word2world.md)]
- EA SEED's difficulty-conditioned match-3 generator produced 51.39% valid levels versus 46.15% in its training data, but matched the requested difficulty only 33.33% of the time (mean gap 10.19 moves). *(confidence: high)* [[185](../source/src-villanueva-2024-match3-conditional-generation.md)]
- ARLPCG trained a generator adversarially against a solver agent in a 3D platformer and a racing game, producing new environments shown to be solvable. *(confidence: medium)* [[186](../source/src-gisslen-2021-arlpcg.md)]

## Sources

- [PCGRL: Procedural Content Generation via Reinforcement Learning](../source/src-khalifa-2020-pcgrl.md)
- [MarioGPT: Open-Ended Text2Level Generation through Large Language Models](../source/src-sudhakaran-2023-mariogpt.md)
- [Level Generation Through Large Language Models](../source/src-todd-2023-llm-level-generation.md)
- [Word2World: Generating Stories and Worlds through Large Language Models](../source/src-nasir-2024-word2world.md)
- [Improving Conditional Level Generation using Automated Validation in Match-3 Games](../source/src-villanueva-2024-match3-conditional-generation.md)
- [Adversarial Reinforcement Learning for Procedural Content Generation](../source/src-gisslen-2021-arlpcg.md)

---
Provenance: created in run `2026-10-24-techniques-rl-design`.
