Runtime Random Level Generation is the generation of game levels while the game is being played, using PCG techniques. When speaking of Procedural Content Generation, most people envisage this type of PCG. It was originated with Rogue which randomly places rooms and corridors when a player first enters the game level.
Runtime Random Level Generation provides an infinite game space, constrained by the generation rules of the algorithm used. It requires that the game store the entire level, which means there must be well defined boundaries between each level.
Types of Levels Connections
Clearly separated levels are usually connected by a set of stairs or an elevator. Alternately, there can be no explicit connection between levels, and a level can be left from any point, or when a set of 'victory' conditions is completed. In this instance, levels are accessed from a menu or a central game hub.
Alternatively levels can be connected seamlessly to give the impression of a single continuous playing field with no level boundaries apparent to the player. This may require multiple levels to be active at the same time if the game perspective uses scrolling or is set in the first person. Seamlessly connected levels can form building blocks in Dynamic World Generation.
Connectivity Within a Level
All parts of the level must be connected, which increases the complexity of the generation rules. Disconnected parts of the level cannot be visited, unless the game supports removal of existing walls through a grid or voxel based geometry.
Persistent and Non-Persistent Levels
Levels are distinguished by being either persistent or non-persistent. With non-persistent levels, each generated level is discarded once the player leaves it. With persistent levels, a level in the game is always the same every time the player returns to that level. Persistence can be throughout a single play-through of the game, or across multiple plays of the game. In the latter case, the fact that the levels are procedurally generated may not be apparent to the player at all, since they can appear entirely similar to traditional statically created levels. The reasons for using procedural generation at all in those cases may be to be able to store a huge world in a limited amount of storage space, or to save the work of designing many levels manually.
Connectivity Between Levels
Levels can be connected in arbitrary ways. One way to describe this is as a graph where levels are the nodes and the connections between levels are the edges. These are some examples of graphs:
- Sequential: All exits from the current level lead to one of two adjacent levels.
- Tree: Each exit from a level leads to a new level, which results in the game space consisting of a tree of levels branching away from the root which the player first entered where the number of children of the level equals the number of exits from that level, minus the one that the player arrived from.
Spatial Layout of Multiple Levels
Levels may be laid out in a spatial structure, such as a grid, or as multiple floors above and beneath each other. This layout may conform to Euclidean space, where the same space can only be occupied by one level, or the layout may make use of non-Euclidean space and allow multiple levels to be placed in the same space. As an example of non-Euclidian space, after descending some stairs from level A to level B, taking the same stairs up would get you back to level A, but taking another set of stairs up elsewhere, you could arrive on level C, even though level A and level C should logically occupy the same space.
PCG Wiki References
For specific algorithms, see Map Generation