by Pier Luca Lanzi - Procedural content generation dates back to the early 1980s when simple algorithmic procedures were applied to generate huge, possibly infinite, amount of game content with very limited resources. Nowadays, although the memory limitations are long forgotten, procedural content generation is still widely used both to reduce the design costs, to generate those immense scenarios which would be infeasible for human designers, and to inspire human designers. Recent examples include the Diablo series, Sid Meyer’s Civilization, etc. In this presentation we provide an introduction to procedural content.
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
An Introduction to Procedural Content Generation
1. Introduction to Procedural
Content Generation
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
2. What is Procedural Content Generation?
Procedural Generation
with no or limited human intervention, algorithmically
of Content
of “things that affect the gameplay”, not non-player
character behavior, not the game engine
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
3. so what exactly is procedurally generated?
levels, tracks, maps, terrains, dungeons, puzzles,
buildings, trees, grass, fire, plots, descriptions,
scenarios, dialogues, quests, characters, rules,
boards, parameters, camera viewpoint, dynamics,
weapons, clothing, vehicles, personalities, etc.
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
8. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
9. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
10. What the ingredients?
domain knowledge
artificial intelligence
structured randomness
multi-layering
filters, limits & restrictions
specialized algorithms
gameplay integration
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
11. Ingredients #1 & #2
Domain Knowledge & Artificial
Intelligence • Domain Knowledge
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
To generate something you need to know it
PCG typically aims at building an artificial level
designer, usually needs domain knowledge
about level design
• Artificial Intelligence
Need algorithms that can work on complex
knowledge and generate plausible content
Search-based methods, L-systems, evolutionary
computation, fractals, cellular automata,
agent-based methods, planning, etc.
11
12. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
13. ingredient #3
structured randomness
things look like they have been randomly
generated but it is not completely at
random!
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
14. f(x) = sin(x)
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
15. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
16. they both look like “noise”
but one of them feels like it has structure…
it is structured randomness
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
17. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
18. ingredient #4
multi-layering
typically more layers of procedural
content generation are applied in sequence
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
19. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
• Warzone 2100
Heights &
Cliffs
Roads
Textures
Player Bases
Local
Features
• Civilization 4
Fractal
Heightfield
Plate Tectonics
Tile Types
Rivers and Lakes
Map Bonuses
20. ingredient #5
Filters, Limits & Restrictions
“In Civ3 I would say we even shipped with a sub-standard
resource
placement algorithm where all the iron could be
concentrated in just
a few small locations on the map, and for one player there
may be literally no way for them to build swordsmen.”
– Soren Johnson
"With Civ4 we instituted randomness with limitations.
There
always has to be a minimum distance between each
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
element of
November 2014
21. ingredient #6
specialized algorithms
placing special items, requires special
tricks
this tricks must be encoded in the PCG
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
22. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
1. Connect all bases, the
resources,
pick three random points and
connect them
2. Apply a customize A* heuristic
and reuse roads!
3. Customize A* heuristic with
randomize cost of non-road
grid cells.
23. ingredient #7
gameplay integration
Is it fun to play? Is the progression
adequate?
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
24. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
25. is this all there is?
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
26. PC
G
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014
Is it done online?
Or offline?
Is it necessary
content? Or
optional?
Do you use random
seeds or parameter
vectors?
Generate and test?
Is it stochastic?
Or deterministic?
Constructive?
27. we can do it, so can you!
Pier Luca Lanzi e Michele Pirovano – Codemotion Milan
November 2014