{{Short description|Method in which data is created algorithmically as opposed to manually}} {{redirect|Randomly generated|algorithms that generate random numbers|Random number generation}} {{More footnotes needed|date=May 2022}} [[File:Dragon_trees.jpg|thumb|right|upright=1.3|One example of procedural generation, here using L-systems to generate realistic looking tree models. Different models can be generated by changing both deterministic parameters and a random seed.]] In computing, '''procedural generation''' is a method of creating data algorithmically as opposed to manually, typically through a combination of human-generated content and algorithms coupled with computer-generated randomness and processing power. In computer graphics, it is commonly used to create textures and 3D models. In video games, it is used to automatically create large amounts of content in a game. Depending on the implementation, advantages of procedural generation can include smaller file sizes, larger amounts of content, and randomness for less predictable gameplay.
==Overview== [[File:Terragen.jpg|thumb|A procedural landscape rendered in Terragen]] The term ''procedural'' refers to the process that computes a particular function. Fractals are geometric patterns which can often be generated procedurally. Commonplace procedural content includes textures and meshes. Sound is often also procedurally generated, and has applications in both speech synthesis as well as music. It has been used to create compositions in various genres of electronic music by artists such as Brian Eno who popularized the term "generative music".<ref>{{cite web|url=http://www.inmotionmagazine.com/eno1.html|title=A talk delivered in San Francisco, June 8, 1996|author=Brian Eno|access-date=2008-11-07|date=June 8, 1996|work=inmotion magazine}}</ref>
[[File:Tiling procedural textures.jpg|thumb|Procedurally generated textures]] Procedural generation was originally created as an instrument for video games, aiding in generating levels, textures and complete worlds with little human contribution. Procedurally generated elements have appeared in video games since the 1990s: ''The Elder Scrolls II: Daggerfall'' takes place in a mostly procedurally generated world, giving a world roughly two thirds the actual size of the British Isles. ''Soldier of Fortune'' from Raven Software uses simple routines to detail enemy models, while its sequel featured a randomly generated level mode. Avalanche Studios employed procedural generation to create a large and varied group of detailed tropical islands for ''Just Cause''. ''No Man's Sky'', a game developed by games studio Hello Games, is all based upon procedurally generated elements.
The modern demoscene uses procedural generation to package a great deal of audiovisual content into relatively small programs.
New methods and applications are presented annually in conferences such as the IEEE Conference on Computational Intelligence and Games and the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment.<ref>{{cite web | url=http://www.aiide.org/ | title=Artificial Intelligence and Interactive Digital Entertainment | publisher=AIIDE.org | access-date=12 June 2016}}</ref>
Particularly in the application of procedural generation with video games, which are intended to be highly replayable, there are concerns that procedural systems can generate infinite numbers of worlds to explore, but without sufficient human guidance and rules to guide these. The result has been called "procedural oatmeal", a term coined by writer Kate Compton, in that while it is possible to mathematically generate thousands of bowls of oatmeal with procedural generation, they will be perceived to be the same by the user, and lack the notion of perceived uniqueness that a procedural system should aim for.<ref>{{cite web | url = https://www.gamedeveloper.com/design/alien-languages-how-we-talk-about-procedural-generation | title = Alien Languages: How We Talk About Procedural Generation | first = Michael | last = Cook |date = August 10, 2016 | access-date = May 9, 2024 | work = Game Developer | archive-url = https://web.archive.org/web/20240509013708/https://www.gamedeveloper.com/design/alien-languages-how-we-talk-about-procedural-generation | archive-date = May 9, 2024 }}</ref>
==In tabletop role-playing games== Using procedural generation in games had origins in tabletop role playing games (RPG).<ref>{{cite conference | book-title = SEDA 2018: Proceedings of 6th International Conference in Software Engineering for Defence Applications | title= Procedural Generation for Tabletop Games: User Driven Approaches with Restrictions on Computational Resources | first1 = Joseph Alexander | last1 = Brown | first2 = Marco | last2 = Scirea | pages = 44–54 | conference = International Conference in Software Engineering for Defence Applications | year = 2018 | location = Rome, Italy }}</ref> The leading tabletop system, ''Advanced Dungeons & Dragons'', provided ways for the "dungeon master" to generate dungeons and terrain using random die rolls, expanded in later editions with complex branching procedural tables. Strategic Simulations under license from TSR released the ''Dungeon Master's Assistant'', a computer program that generated dungeons based on these published tables. ''Tunnels & Trolls'', published by Flying Buffalo,<ref>{{cite web |title="A Chat with Ken St Andre Part 1" | date=17 July 2010 |url=https://www.youtube.com/watch?v=NZExaEP-g_A |publisher=YouTube.com |access-date=6 November 2021}}</ref> was designed primarily around solitary play and used similar procedural generation for its dungeons. Other tabletop RPGs borrowed similar concepts in procedural generation for various world elements.<ref>{{cite conference | conference = Foundations of Digital Games 2015 | location = Pacific Grove, California | year = 2015 | first = Gillian | last= Smith | title = An Analog History of Procedural Content Generation | url = http://www.fdg2015.org/papers/fdg2015_paper_19.pdf | access-date = October 7, 2019 }}</ref>
Many online tools for Dungeon Masters now use procedural generation to varying degrees.{{citation needed|date=April 2021}}
==In video games== ===Early history=== [[File:Nethackscreen.gif|thumb|A procedurally generated dungeon map in the video game ''NetHack'']] Prior to graphically oriented video games, roguelike games, a genre directly inspired by ''Dungeons & Dragons'' adopted for solitary play, heavily utilized procedural generation to randomly produce dungeons, in the same manner that tabletop systems had done. Such early games include ''Beneath Apple Manor'' (1978) and the genre's namesake, ''Rogue'' (1980). The procedural generation system in roguelikes would create dungeons in ASCII- or regular tile-based systems and define rooms, hallways, monsters, and treasure to challenge the player. Roguelikes, and games based on the roguelike concepts, allow the development of complex gameplay without having to spend excessive time in creating a game's world.<ref name="gamespy roguelikes">{{cite web | url = http://pc.gamespy.com/pc/ftl-faster-than-light/1227287p1.html | title = Rise Of The Roguelikes: A Genre Evolves | first = Tom | last = Hatfield | date = 2013-01-29 | access-date = 2013-04-24 | publisher = GameSpy }}</ref>
1978's ''Maze Craze'' for the Atari VCS used an algorithm to generate a random, top-down maze for each game.<ref>{{cite web |title=Maze Craze |url=http://www.atarimania.com/game-atari-2600-vcs-maze-craze-a-game-of-cops--n-robbers_18243.html |website=Atari Mania}}</ref>
Some games used pseudorandom number generators. These PRNGs were often used with predefined seed values in order to generate very large game worlds that appeared to be premade. ''The Sentinel'' supposedly had 10,000 different levels stored in only 48 and 64 kilobytes. An extreme case was ''Elite'', which was originally planned to contain a total of 2<sup>48</sup> (approximately 282 trillion) galaxies with 256 solar systems each. However, the publisher was afraid that such a gigantic universe would cause disbelief in players, and eight of these galaxies were chosen for the final version.<ref name="masters">{{cite news | url=https://www.theguardian.com/weekend/story/0,3605,1064107,00.html | title=Masters of their universe | publisher=Guardian | author=Francis Spufford | author-link=Francis Spufford | date=October 18, 2003}}</ref> Other notable early examples include the 1985 game ''Rescue on Fractalus'' (that used fractals to procedurally create, in real time, the craggy mountains of an alien planet) and ''River Raid'' (the 1982 Activision game that used a pseudorandom number sequence generated by a linear feedback shift register in order to generate a scrolling maze of obstacles).
===Modern use=== [[File:Blender3D_VoronoiCrackle.jpg|thumb|Procedural texture using Voronoi tessellation]] <!--Wouldn't it make much more sense to explain why modern games still make use of procedural generation, rather than throw examples? It seems to me that scope (Spore is a huge game, for instance) and replayability (You can play The Binding of Isaac and other roguelikes for hours because it keeps "mixing it up") are the main reasons, but we'd need some references. --> Though modern computer games do not have the same memory and hardware restrictions that earlier games had, the use of procedural generation is frequently employed to create randomized games, maps, levels, characters, or other facets that are unique on each playthrough.<ref>{{cite web | url = https://www.gamedeveloper.com/design/7-uses-of-procedural-generation-that-all-developers-should-study | title = 7 uses of procedural generation that all developers should study | first = Richard | last = Moss | date = January 1, 2016 | access-date = January 1, 2016 | work = Game Developer | archive-url = https://web.archive.org/web/20240509014556/https://www.gamedeveloper.com/design/7-uses-of-procedural-generation-that-all-developers-should-study | archive-date = May 9, 2024 }}</ref><ref>{{Cite magazine | url = https://www.rollingstone.com/culture/news/no-mans-sky-how-games-are-building-themselves-w433492| title = 'No Man's Sky': How Games Are Building Themselves | first = Chris | last = Baker | date = 9 August 2016 | access-date = 9 August 2016 | magazine = Rolling Stone }}</ref>
Many modern roguelike games (sometimes referred to as "roguelites") have shifted away from the turn-based early roguelikes to incorporate gameplay of other video game genres, such as platformers or shoot 'em ups, though still retain elements of procedural generation in how gameplay maps and levels are generated to assure that the player has a means to complete each level along with permadeath. This also extends to power-ups and other items that populate the game's map, selected by the game through procedural generational rules to assure the game feels fair to the player so they feel they have the agency to win the game.<ref>{{cite web | url = https://www.polygon.com/best-roguelikes-play-fair-enter-gungeon-dead-cells/ | title = The best roguelikes always play fair | first = Jazz | last = Stewart | date = August 23, 2025 | accessdate = August 23, 2025 | work = Polygon }}</ref> [[File:Minetest screenshot 2.png|thumb|Procedurally generated voxel-based terrain in Luanti]] Procedural generation is often used in loot systems of quest-driven games, such as action role-playing games and massive multiplayer online role playing games. Though quests may feature fixed rewards, other loot, such as weapons and armor, may be generated for the player based on the player-character's level, the quest's level, their performance in the quest, and other random factors. This often leads to loot having a rarity quality applied to reflect when the procedural generation system has produced an item with better-than-average attributes. For example, the ''Borderlands'' series is based on its procedural generation system which can create over a million unique guns and other equipment.<ref>{{cite web | url = https://blogs.wsj.com/speakeasy/2012/04/19/why-borderlands-2-has-the-most-stylish-guns-in-gaming/ | title = Why Borderlands 2 Has the Most Stylish Guns in Gaming | work = Wall Street Journal | date = April 19, 2012 | access-date = April 21, 2016 | first = Ryan | last = Kuo }}</ref> Many open world or survival games procedurally create a game world from a random seed or one provided by the player, so that each playthrough is different. These generation systems create numerous pixel- or voxel-based biomes with distribution of resources, objects, and creatures. The player frequently has the ability to adjust some of the generation parameters, such as specifying the amount of water coverage in a world. Examples of such games include ''Dwarf Fortress'', ''Minecraft, and Vintage Story.''
Procedural generation is also used in space exploration and trading games. ''Elite: Dangerous'', through using the 400 billion known stars of the Milky Way Galaxy as its world basis, uses procedural generation to simulate the planets in these solar systems. Similarly, ''Star Citizen'' uses the technology to create seamlessly loaded planets among its hand-crafted universe. ''Outerra Anteworld'' is a video game in development that uses procedural generation and real world data to create a virtual replica of planet Earth in true scale.
''No Man's Sky'', by using procedural generation, is the largest video game in history, featuring a universe of 18 quintillion planets across entire galaxies, which can be explored in flight or on foot. The planets all have their own uniquely diverse terrain, weather, flora, and fauna, as well as a number of space-faring alien species. The same content exists at the same places for all players (thanks to a single random seed number to their deterministic engine), which enables players to meet and share discoveries.<ref name="new yorker">{{cite magazine |first = Raffi | last = Khatchadourian |date=18 May 2015 |title=World without end : creating a full-scale digital cosmos |department=Annals of Games |magazine=The New Yorker |volume=91 |issue=13 |pages=48–57 |url=http://www.newyorker.com/magazine/2015/05/18/world-without-end-raffi-khatchadourian |access-date= 5 August 2015 }}</ref><ref>{{Cite web | url = https://www.fastcodesign.com/3048667/how-4-designers-built-a-game-with-184-quintillion-unique-planets | title = How 4 Designers Built A Game With 18.4 Quintillion Unique Planets | publisher = Fast Company | last = Wilson | date = 16 July 2015 | access-date = 9 August 2015 }}</ref><ref>{{Cite web |author1=Sam White |date=2016-08-10 |title=No Man's Sky: How the biggest game ever made almost never happened |url=https://www.gamesradar.com/no-mans-sky-how-the-biggest-game-ever-made-almost-never-happened/ |access-date=2022-05-07 |website=gamesradar |language=en}}</ref>
==In other areas== As in video games, procedural generation is often used in film to create visually interesting and accurate spaces rapidly. This comes in a wide variety of applications.
One application is ''imperfect factories'', which are used by artists to rapidly generate many similar objects. This accounts for the fact that, in real life, no two objects are ever exactly alike. For instance, an artist can model a product for a grocery store, and then create an imperfect factory to generate many imperfect copies to populate a whole shelf.
MASSIVE is a high-end computer animation and artificial intelligence software package used for generating crowd-related visual effects for film and television. It was developed to create fighting armies of hundreds of thousands of soldiers for Peter Jackson's ''The Lord of the Rings'' films automatically.<ref>{{cite web | url=http://www.massivesoftware.com/about.html | title=About Massive | publisher=Massive Software | access-date=12 June 2016}}</ref>
Coherent noise can be extremely important to procedural workflow in film. Simplex noise is often faster with fewer artifacts, though an older function called Perlin noise may be used as well. Coherent noise, in this case, refers to a function that generates smooth pseudo-randomness in {{var|n}} dimensions.
Poyck studied how procedurally generated cityscapes can be used to aid social simulations and to train self-driving cars.<ref name=":2">{{Cite journal |last=Poyck |first=Griffin |date=2023-05-01 |title=Procedural City Generation with Combined Architectures for Real-time Visualization |url=https://open.clemson.edu/all_theses/3982/ |journal=All Theses}}</ref>
Procedural generation plays a pivotal part in the progression of digital twins, which are very detailed virtual replicas of real-world objects used for simulation, analysis, and planning.{{citation needed|date=March 2025}}
== Future directions == Neural networks have recently been employed to refine procedurally generated content. Combining classic randomization methods with deep learning provides new ways for generating audio, images, 3D objects, and other content types. This is especially useful in game level development; reinforcement learning allows the development of agents that play generated levels, serving as automatic content evaluators.<ref name=":02">{{cite journal |arxiv=2410.15644 |doi=10.1609/aiide.v20i1.31877 |title=Procedural Content Generation in Games: A Survey with Insights on Emerging LLM Integration |date=2024 |last1=Farrokhi Maleki |first1=Mahdi |last2=Zhao |first2=Richard |journal=Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment |volume=20 |pages=167–178 }}</ref>
Integrating procedural generation with deep learning alters the landscape of digital content creation. Zakaria et al. demonstrated that different deep learning methods for procedurally generating Sokoban levels have different strengths and weaknesses.<ref name=":12" />
Looking ahead, researchers are investigating methods to combine large language models (LLMs) with deep-learning powered procedural generation systems, aiming to enhance their adaptability. Zakaria suggests that "LLMs combined with reinforcement learning can create procedural assets that evolve dynamically based on real-time feedback".<ref name=":12">{{Cite journal |last1=Zakaria |first1=Yahia |last2=Fayek |first2=Magda |last3=Hadhoud |first3=Mayada |date=March 2023 |title=Procedural Level Generation for Sokoban via Deep Learning: An Experimental Study |journal=IEEE Transactions on Games |volume=15 |issue=1 |pages=108–120 |doi=10.1109/TG.2022.3175795 |bibcode=2023ITGam..15..108Z |issn=2475-1510}}</ref> Zakaria investigated the application of advanced deep learning structures such as bootstrapped LSTM (Long short-term memory) generators and GANs (Generative adversarial networks) to upgrade procedural level design. They found that "diversity sampling consistently increases the numbers of generated solutions and signatures", showing that hybrid approaches help overcome problems like repetitive patterns or lack of variation.<ref name=":12" />
==See also==
* Cellular automata * Computational creativity * Fractal landscape * Fractional Brownian motion * Generative art * Generative artificial intelligence * L-systems * Linear congruential generator * List of games using procedural generation * Media synthesis (AI) * Noise, Perlin noise, Simplex noise * Procedural animation * Procedural modeling * Procedural texture * Roguelike * Scenery generator
==References== {{Reflist}}
==Further reading== * {{cite book | title = Texturing and Modeling: A Procedural Approach | first1= David S. | last1=Ebert | first2=F. Kenton | last2=Musgrave | first3=Darwyn | last3=Peachey | first4=Ken | last4=Perlin | first5=Steve | last5=Worley | publisher = Morgan Kaufmann | edition = 3rd | year = 2002 | isbn = 978-1-558-60848-1}} * {{cite book | title = Procedural Content Generation in Games: A Textbook and an Overview of Current Research | first1= Noor | last1=Shaker | first2=Julian | last2=Togelius | first3=Mark J. | last3=Nelson | publisher = Springer | year = 2016 | isbn = 978-3-319-42714-0 | url = http://pcgbook.com/}} * [http://www.gdcvault.com/play/1019981/The-Future-of-Content The Future Of Content] – Will Wright keynote on Spore & procedural generation at the Game Developers Conference 2005
{{Coherent noise}}
Category:Procedural generation Category:Applications of randomness Category:Video game design