Machine Learning and Procedural Level Generation: Infinite Worlds by Design

Photo: AXP Photography / Pexels
No two dungeons the same. No two levels alike. No two playthroughs identical. Procedural generation has promised infinite replayability since Rogue first generated randomized dungeons in 1980, but for most of gaming's history "procedural" was a polite synonym for "random." Rooms connected at arbitrary angles, enemies placed without regard for pacing, terrain that sprawled without purpose. A newer field called procedural content generation via machine learning, or PCGML, is changing the premise entirely: instead of randomness dressed up as variety, researchers are training models on real human-designed levels so the output reflects design sense rather than noise.
Key takeaways
- Traditional procedural generation relies on hand-coded rules and randomness; PCGML trains models on existing human-designed levels and learns the patterns behind them
- Generative adversarial networks (GANs) proved in 2018 that a neural network could learn to generate playable Super Mario Bros. levels from a small corpus of real ones
- Transformers, the architecture behind large language models, treat a level as a sequence of tiles to predict, the same way a language model predicts the next word
- NYU's Game Innovation Lab and researchers at Georgia Tech have spent over a decade building the academic foundation this field now stands on
- Playability verification (making sure a generated level can actually be finished) is one of the hardest unsolved problems in the field
Why Random Generation Alone Falls Short
Spend five minutes with a purely random dungeon generator and the problem becomes obvious. Inaccessible rooms. Dead ends that lead nowhere. Difficulty spikes with no relation to player progression. A random number generator has no concept of pacing, no memory of what came before, and no goal beyond filling a grid according to a rule set. It can produce structure, but it cannot produce intention.
Human level designers know things that are difficult to encode in explicit if-then rules. A tight corridor feels tense. An open arena after a gauntlet feels like relief. A secret passage should reward curiosity without being obvious. A boss fight needs breathing room before and after it. These are aesthetic and psychological intuitions built from years of playing and building games, and no simple algorithm captures them directly.
This is the gap that machine learning approaches, particularly the subfield researchers call PCGML, are designed to close. Instead of trying to write rules that reproduce a designer's instincts, PCGML shows a model thousands, or sometimes just a few hundred, examples of levels that already work and lets the model infer the statistical patterns that make them work. The foundational framing of this idea came from Adam Summerville and colleagues in their 2018 IEEE Transactions on Games paper "Procedural Content Generation via Machine Learning (PCGML)," which surveyed the methods, including neural networks, Markov models, and matrix factorization, that researchers had applied to the problem up to that point.
How GANs Learned to Design Levels
Two neural network architectures have dominated PCGML research over the last decade: generative adversarial networks (GANs) and, more recently, transformers.
A GAN is built from two competing networks. A generator produces candidate levels, and a discriminator tries to tell those candidates apart from real, human-designed levels drawn from a training set. The generator's only job is to fool the discriminator; the discriminator's only job is to catch fakes. Trained together over thousands of rounds, the generator gets progressively better at producing output that is structurally, spatially, and stylistically close to what a human designer would make.
The paper that put this approach on the map for game levels was "Evolving Mario Levels in the Latent Space of a Deep Convolutional Generative Adversarial Network," published by Vanessa Volz, Jacob Schrum, Jialin Liu, Simon Lucas, Adam Smith, and Sebastian Risi at the 2018 Genetic and Evolutionary Computation Conference (GECCO). The team trained their GAN on the Video Game Level Corpus's Super Mario Bros. levels, then rather than sampling the generator directly, they used a covariance matrix adaptation evolution strategy to search the model's latent space, the compressed internal representation the GAN learns, for level segments that scored well on playability and interest metrics. The result was new Mario levels with the original game's spatial logic and pacing rhythms, without being reproductions of any single level in the training set.
Independently and in the same year, Edoardo Giacomello, Pier Luca Lanzi, and Daniele Loiacono published parallel work applying GANs to Doom level generation, part of a broader wave of 2018 research demonstrating that adversarial training could produce playable game geometry in an unsupervised way, without a human ever hand-labeling what makes a room "good." Follow-up research pushed the idea into other genres. A 2019 paper, "Bootstrapping Conditional GANs for Video Game Level Generation," extended the approach so a designer could condition the output on specific constraints, such as requiring a certain enemy density or a target difficulty. A 2021 study, "Ensemble Learning for Mega Man Level Generation," combined multiple trained generators to produce Mega Man stages, arguing that an ensemble smooths out the weaknesses any single GAN tends to have, like repetitive local patterns or occasional structurally broken segments.
How is a level like a sentence to a transformer?
Transformers, the architecture behind large language models, treat level generation as sequence prediction: the same way a model predicts the next word in a sentence, it predicts the next tile in a layout. This captures long-range dependencies well. If a key sprite appears early, the model has learned from training data that a locked door with matching color-coding is statistically likely to appear later, and it generates accordingly. For a deeper look at how the attention mechanism inside a transformer decides which earlier tokens matter most, see how transformers pay attention to words.
The Academic Engine Behind the Field
No single lab has shaped PCGML more than New York University's Game Innovation Lab, directed by Julian Togelius, an associate professor in NYU Tandon's Department of Computer Science and Engineering and co-founder of the game-AI company modl.ai. Togelius researches game AI, player modeling, procedural content generation, and automatic game design, and the lab's output over more than a decade includes the Procedural Content Generation in Games textbook (Springer, 2016) that helped formalize the field's vocabulary for an entire generation of researchers.
A parallel research thread has come out of Georgia Tech's School of Interactive Computing, where Mark Riedl studies AI approaches to story generation, interactive narrative, and player modeling. Riedl's group has published on combining PCGML with player modeling, including work on temporal, data-driven player models for dynamic difficulty adjustment and on generating levels conditioned on latent player characteristics learned from Super Mario Bros. playthrough data. The throughline across this research is a shift from "generate one level well" to "generate the level this specific player needs right now," a distinction that matters more as the field matures.
No Man's Sky and the Scale Problem
No commercial studio has wrestled more publicly with procedural generation at scale than Hello Games with No Man's Sky. The game's universe contains an estimated 18 quintillion (1.8 × 10¹⁹) planets, each generated from mathematical functions seeded by its own galactic coordinates rather than hand-placed by an artist. It remains, by that figure, the largest procedurally generated space in a commercial video game, built by a team that numbered only a handful of artists at launch in 2016.
The 18-quintillion number made headlines, but the early criticism of the game was exactly the randomness problem described above: planets felt statistically similar despite the astronomical count, because the underlying variation was noise-based rather than design-based. Terrain, flora, and fauna were assembled from procedural building blocks and artist-created components recombined algorithmically, which produced enormous surface variety without necessarily producing memorable variety. Hello Games has continued to expand and rework the generation systems in post-launch updates, and the broader lesson the game offers the field is a cautionary one: raw combinatorial scale is not the same thing as perceived diversity, and no amount of exponent-stacking substitutes for a model that has actually learned what makes one planet feel different from another to a human being standing on it.
This is where the industry's more recent, quieter shift toward hybrid pipelines has emerged. Rather than shipping whatever a procedural algorithm outputs, some teams generate a large batch of candidates algorithmically, then run each candidate through a trained classifier that scores it for playability, pacing, or visual coherence, keeping only the top slice. This approach borrows the raw output volume of classic procedural generation while adding a machine-learned quality filter that approximates a human curator's judgment. Ubisoft's La Forge research division, an open R&D initiative that pairs academic researchers with Ubisoft studios, has published work in this space, and its procedural terrain toolset for Far Cry 5, presented at GDC, generated biomes, freshwater networks, and cliff formations algorithmically while giving designers control levers rather than a fully hands-off black box.
Playability Verification: The Problem Nobody Gets to Skip
One of the hardest practical problems in procedural generation, ML-assisted or not, is guaranteeing that a generated level is actually completable. A dungeon with the exit locked behind a door whose key sits on the far side of a one-way passage is unfinishable, and when a system can generate millions of layout permutations, checking each one by hand is not an option.
Two ML-adjacent strategies address this. The first is automated agent-based playtesting: a trained agent, often a reinforcement-learning agent, attempts to solve a freshly generated level, and if it cannot finish the level within a set number of attempts, the level is discarded before a human ever sees it. This is essentially simulated playtesting running continuously in a build pipeline. The second strategy pushes the constraint earlier, into the generator itself. If a model is trained on examples where a key sprite always spatially precedes its matching locked door, a well-trained generator tends to reproduce that ordering naturally, because it has learned the statistical regularity rather than memorizing a rule about it. Neither approach is foolproof; both reduce, rather than eliminate, the chance of shipping a broken level, which is why most production pipelines still keep a human review step in the loop for anything player-facing.
Personalization: Levels Built Around One Player
The most active near-term direction in PCGML research is personalization. Classic procedural systems, seed-based or otherwise, treat every player identically: the same statistical distributions generate content regardless of who is playing. A model trained on player behavior data can do something categorically different, generating content shaped by an individual player's skill, preferences, and play style.
A player who explores every corner of a level might get layouts with more hidden rooms. A player who rushes toward objectives might get a shorter critical path with more dramatic set pieces along it. A player who consistently struggles with a particular platforming pattern might get a version of that pattern with slightly more forgiving timing windows. Riedl's Georgia Tech group and collaborators have published prototypes along these lines, using player telemetry to condition generation, and the broader research community, including work presented at IEEE's Conference on Games, has explored experience-driven PCG as a formal subfield: content generation explicitly optimized against a model of the player's in-the-moment experience rather than a fixed design template.
Does personalized generation replace difficulty settings?
Not exactly. A difficulty slider changes global parameters like enemy health or damage output uniformly. Personalized PCGML instead reshapes the level's structure itself, adjusting layout, pacing, and encounter placement to an individual player's demonstrated skill, which can make a game more accessible without ever presenting the player with an explicit "easy mode" choice.
Where Pathfinding and Generation Intersect
Generated levels don't exist in isolation from the AI systems that populate them. A level generator can produce a beautifully paced dungeon, but if the enemies inside it can't navigate the space competently, the design intent falls apart at the moment of play. This is why level generation research increasingly has to account for downstream systems like NPC navigation. For a detailed look at how those movement systems work once a level exists, see how pathfinding AI moves NPCs. It's worth noting that PCGML addresses a different problem from terrain-noise systems like the ones covered in how Minecraft builds infinite worlds: noise functions like Perlin noise are excellent at generating natural-looking landscapes from a seed, but they carry no learned sense of what makes a specific arrangement of rooms, enemies, or rewards feel designed. The two approaches are complementary rather than competing, and several hybrid systems described above use noise-based terrain as scaffolding with an ML layer added on top for structure and pacing.
What People Get Wrong About AI-Generated Levels
The most common misconception is that PCGML means a game ships with a runtime generator quietly conjuring brand-new levels for every player, every session, the way a language model generates a fresh reply to every prompt. In practice, most current implementations are development-time tools. A designer trains or fine-tunes a generator on a game's existing level corpus, uses it to rapidly produce dozens or hundreds of draft layouts, and then hand-selects and edits the promising ones. The model accelerates the front end of level design; it rarely replaces the human decision about what ships.
A second misconception treats "generated" and "random" as synonyms, which is precisely the assumption this field exists to overturn. A GAN trained on Mario levels is not sampling noise; it is sampling from a learned distribution shaped by every level in its training corpus, which is why its output tends to preserve genre conventions, like coin placement patterns or pipe spacing, that a purely random generator has no way of knowing about.
A third misconception is that bigger training data always means better output. Because level layouts are lower-entropy than natural language or photographs (a Mario level is, structurally, a fairly constrained grid of a few dozen tile types), several of the papers cited above achieved usable results from corpora of only a few hundred levels, sometimes drawn from a single game. Data quality and representativeness matter more than raw volume in this particular corner of machine learning.
Frequently Asked Questions
Q: What is the difference between procedural generation and PCGML? A: Traditional procedural generation uses hand-coded rules and random number generators to place content, the same way Minecraft's terrain uses layered noise functions. PCGML (procedural content generation via machine learning) instead trains a model on examples of existing, usually human-designed, content and uses the learned patterns to generate new content, which tends to preserve structural and stylistic conventions that pure randomness cannot.
Q: Does PCGML require a huge dataset of existing levels? A: Not necessarily. Several published studies, including the 2018 GECCO Mario-GAN paper, trained useful generators on level corpora numbering in the hundreds rather than the millions, because level layouts carry far less statistical complexity than natural images or text.
Q: Can ML-generated levels match the quality of hand-designed levels? A: In the research literature, GAN- and transformer-based generators trained on tile-based platformers like Mario and Mega Man have produced levels that preserve genre-appropriate pacing and structure well enough to pass as plausible entries in the training distribution. For narrative-heavy or hand-scripted games, human designers remain essential; PCGML is mostly deployed for structural scaffolding rather than full creative authorship.
Q: What games actually use PCGML today? A: Most real-world deployments are internal development tools rather than runtime generators players interact with directly. Ubisoft's La Forge division has published procedural generation research applied to titles including Far Cry 5. Hello Games' No Man's Sky uses procedural (largely non-ML) generation at massive scale for its 18-quintillion-planet universe. Fully ML-driven, player-facing runtime generation remains mostly confined to academic prototypes on games like Mario, Mega Man, Zelda, and Doom.
Q: Who pioneered GAN-based level generation? A: Vanessa Volz, Jacob Schrum, Jialin Liu, Simon Lucas, Adam Smith, and Sebastian Risi published the field-defining 2018 GECCO paper on evolving Mario levels in a GAN's latent space. The same year, Edoardo Giacomello, Pier Luca Lanzi, and Daniele Loiacono independently applied GANs to Doom level generation.
Q: How does a generator avoid producing unsolvable levels? A: Two complementary techniques address this. Automated agents attempt to solve each generated level before it's shown to a player, discarding failures; separately, generators trained on examples where solvability constraints, like a key always preceding its lock, hold true tend to reproduce those constraints statistically, without anyone hand-coding the rule.
Q: Is PCGML the same technology behind large language models? A: It shares an architecture family, not a purpose. The transformer-based approach to level generation borrows the same next-token-prediction mechanism that powers large language models, just applied to sequences of level tiles instead of sequences of words. The training objective and output domain are entirely different.
Q: Will AI-generated levels replace human level designers? A: The research and industry trend points toward a collaborative workflow rather than a replacement: PCGML tools generate large batches of candidate layouts quickly, and human designers curate, edit, and finalize them. Riedl's and Togelius's labs have both published work framing PCGML explicitly as a co-creative tool for designers, not an autonomous substitute for one.
The takeaway
Procedural generation spent four decades proving that algorithms could produce content at a scale no human team could match, and No Man's Sky's 18 quintillion planets are the loudest demonstration of that ceiling. PCGML research, running in parallel since at least the field-defining 2018 GAN papers out of Copenhagen and Politecnico di Milano, is proving something different: that a model trained on real design decisions can inherit some of the judgment behind them, not just the geometry. The technology today lives mostly in development pipelines and academic labs rather than in live, player-facing runtime generators, but the trajectory, from NYU's and Georgia Tech's decade of foundational research toward Ubisoft-scale production tooling, points toward levels that are generated in volume and still feel like someone designed them on purpose.
Read next:
Follow new articles
Add SciHub101 to your feed reader to see new science and technology stories.
About the Author
SciHub101 is an independent science and technology publication founded and edited by Buğra Sözeri, a software engineer and app developer based in Türkiye. AI tools assist with drafting and research. Source documentation in the existing archive is uneven, and articles are being reviewed and corrected. The Editorial Team byline identifies editorial responsibility; it does not certify specialist or independent human review. Where we compare products, anything built by our own team is labelled as such — see the editorial guidelines and About page for how corrections and disclosures work.
Related Articles

Psychology of Gaming: Why Games Are So Addictive
The strongest pull in gaming often isn't the loot or the level-up — it's the guild that's counting on you, the friend list you don't want to disappoint, and the identity you've built inside a community that logs on when you do.

Fortnite: How a Battle Royale Game Became a Cultural Phenomenon
Fortnite popularized battle royale gaming with 100 players fighting for survival. Combined with social features and cosmetics, it became a multi-billion dollar cultural force.

AI-Powered Game Testing: How Machine Learning Is Transforming Quality Assurance
AI testing agents can play through games thousands of times overnight, finding bugs and balance issues that human QA testers would take months to discover.

Procedural Narrative Generation: Can AI Write Stories Worth Playing?
AI-powered narrative generation is enabling games to tell unique stories for every player, blending authored depth with procedural variety in ways previously impossible.

AI-Generated Game Assets: How Machine Learning Is Transforming Game Art Production
AI art generation tools are reshaping game development pipelines, enabling smaller teams to produce AAA-quality assets faster than ever before.

How Neural Networks Are Making NPCs Smarter Than Ever
Neural networks are transforming game NPCs from predictable scripted bots into adaptive, lifelike characters that learn and surprise players.