当前位置:网站首页>Lecture notes a utility for everyone to generate PCG

Lecture notes a utility for everyone to generate PCG

2022-07-28 07:56:00 Dark light trace

General

Recently turned to 2017 year GDC A speech by ——Practical Procedural Generation for Everyone, The speaker is right PCG The technology is briefly introduced , It is more suitable for people who want to know PCG Technical people .

This article refers to her speeches and articles for a summary , Try to answer the following two questions :

  1. What is? PCG?
  2. PCG Common methods ?

Use PCG Example :

  1. 《 My world 》, Generate terrain ;
  2. 《 Unmanned deep space 》, Make planets 、 Animals and plants, etc ;
  3. 《 Dwarfs Fortress 》, Generate maps 、 history 、 Characters, etc ;
  4. 《Pippen Barr》, Generate a way to touch your beard when playing chess ;
  5. 《Mr. Darcy Dance Simulator》, Generate Darcy The way to insult you
  6. 《Ultima Ratio Regum》, Create strange museums ;
  7. 《Yavalath》, Generate game rules ;
  8. Produce fabric skirts and so on 、 Generate artwork ;
  9. Making music 、 poetry .

Discussed PCG Three things :

  1. What do you want to generate ;
  2. Move experts into the program ;
  3. The specific methods .

What do you want to generate

First confirm what you want to generate , The more specific, the better , For example, generate a simple multi-storey apartment model , The goal of producing an interesting novel is a little too vague .

Next, think about what is good for products , What is bad . The good part can be set as the property of the generator , The bad part provides constraints , and Attributes and constraints determine the product possibility space .

Another way , If you don't know what to generate , You can also improvise , Start with some loose parts , Determine what it wants to generate .

Move experts into the program

This step is best discussed by experts , Get an in-depth understanding of the thinking process of experts when making this thing , Try to move it into a computer program .

In the design 《 Spore 》 Editor for , Program 、 Planning and art work closely , To understand art ( Animator ) How to model and map creatures . At that time, they hired a Disney animator , Dig deep into how he drew shapes when he created creatures 、 How to express biological character

Try asking experts the following questions ( Ontology ):

  1. What questions did they ask during the production process ?
  2. How they make decisions ?
  3. How do they balance multiple choices ?
  4. What kind of problems have been kept in their mind ?
  5. How do they name the parts of the production , And the relationship between the various parts ?

Some field experts have written some controversial frameworks to describe their work . For example, jazz improvisation in music 、 Bach style 、 harmony 、 Pop music , There are heroic narratives in the story 、TV Tropes( Research film 、 Bridge segment in TV series ), There is a golden ratio in Art 、 Color harmony and composition rules . It should be noted that no framework is complete , And there is no guarantee that following them will make a good generator , Various frameworks can provide some guidance and inspiration .

The specific methods

From rules to generation methods

human beings , Good at estimating 、 Guess and synthesize a lot of knowledge about the past ;

Computer , Tell what to do , But good at a lot of calculation .

Especially suitable for building generators ( Generation method ) The following skills will be given to computers :

1. Encapsulate knowledge options ( Skill A)

2. Create some structures ( Skill B)

3. The conditional rules of coding and selecting knowledge (A2)

4. Add variability to the structure (B2)

5. Be able to ask yourself questions according to constraints ( Have I solved this problem ?)( Skill C)

6 Methods

Method 1,Distribution, Random distribution method , random number 、 Reality is layered and aggregated .

This is the simplest generation method , You can spread a bunch of things in time and space .

 

characteristic :

  1. There is not much overall structure (B);
  2. You may choose each option (A), Sometimes weighted random or deck shuffling is used ( List all options, choose from them and discard them after use );
  3. Conditions and rules (A2) It can also become very complex , Generally, fixed parameters are given for selection .

With RPG For example :

  1. Wandering monsters are distributed in the environment (A);
  2. Advanced monsters appear in higher-level areas , Water monsters appear in the water and so on (A2);
  3. Booty may be selected from a large number of booty (A);
  4. If you defeat advanced monsters, you may get more advanced trophies (A2).

Music and language use this method is not good , Because its structure is relatively heavy , Try a block based or grammar based approach , If its structure is very fixed , You can try parameterization .

Method 2,Parametric, Parameter method .

If you have a fairly perfect workpiece , And just need a little adjustment , It can be done by parameters . It is a very reliable and controllable method !

characteristic :

  1. Provide variability through fixed one-dimensional values (A);
  2. No structural variability at all (B2);

More complex parameter method forms :

  1. Use point based 、 Path based and graph based input , similar Photoshop;
  2. 《 Spore 》 Metaball used (Metaballs);
  3. Algorithm of filling space and path ,Voronoi Pattern 、Perlin/Simplex noise 、 Triangulation algorithm 、3D Squeeze or rotate , And the diamond square algorithm of fractal terrain .

Method 3,Tiles, Block based , civilization 、 Catan island 、 diablo 、 Tarot .

This method decomposes the problem into modular 、 Tiles of the same size .

characteristic :

  1. It is very suitable for small-scale structures (B);
  2. There is little flexibility (B2);
  3. The possible options are strictly encapsulated (A).

Method 4,Grammars, grammar ,Tracery( The author made his own language )、L-System、 Story builder .

characteristic :

  1. Can build very deep and complex structures (B);
  2. At the same time, it provides a lot of control (A);
  3. The disadvantage is that there is no way to deal with constraints ;

Method 5,Interpretive, Constraint solver , Process data into other data 、 Hand tracking to get the motion line 、 Berlin noise 、 Geometric algorithms 、metaballs、 Typing and Mathematics .

The simplest and oldest version is brute force cracking , Try to make every possibility , Until the content that conforms to the constraints is produced , Of course, the solution time can be shortened in some ways .

Method 6,Simulations, Proxy and simulation , Particle generator 、 Cellular automata 、 Proxy simulation 、 physical simulation 、 Genetic algorithm (ga) .

Many agents and simulations draw inspiration from nature , For example, birds 、 evolution 、 bacteria 、 Neurons and cities .

Reference resources

  1. 《GDC Practical Procedural Generation for Everyone》

https://www.youtube.com/watch?v=WumyfLEa6bU

  1. 《So you want to build a generator…》

https://galaxykate0.tumblr.com/post/139774965871/so-you-want-to-build-a-generator

原网站

版权声明
本文为[Dark light trace]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/209/202207280606186744.html