This is when a VideoGame generates a map, dungeon or level in a random (or, at the very least, unpredictable) fashion. Rather than seeing the same level designs over and over, the player gets a slightly different experience every time he plays. {{Roguelike}}s and {{Endless Running Game}}s are the main users of this technique. Can lead to bad level design and bad gameplay if the maps generated are frustrating, terrible or likely to lead to other complications.

Usually the computer will impose some restrictions on this randomness, so that, for instance, there is always a path to the end of the level, and the [[DynamicDifficulty harder monsters won't appear]] while the player character is at a low [[CharacterLevel level]]. Since the designer's choices in this area often have a bigger impact on the experience than the random elements do, this trope is also called "[[ProceduralGeneration procedurally generated]] levels".

Some games allow to save/load or display/type in the pseudorandom seed to generate a map you wish to replay.

There are also games that use a fixed seed, so the player gets to play the same world every time. This technique is used in games that contain a game world that is much larger than the memory or disk space it is supposed to fit in.

When this happens to items and equipment, see RandomlyGeneratedLoot.
----
!!Examples:

!!VideoGames with changing seeds (The levels are randomly generated each time you play)
* ''Aztec'', for the UsefulNotes/{{Apple II}}e. Each time you would get a random arrangement of preset rooms and a random collection of beasties, tribesmen and chests. Problems with the layout were eased by using dynamite to blow holes in the walls between rooms.
* ''VideoGame/AzureDreams'' for the Playstation randomly generates the floors of the monster tower everytime you go to one.
* ''VideoGame/DarkCloud'' and its sequel, ''Dark Cloud 2'', were quite fond of this. Could be infuriating when it came to speed runs and spheda.
* Chunsoft's ''Mystery Dungeon'' games, including ''Torneko no Daibouken'', ''ShirenTheWanderer'', ''VideoGame/PokemonMysteryDungeon'' and ''Chocobo's Mystery Dungeon''.
* ''VideoGame/{{Minesweeper}}'' randomly generates the board after the first click. This can create situations where [[LuckBasedMission guessing is the only viable move]] because there are no sentient level designers.
* ''VideoGame/{{Diablo}}'' features randomized dungeon layouts which include a handful of required rooms.
** ''Diablo II'' does the same, though single-player maps do not change unless the original is deleted, or if the player plays online. These levels were more random before the first few patch; later on, they changed the random generator to be less annoying.
** ''VideoGame/DiabloIII'''s outdoor areas have a more regular but still randomized layout, with landmarks such as bridges, major dungeons, and paths to the next area always in the same place. Dungeons are totally random but built out of modular rooms instead of a crude assortment of walls like in ''Diablo II'' and ''II''.
* ''VideoGame/NetHack''
* ''VideoGame/SimCity''
* The ''VideoGame/{{Civilization}}'' series has this trope, though you also get the option to play on an Earth-like world. Even in the Earth-like worlds, you can choose to have both the resources and the nation starting positions randomized, leading to some very weird situations, such as being the Aztecs in Spain sailing off to conquer the Spanish in Mexico.
* ''VideoGame/ToejamAndEarl'', when playing on the Random World setting (as opposed to Fixed World, which just uses a fixed seed (see below)).
* The first two ''VideoGame/DragonQuestMonsters'' games. In the sequel, there were predefined "main" worlds and the sub-worlds were randomly generated; in the original, all worlds were randomly generated.
* In ''VideoGame/{{Pikmin}} 2,'' the caves are created this way. The shape of the sublevels remains the same, but where the enemies, walls, treasures and other stuff are placed changes with each sublevel (with a few exceptions).
* ''Infinite Dungeons'' official module for ''VideoGame/NeverwinterNights''.
* ''VideoGame/BattleForWesnoth'' allows for randomly generated maps. Also, two of it's campaigns have randomly generated maps (one in each). Random cave maps, however, tend to favor chaotic units far more than lawful units, as the cave generator doesn't make any lighted spaces yet.
* The ''VideoGame/CommandAndConquer'' series allows for randomly generated multiplayer maps.
* ''VideoGame/{{F-Zero}} X'' has a mode where you play in randomly generated tracks, sometimes with [[http://www.youtube.com/watch?v=Fhv2bHNn4A0 sadistic results]].
* With the exception of your own base, ''VideoGame/{{X-Com}}'''s levels are randomly generated based on pre-existing bulks of tiles (for instance, buildings).
* ''VideoGame/AgeOfEmpires'' took it to the extreme by letting people script the terrain generation.
* ''VideoGame/HellgateLondon'' has this as one of its features - not surprising, since many of the developers came from the team that made ''Diablo''.
* ''VideoGame/{{Spore}}'' - Initially planets are generated and randomly populated with creatures, then an entire galaxy of planets and space civilizations.
* ''VideoGame/DwarfFortress'' randomly generates every starting world. This being ''Dwarf Fortress'', it also generates the history and legends of the land and tends towards realistic landscapes. Nothing like the taste of geology in the morning! It's possible to save and manually set the various random seeds to generate the same world on another computer, but significant changes in world generation prevent the same seed from being usable in different major versions.
* ''VideoGame/LufiaTheLegendReturns'' and ''The Ruins of Lore'' both have all their dungeons randomly generated. ''VideoGame/LufiaIIRiseOfTheSinistrals'' did this before them, but just in the Ancient Cavern, an optional portion of the game.
* ''VideoGame/{{Persona 3}}'' randomly generates most of the non-boss floors of Tartarus, although it follows a few design rules. For instance, floors between a Tartarus Boss and a plot-determined barrier will invariably be smaller than the norm, and the party will usually appear extremely close to the stairs to the next floor (with the small inconvenience that [[TheGrimReaper The Reaper]] will spawn that much faster, too.)
** ''VideoGame/{{Persona 4}}'' does the same thing with its non-boss floors, though there are one or two premade floors without bosses on them in the game.
* ''VideoGame/InvisibleInc'' has a few rooms that are mostly the same in each level, but most of the rooms - and the level layout - are completely random.
* The ''VideoGame/{{Worms}}'' series allows players to battle on randomly generated maps.
* The {{Bonus Dungeon}}s in ''VideoGame /NipponIchi'' games are like this.
** "The Dark World" (''{{Hell}}'') in ''VideoGame/LaPucelle''.
** Item World in the ''Franchise/{{Disgaea}}'' series. (and Class World in ''VideoGame/Disgaea3AbsenceOfJustice'').
** Dungeonman Dungeons in ''VideoGame/PhantomBrave''.
** Some regular stages in ''VideoGame/MakaiKingdom'' have randomly generated portions. Dungeons created through the Sacred Tome are always randomized.
** ''[[ZettaiHeroKaizouKeikaku Z.H.P. Undying Ranger vs Darkdeath Evilman]]'' is NipponIchi's attempt at a {{Roguelike}} and thus completely based on the trope.
* In ''SWAT 4'', the layout is always the same while the people in the buildings are placed differently every time.
* ''VideoGame/{{Spelunky}}'' is a rare PlatformGame example.
* ''COMPUTE!'s Third Book of Creator/{{Atari}}'' includes the Atari BASIC source code of a game called ''Castle Quest'', in which each room has random placement of walls and enemies.
* ''VideoGame/RiseOfTheTriad'' bundles a program with the registered version called RANDROTT for generating random levels. Pick different parameters and a different seed value for a different set of levels. Quite a few user-made levels available online are actually modified RANDROTT levels.
* Every level and world of ''[[http://www.mojang.com/notch/mario/ Infinite Mario Bros.]]'' is randomly generated.
* In ''VideoGame/{{Minecraft}}'', by the same developer as ''Infinite Mario Bros.'', this trope is taken to ridiculous levels: The random level generator is used to produce levels larger than the ''entire surface area of Earth''.
* ''VideoGame/WaterWarfare'' randomly generates all its maps, though in each of the four map themes (Playground, Beach, Plaza, and Nature Park), certain features will always be consistent. Certain templates will also show up with reasonable consistency based on map size (small or large), game type (Battle Royale, Deathmatch, Treasure Chest, Checkpoint, Point Rally, Defender), and number of players (two to eight). For example, a 1-on-1 Battle Royale on the Playground will always have two hills and no underground tunnel, but adding just one more player allows a tunnel to appear. But no matter how many players are added to a Treasure Chest battle, if it's on the Playground, there will never be a tunnel. (In Mission Mode, however, the maps are always the same for each mission, and not random at all).
* ''Yoda Stories''.
* The Creator/{{Microprose}} game based off ''TabletopGame/MagicTheGathering'' has a randomly generated map. Enemies are encountered randomly. Dungeons, where you get random cards, are generated randomly and appear in random locations. Enemies attack towns randomly; if you did something for that town to give you an extra hit point, you lose it if you don't stop them; if one wizard (There are five, one for each color of magic.) takes over three towns (four if you have a special item), game over.
* The dungeons in ''VideoGame/RecettearAnItemShopsTale'' are generated this way.
* The original ''VideoGame/CastleWolfenstein'' has pregenerated rooms whose layouts didn't change; however, the order and connection between rooms was randomized at the start of each game.
* ''VideoGame/{{Runescape}}'' has the dungeoneering skill, which is firmly based on this trope.
* The ''VideoGame/InazumaEleven'' series has training centers. The course consists of a rectangular grid of rooms with doors between them. You start at a random room in the bottom row, one (possibly more, but you're locked in as soon as you find one) random top-row room is designated as the goal and is larger than usual, and the two are always connected by a path through a series of unlockable doors. Aside from the goal room, each room also contains either a free item or a battle at the center, and picking up the item or winning the battle opens all unlockable doors in the room (from the side you're on only; doors can be unlocked twice, once from each side). Losing a battle kicks you out, while reaching the goal room pits you in a full-fledged soccer match which gives everyone on your team a permanent stat boost if you win. Each time you play, the set of unlockable doors and each room's contents are randomized. As you progress in the main story, the grid gets bigger, the battles get harder, the item drops get better, and the stat boosts for clearing the whole course are also increased. Additionally, the layout tends to vary based on the course you pick (which determines which stat(s) get boosted if you win); the Stamina Course in particular tends to have the path snake around and go through nearly every room in the grid, with branches leading to dead ends being few and short, while some others tend to have maze-like layouts.
* ''VideoGame/TalesOfSymphonia'' has Niflheim, while [[VideoGame/TalesOfSymphoniaDawnOfTheNewWorld its sequel]] has Gladsheim. Both consist of nodes on a rectangular grid with connections between them. Niflheim is a timed 15-level dungeon with [[CheckPointStarvation no save points]], and each level requires you to either defeat all enemies on it or find the exit. Gladsheim is an untimed 10-level dungeon with a save point on the third and sixth levels next to the entrance, and the 10th level has a boss fight and nothing else. Apart from the 10th level, each level is an 8-by-8 grid; you start on a random non-edge square and have to go to all 4 corners and defeat the enemy at each corner.
* ''VideoGame/{{Terraria}}'' can randomly generate maps several times larger than the application itself.
* ''VideoGame/GetMedieval'' had a game mode that would randomly generate dungeons.
* ''VideoGame/{{Canabalt}}''
* ''SugarWiki/RobotUnicornAttack''
* ''VideoGame/TempleRun''
* ''VideoGame/{{Oasis}}'' has randomly generated levels based on the difficulty, campaign and level.
* In ''VideoGame/SpacePanic'', the ladders connecting the platforms were randomly placed.
* ''VideoGame/TenMinuteSpaceStrategy'' generates a new map for each campaign, with size and planet density decided by the player.
* This was a selling-point feature of ''Slayer'' on the UsefulNotes/ThreeDOInteractiveMultiplayer, as the box proudly touts the ability of the game to create over 4 billion different dungeons.
* ''BurningRangers'' has only four levels, so SEGA used this trope as a way of boosting replay value. And how, because there are '''tons''' of variations. You can even unlock codes for each specific version of the levels that let you play that version as much as your heart desires when you use the codes.
* ''VideoGame/AquaRhapsody''
* ''VideoGame/SuperHexagon''
* ''VideoGame/IndianaJonesAndHisDesktopAdventures'' and ''VideoGame/YodaStories'' are unusual AdventureGame examples, where not only is the terrain created randomly each time, but the puzzles and items are drawn from a large pool.
* ''VideoGame/{{Torchlight}}'' has a library of human-designed set-piece puzzles and mook gauntlets, which it randomly arranges on each level, and fills in the gaps with procedurally generated corridors and rooms.
* One of the main ideas underpinning ''VideoGame/{{Starbound}}'' is to take this as far as possible - it's set in a universe where all planets are [[ProceduralGeneration procedurally generated]] and totally unique, from obvious things like the size, climate, biome, and number of moons, to even things like the day/night cycle and gravity level. And not only are the planets procedurally generated but the plants and animals as well. So much is generated that the possibility of any two players getting anything even close to the same planet is statistically impossible.
** Notes from the developer have suggested that between random starting locations and each player having their stars spawn randomly across the map, everyone's experience will be unique. However, the star's precise coordinates form its seed, so players can share their finds by giving each other these (long) numbers.
* ''VideoGame/{{Rogue}}'', [[TropeCreator the very first]] roguelike and the inspiration for all subsequent roguelikes, including ''VideoGame/{{Diablo}}''.
* ''Dungeon Hack'', an unusually forgiving roguelike with ''VideoGame/EyeOfTheBeholder'' look and feel (and also using [[TabletopGame/DungeonsAndDragons AD&D 2nd edition]] rules and published by SSI). Included an option to display and manually set the random seed.
* ''VideoGame/{{Diggles}}'' is an odd case. The map is generated not at the start of the game, but when you order to explore a part of a dark area. And only for the area you order to explore (or a slightly bigger area if you luck onto a plot-advancing large cave). Thus reverting to an older saved game may result in a radically different map.
* ''Warlords'' turn-based strategies[[note]]predecessors of ''VideoGame/WarlordsBattlecry'', not to be confused with [[VideoGame/{{Warlords}} the 1980 arcade]][[/note]] starting from II have the "Random Map" option.
* In ''[[VideoGame/RagnarokRoguelike Ragnarok]]'', almost all the levels have a random layout, save for a few very specific locations.
* Many games by ABA games utilize these.
** ''VideoGame/{{rRootage}}'' normally has fixed stages, but the R stages have randomized patterns.
* The dungeons in ''VideoGame/{{Arcuz}} II'' are randomly generated each time you load your save.
* The defining feature of ''VideoGame/{{Daylight}}'' compared to other first-person horror exploration games (i.e. ''SlenderTheArrival'', ''AmnesiaTheDarkDescent'', ''VideoGame/{{Outlast}}'') is that the maze-like levels are randomly generated each playthrough, adding replay value.
* The castle in ''NosferatuTheWrathOfMalachi'' is semi-randomly generated each new game. The basic layout of the castle remains the same, but the interior rooms and the placement of enemies and [=NPC=]s differs each time.
* ''VideoGame/SCPContainmentBreach'' features three zones, all of which have random layouts, most of which are filled with monsters that will [[TheManyDeathsOfYou kill you in a variety of ways.]]

!!VideoGames with fixed seeds (The developers randomly generate a level, and put that level on all copies of the game)
* ''{{Elite}}'' has eight galaxies with 256 procedurally generated planets each (2,048 in total). The seed for generating a galaxy is 48-bit, and the game was initially going to include a galaxy for every possible seed value (282 trillion galaxies with 72058 trillion planets in total), but they thought that would be overkill.
** Mind you they had problems with the mere 2000 they chose. First they had to rewrite the seed several times when it generated planets with obscene names and second there are a few systems that, if you arrive at (Via the hugely expensive, one use, intergalactic hyperdrive), you can never leave because they are too far from other systems.
* ''Elite 2: Frontier'' fits a galaxy of 100 billion star systems on a 3.5" DD floppy. All of this is procedurally generated apart from a small scripted islet which contains the planetary systems of Sol and many other familiar stars.
* ''InfinityTheQuestForEarth'' was set to use procedural generation to create billions (literally) of different star systems (including stars, planets, moons, and so on). Since this seed was going to be always identical, however, every player would see the same universe.
* ''[[VideoGame/TheElderScrollsIIDaggerfall Daggerfall]]'' has, with a few hand-crafted exceptions, over 15,000 procedurally generated towns, cities, villages and dungeons. In this case they were generated on the developer's computers, then placed on the disk.
** Its predecessor ''[[VideoGame/TheElderScrollsArena Arena]]'' uses mostly procedural generation on-the-fly.
** ''[[VideoGame/TheElderScrollsIVOblivion Oblivion]]'' also did this with parts of the field outside dungeons and towns.
** The static dungeon maps in ''[[VideoGame/TheElderScrollsIIIMorrowind Morrowind]]'' and ''Oblivion'' still look like they started with the same random generator, and have the same architectural (or subterranean) plausibility.
* ''VideoGame/{{Starflight}}'' may have a scripted overworld (although the star systems feel quite random-generated), but at least the planetary maps are generated.
* ''The Sentinel'' has 10,000 unique levels (or "landscapes") and still fits in the 48K RAM of ZX Spectrum.
** It may be even better than that: The original version of The Sentinel was written for ''[[http://en.wikipedia.org/wiki/BBC_Micro BBC Micro]]''. Depending on the model the amount of RAM could be 16, 32, 64 or 128 kilobytes. So, if the BBC version ran also on Model B (which had 32 kilobytes), it could mean that the versions for C64 (done by the creator of the original BBC version himself) and ZX Spectrum (done by [[http://www.worldofspectrum.org/zxspecticle/interviews3.htm Mike Follin]]) don't even come that close to using the entire RAM of their respective platforms.
* ''The Explorer'', an obscure 8-bit computer game, is the extreme example in the 8-bit world with its 4 billion unique locations.
* ''{{Noctis}}'' is a space-simulation game which generates a galaxy with a radius of 90 thousand light-years. The entire purpose of the game is explore it and upload findings into an online guide so that others might find them.
* ''VideoGame/SonicTheHedgehog3'' and ''VideoGame/Sonic3AndKnuckles'' have bonus levels that have you running around touching all the blue spheres (which then turn red) and avoiding red ones. Lock-on ''Sonic & Knuckles'' with ''any'' non-main-Sonic game made before it, and you'll get a ''Sonic 3'' style bonus level unique to that game, and other copies of the same game will play the same stage. The idea is that gamers will want to check out their whole library of games for bonus stages, but this was an unadvertised feature, possibly because it didn't work with games made after ''Sonic & Knuckles''. There are a lot of different bonus levels to find, but there's even more if you connect ''S & K'' to the original ''Sonic The Hedgehog'', which has more than 134 million levels (don't get too excited though, repeat levels start appearing after a mere [[http://info.sonicretro.org/Blue_Sphere 120 million]]), and lets you revisit ones you've already played through passwords.
* The ''Franchise/DotHack'' games have dungeons created by selecting a group of keywords, which are generated from those keywords, except for a few plot-critical dungeons.
* The grottoes in ''VideoGame/DragonQuestIX''
* ''SoldierOfFortune II'''s Random Mission Generator generates maps from pseudo-random fixed seeds that can be chosen by the player.
* Several games by Creator/{{cactus}}' feature levels (or rather {{boss|Game}}es) generated with a fixed seed. These include ''Protoganda'', its sequel and ''BurnTheTrash''.
* Several games created by [[Creator/LucasArts Lucasfilm]] in the early 1980s used fractal technology to generate maps of then-unprecedented complexity:
** ''Behind Jaggi Lines!'' was a beta version of air combat simulator[[note]]search and rescue missions under enemy fire, if you want the details[[/note]] over ragged mountains.
** ''[[VideoGame/RescueOnFractalus Rescue on Fractalus!]]'' was a polished version of the former.
** ''The Eidolon'' simply turned the mountains upside down making them the insides of a cave.
** ''Koronis Rift'' was about piloting a surface rover over a jagged terrain. It had somewhat better graphics.

----
!!Non-Video Game examples

[[foldercontrol]]

[[folder: Pinball ]]

* Each case in ''[[Pinball/WHODunnit WHO dunnit]]'' has a killer randomly selected from a pool of five suspects.

[[/folder]]

[[folder: Webcomics ]]

* In ''AModestDestiny'', Fluffy built [[http://www.squidi.net/comic/amd/view.php?series=amd&ep=2&id=12 such a dungeon]].
** [[spoiler:Subverted. It just crushes whoever goes inside.]]
* ''SpeakWithMonsters'' illustrates a potential problem with this, as applied to [[TabletopRPG Tabletop RPGs]], [[http://speakwithmonsters.badgods.com/comics/flightless-bird here]].

[[/folder]]

[[folder: Tabletop Games ]]

* Many tabletop [=RPGs=] include systems of randomly generating dungeons. Likewise, there are many third-party programs designed to generate random dungeons for tabletops. (One for D&D 3.5, for example: http://donjon.bin.sh/d20/dungeon/ )
* One of the two realities in the game ''TabletopGame/TheSplinter'' is an infinite, randomly generated fantasy dungeon. The rulebook contains plenty of random dice tables to generate a tiny fraction of this infinite dungeon for the players to explore.
----