Update
This commit is contained in:
parent
695e83f707
commit
28d52eba80
11 changed files with 1874 additions and 1834 deletions
43
procgen.md
43
procgen.md
|
@ -1,12 +1,47 @@
|
|||
# Procedural Generation
|
||||
|
||||
Procedural generation (procgen, also PCG -- *procedural content generation* -- not to be confused with [procedural programming](imperative.md)) refers to creation of data, such as [art](art.md) assets in [games](game.md) or test data for data processing software, by using [algorithms](algorithm.md) and mathematical formulas rather than creating it manually or measuring it in the real world (e.g. by taking photographs). This can be used for example for automatic generation of [textures](texture.md), texts, [music](music.md), game levels or 3D models but also practically anything else, e.g. test [databases](database.md), animations or even computer programs. Such data are also called *synthetic*. Procedural art currently doesn't reach artistic qualities of a skilled human artist, but it can be [good enough](good_enough.md) or even necessary (e.g. for creating extremely large worlds), it may be preferred e.g. for its extreme save of storage memory, it can help add detail to human work, be a good filler, a substitute, an addition to or a basis for manually created art. Procedural generation has many advantages such as saving space (instead of large data we only store small code of the algorithm that generates it), saving artist's time (once we have an algorithm we can generate a lot data extremely quickly), parameterization (we can tweak parameters of the algorithm to control the result or create animation, often in real-time), increasing resolution practically to infinity or extending data to more dimensions (e.g. [3D textures](3d_texture.md)). Procedural generation can also be used as a helper and guidance, e.g. an artist may use a procedurally generated game level as a starting point and fine tune it manually, or vice versa, procedural algorithm may create a level by algorithmically assembling manually created building blocks.
|
||||
Procedural generation (procgen, also PCG -- *procedural content generation* -- not to be confused with [procedural programming](imperative.md), but see also [RNG](rng.md)) refers to creation of [data](data.md) (and in rarer cases maybe even [programs](program.md)), such as [art](art.md) assets in [games](game.md) or test data for data processing software, by using [algorithms](algorithm.md), [mathematical](math.md) formulas and [randomness](randomness.md) rather than creating them manually or measuring them in the [real world](irl.md) (e.g. by taking photographs, 3D scans etc.). This can be used for example for automatic generation of [textures](texture.md), texts, [music](music.md), game levels or 3D models but also practically anything else, e.g. test [databases](database.md), animations or even computer programs. Such data are also called *synthetic*. Procedural art currently doesn't reach artistic qualities of a skilled human artist, but it can be [good enough](good_enough.md) or even necessary (e.g. for creating extremely large worlds), it may be preferred e.g. for its extreme save of storage memory, it can help add detail to human work, be a good filler, a substitute, an addition to or a basis for manually created art. Procedural generation has many advantages such as saving space (instead of large data we only store small code of the algorithm that generates it), saving artist's time (once we have an algorithm we can generate a lot data extremely quickly), parameterization (we can tweak parameters of the algorithm to control the result or create animation, often in real-time), increasing resolution practically to infinity or extending data to more dimensions (e.g. [3D textures](3d_texture.md)). It's also [fun](fun.md) for the programmer. Procedural generation can also be used as a helper and guidance, e.g. an artist may use a procedurally generated game level as a starting point and fine tune it manually, or vice versa, procedural algorithm may create a level by algorithmically assembling manually created building blocks.
|
||||
|
||||
As neural [AI](ai.md) approaches human level of creativity, we may see computers actually replacing many artists in near future, however it is debatable whether AI generated content should be called procedural generation as AI models are quite different from the traditional hand-made algorithms -- AI art is still seen as a separate approach than procedural generation. For this we'll only be considering the traditional approach from now on.
|
||||
Procedural generation basically means randomly generating things with some added cleverness, i.e. some kind of algorithm and parameter tuning. Randomly generating something isn't that hard, provided we have a good (pseudo)random number generator -- for example to generate random loot in an RPG game may be as simple as generating a single random number representing the item ID -- this isn't yet procedural generation. The process becomes procedural generation if we throw in more rules and cleverness: for example once we start randomly generating cities so that their layout makes some sense (i.e. there are no unreachable streets, buildings in middle of the roads etc.). While doing this it's important to retain in mind all the rules of handling randomness with computers, i.e. we don't really want to employ true randomness but rather [deterministic](determinism.md) [pseudorandomness](pseudorandomness.md)! The whole thing, no matter how big, will be generated just from a single seed number. The same seed must always generate the same thing. And so on and so forth.
|
||||
|
||||
[Minecraft](minecraft.md) (or [Minetest](minetest.md)) is a popular example of a game in which the world is generated procedurally, which allows it to have near-infinite worlds -- size of such a world is in practice limited only by ranges of [data types](data_type.md) rather than available memory. [Roguelikes](roguelike.md) also heavily utilize procgen. However this is nothing new, for example the old game called Daggerfall was known for its extremely vast procedurally generated world, and even much older games used this approach. Some amount of procedural generation can be seen probably in most mainstream games, e.g. clouds, vegetation or NPCs are often made procedurally.
|
||||
```
|
||||
xc,.....,:cco,,,';,;o:':l:kkkxoooxkkc:',..'.xocxxx ,,:lccoxxkkkx;',;:;lck ,;;, xcl;::,':xkkkxxoccl;,'
|
||||
kx:,:'.'.'':;'...ooXkxl:xXXxocccccokkxkx;;',l:cXoX :,::lcoxxkkXKKK:'',;lx :,,;.xc;:'',KKKXkkxxocl::,,
|
||||
kcc;:':','.......::XkXckkxkxocccooxkkXkXXxco:clkkX lll:,:lcoxxxkXKXc'',;o :;;; ol,''lXKXkkxxocl:,:lll
|
||||
xx;;:'lo;.........;ckxxXkxxoooccooxkkkkkkoXkoxokxk ccoll:,;loccoxXxoo;.,l,:::;,l:.;ooxXxoccol;,:;locc
|
||||
x:'.:,;xl'.......',;;xXkkxxxxoooooxkkkkkXxXkkxkkkk xxxocll::loooxXxocoo:..,;:,'.,xocoxXxoool::llcoxoo
|
||||
o:,:xXXkk:.........:'Kkxxxkkkkxxxkxkkkkxkokcl',XxX xkXxxxccl;;cxkXxolccoo, ,: ,ooccloxXkxc;;lccxxkXkx
|
||||
:''cokkkX,........','0kxoxkxkkkkkkkxkkkkkXo:..,ll; kkXkxxcoxcl;cxKxo;llccol',loccll;oxKxcllcxocxxkKkk
|
||||
..;'';l,'........lXkXXxxxxkkxxkkkkkkx;;occ,.....'. ,o0XkkoxxxxoccXkx;;;llccooccll;;;xkXccoxxoxokkX0x,
|
||||
..'''.........,',0kxoooxxxoocoxkkkkx:,:',:,....... ':;XKKkkkkkXKXXxloccllccooccllccoloXXKXkkkkkKKK;:.
|
||||
..:c::.....':olc'Kxocooxxxoocoxkkkx;'.'c:;'....... :,'.:kooccllllclkkK;::::;;;:::;KXXccllllccock;'',,
|
||||
kkKXkoc;cXxKKXXxcXkxoxkkkkkkkxokxxk;..;':'.....,lc ;;:,'.loccll;;;kko:xoc..''..cok:okk;;;llccol'',::;
|
||||
xxxxxxxkkkXkkkkkxkxoooxxkkkcl:;xkk;.........';kKkk cccl;:,'loccll;l:;xkKccllllccKXxl:l;lllcoc'':;lccc
|
||||
ooxxxkokkkkkkxxxkxxooxxkc::';:,,cl'','.....c0kkooc ''''.':, 'oocclc;:,:cKWMkxMWMc:'::cllcox,.':,.''''
|
||||
cooooxk;'xkxxkkkxkkxoxoc;kXc'',,,'',,......cXxcccc ::l;;:;:;'.;oocol:.'oX0oK0o0Xx, :locool'';;::;:l::
|
||||
oxkkxk;.'oXkxkkkxkxkkx',;okxccx;';c:.'.....xXxxooo :lc:;;;::''lcoool:.'okKo0Mo0Xx,.:loooo;'';:;;;,ll,
|
||||
;,:,'''.'lkkxxxooxxok''',:oXkxkkkko'...;;,:,cccxcl ''''',:, 'oocclc;:',c0WWxxMW0c:'::cllcoo' ,::'''''
|
||||
..........;;;XkxxXc,;.....oKxoocook,'.:::;'l:,c'.. cccl;:,'loccll;l:;xkKccccccccXXxl,l;llccol'':;lccc
|
||||
.............lxlc:o:'.....'Xkxooookx:,'...::kXo'.. ;;:,'.;occll;;;kxo:koo......coX:oxk;;;llcco;.',:;;
|
||||
............',::;Xkol......cXkoocoxkl,''xx:,kX,... :,'.:kccccllllllXkKl::::;;::::;KkXccllllcccok:.',,
|
||||
..........,cKl,;,xxl.....,,kkkxooxookXXXkkkk;,::.. ',;kKXxkkkkkXXXolocc;lcccoccllccolcXkXkkkkkxXKX;,.
|
||||
'........'kXxkk;,;,,..,'l',cXkxxooxxooxkkkkco,:l,x 'o0XkkoxxxkxocXkk;;;llccooccll;;;xkXooxxxxxokkX0o'
|
||||
,,''''...:xkxkk,;;',':,;c,'ookkkxxxxocooxxxkX:c;:: kkKkxxcooollcxKko;llccoc,'loccll;oxKxcllcxocxxkKkk
|
||||
xkcll,'..'xXxko;',l;:'.cxl,:okkkkkxoooooooooxkoxcl xkXkxxccl;;cxkXxollcoo, ,, ,oocllcxXkxc;;lccxxkXkx
|
||||
oxxl;.'..,cXkkc:'olxc.'l;':ckXkkkkxooooooooxkocccl xxxoccl::lcooxXxocco;..:l;:..,xccoxXxoool::llcoxxo
|
||||
':'',,l;clolxllooxxxX:...',0xxxoooxxkkkkkxxol..... ccoll:,;loccooXxool',;::::;:;,.;ooxXooccol;,:llocc
|
||||
.','''clcl:',;;ccxokkc....oKxoooooxkkkoc:;,....... lll:,:lcoxxxkXKXo,.,;o :;;: o;,''cXKXkxxxocl:,:lll
|
||||
'......',,,:oxxXooo;,'..'lMkokkxxxkx:.,..''llocl:. ;:::;coxxkkXXK0:'',;lx :,,;.xc;,'':0KXXkkxxocl::,:
|
||||
:'......';l;o;'';,:''.'ox:,cxkXkkkkoc,......:lxxx; ',:;lcooxkkkkl',:,;lcx ,l;:.xcl;:::';xkkkxoocl;:,'
|
||||
```
|
||||
|
||||
For its extreme save of space procedural generation is extremely popular in [demoscene](demo.md) where programmers try to create as small programs as possible. German programmers made a full fledged 3D shooter called [.kkrieger](kkrieger.md) that fits into just 96 kB! It was thanks to heavy use of procedural generation for the whole game content. [Bytebeat](bytebeat.md) is a simple method of generating procedural "8bit" music, it is used e.g. in [Anarch](anarch.md). Procedural generation is generally popular in indie game dev thanks to offering a way of generating huge amounts of content quickly and without having to pay artists.
|
||||
*Some procedural textures.*
|
||||
|
||||
As [neural](neural_net.md) [AI](ai.md) approaches human level of creativity, we may see computers actually replacing many artists in near [future](future.md), however it is debatable whether AI generated content should be called procedural generation as AI models are quite different from the traditional hand-made procedural algorithms -- AI art is still seen as a separate approach than traditional procedural generation. For this we'll only be considering the traditional approach from now on.
|
||||
|
||||
[Minecraft](minecraft.md) (or, for the real chads, [Minetest](minetest.md)) is a popular, relatively recent example of a [game](game.md) completely based on procedural generation, in which the world is wholly procedurally generated, which allows it to have near-[infinite](infinity.md) worlds -- size of such a world is in practice limited only by ranges of [data types](data_type.md) rather than available storage memory. [Roguelikes](roguelike.md) also heavily utilize procgen. However this is nothing new, for example the old game called Daggerfall was known for its extremely vast procedurally generated world, and even much older games used this approach (perhaps more so that there was so little storage memory available). Some amount of procedural generation can be seen probably in most mainstream games, e.g. clouds, vegetation or NPCs are often made procedurally.
|
||||
|
||||
For its extreme potential for saving space procedural generation is popular a lot in [demoscene](demo.md) where programmers try to create as small programs as possible. German programmers made a full fledged 3D shooter called [.kkrieger](kkrieger.md) that fits into just 96 kB! It was thanks to heavy use of procedural generation for the whole game content. [Bytebeat](bytebeat.md) is a simple method of generating procedural "8bit" music, it is used e.g. in [Anarch](anarch.md). Procedural generation is generally popular in indie game dev thanks to offering a way of generating huge amounts of content quickly and without having to pay artists.
|
||||
|
||||
We may see procgen as being similar to [compression](compression.md) algorithms: we have large data and are looking for an algorithm that's much smaller while being able to reproduce the data (but here we normally go the other way around, we start with the algorithm and see what data it produces rather than searching for an algorithm that produces given data). [John Carmack](john_carmack.md) himself called procgen "basically a shitty compression".
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue