SlideShare a Scribd company logo
1 of 69
Download to read offline
Pier Luca Lanzi
Procedural Content Generation
Pier Luca Lanzi, Daniele Loiacono, Michele Pirovano
Pier Luca Lanzi
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
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 Lanzihttp://en.wikipedia.org/wiki/Rogue_(video_game)#mediaviewer/File:Rogue_Screen_Shot_CAR.PNG
Pier Luca Lanzi
Pier Luca Lanzi
BBC Micro – 2 MHz MOS Technology 6502/6512
16-128 kB RAM 32-128 kB ROM
Pier Luca Lanzihttps://www.youtube.com/watch?v=ISR4ebdGlOk
Pier Luca Lanzi
Pier Luca Lanzi
Pier Luca Lanzi
What the ingredients?
domain knowledge
artificial intelligence
structured randomness
multi-layering
filters, limits & restrictions
specialized algorithms
gameplay integration
Pier Luca Lanzi
Ingredients #1 & #2
Domain Knowledge & Artificial Intelligence
•  Domain Knowledge
§ 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
Pier Luca Lanzi
Pier Luca Lanzi
ingredient #3
structured randomness
things look like they have been randomly
generated but it is not completely at random!
Pier Luca Lanzi
f(x) = sin(x)
Pier Luca Lanzi
Pier Luca Lanzi
they both look like “noise”
but one of them feels like it has structure…
it is structured randomness
Pier Luca Lanzi
Pier Luca Lanzi
Example: Building Mario Levels
•  Library of chuncks.
•  Irregular in size.
•  Mixed purpose:
§ Mainly geometry.
§ Mainly gameplay.
•  Anchor points (Mario)
18
Pier Luca Lanzi
Algorithm
•  Chunk Filtering
§ Some chunks just don‘t match the current level.
•  Chunk Selection
§ Various metrics, randomness and designer settings.
•  Chunk Insertion
§ Remove overlapping components.
•  Post-Processing
§ Cosmetic and gameplay adjustments.
19
Pier Luca Lanzi
Infinite Mario Level 20
Pier Luca Lanzi
Map & Cave Generators
•  Cave generators typically are based on Cellular Automata
•  Map generators typically an approach
§ Tile-Based
§ Digger
§ Uniform
21
Pier Luca Lanzi
Tile-Based Map Generation
•  Simple to implement
•  Requires rich tileset or it can easily lead to repetitions
22
Pier Luca Lanzi
Uniform Map Generators
•  Two steps
§ First create rooms based on
a high level grid
§ Next, create the corridors
to connect the rooms
•  Rather simple to implement
•  Limited topology by the room
shape and the grid
23
Rogue (1980)
Pier Luca Lanzi
Digger Generators
•  Simulates the behavior of a mole that digs its den
•  Generates maps that have a tree like structure
24
Pier Luca Lanzi
ingredient #4
multi-layering
typically more layers of procedural
content generation are applied in sequence
Pier Luca Lanzi
•  Warzone 2100
§ Heights & Cliffs
§ Roads
§ Textures
§ Player Bases
§ Local Features
•  Civilization 4
§ Fractal Heightfield
§ Plate Tectonics
§ Tile Types
§ Rivers and Lakes
§ Map Bonuses
Pier Luca Lanzi
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 element of
iron, or each element of horses, and that completely solved the
problem.” – Soren Johnson
Pier Luca Lanzi
ingredient #6
specialized algorithms
placing special items, requires special tricks
this tricks must be encoded in the PCG
Pier Luca Lanzi
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.
Pier Luca Lanzi
ingredient #7
gameplay integration
Is it fun to play? Is the progression adequate?
Pier Luca Lanzi
Pier Luca Lanzi
is this all there is?
Pier Luca Lanzi
PCG
Is it done online?
Or offline?
Is it necessary content?
Or optional?
Do you use random
seeds or parameter
vectors?
Is it stochastic?
Or deterministic?
Generate and test?
Constructive?
Pier Luca Lanzi
Domain Knowledge
•  To build an artificial intelligence, you typically need a lot of domain knowleddge
•  When using PCG you‘re building an artificial level designer, so you usually need domain
knowledge about level design
•  So you‘ll probably need a real level designer and people who have some experience
•  When you build a particular level you don‘t need to understand the general concepts
behind the game mechanics as much as when you do it procedurally
•  When you go procedurally, you have to understand all the space of options you are
creating and understand how your game mechanics tie in with the level
•  Provide ways to customize your algorithms and tools for controlling and visualizing the
result
34
Pier Luca Lanzi
Inputs & Senses
•  Procedural generation algorithms
work on different sets of inputs
and actions (when compared to
traditional AI)
•  Examples of Inputs
§ Line of Sight
§ Point Distance (A*, Dijkstra)
§ Obstacles & Clearance
§ Height
•  Examples of Actions
§ Place resources
§ Layout buildings
§ Create roads/rivers
§ Adjust terrain
35
Pier Luca Lanzi
Frozen Synapse
Pier Luca Lanzi
Level Generator #1 37
Pier Luca Lanzi
Human Designed Levels 38
Pier Luca Lanzi
Algorithm
1. 2.
3. 4.
39
Pier Luca Lanzi
Step 5. 40
Pier Luca Lanzi
Step 6. Walls & Doors 41
Pier Luca Lanzi
Step 7. Windows & More Doors 42
Pier Luca Lanzi
Step 8. Box Cover 43
Pier Luca Lanzi
Example #1 44
Pier Luca Lanzi
Example #2 45
Pier Luca Lanzi
Example #3 46
Pier Luca Lanzi
Example #4 47
Pier Luca Lanzi
No Man’s Sky
from nucl.ai conference
Pier Luca Lanzi
Philosophy
•  Artist directed
•  Procedural generation is irrelevant to end user
•  Motivation
§ Game world scale
§ Output from small team
§ Unexpected outputs
§ Individual experiences
•  Engine agnostic to content origin
•  Mix of general and specific techniques
49
Pier Luca Lanzi
Multi-Layered Generation 50
Pier Luca Lanzi
Region Creation Process
1. Generation
2. Polygonisation
3. Spherification
4. Physics construction
5. AI knowledge construction
6. Decoration
51
Pier Luca Lanzi
Generation Requirements
•  Directable and consistent
•  Real-time
•  Varied
•  Real world and abstract shapes
•  Easy to modify and add to
•  Data local
52
Pier Luca Lanzi
Perlin/Simplex Noise
•  Well known techniques
§ Widely applicable
§ Scalable
§ Repetitive
§ Insufficient
•  Modified version
§ Perlin worms
§ Noise with a threshold
§ Paths, caves, lines
53
Pier Luca Lanzi
Structured Shapes
•  Cellular noise patterns
•  Worley/Voronoi Noise
•  Pickpoints
•  Calculate min distances
•  Cliffs, paths, regions...
54
Pier Luca Lanzi
Mathematical Solids
•  Gielis, Johan (2003), "A generic geometric transformation that
unifies a wide range of natural and abstract shapes", American
Journal of Botany
•  Natural looking shape additions
55
Pier Luca Lanzi
Map Generation in In Verbis Virtus
(Mattia Ferrari)
56
Pier Luca Lanzi
Map Generation for In Verbis Virtus
• Requirements
§ Control over the complexity of the generated maps
§ Continuous representation
§ Avoid decors overlaps
•  Combination of diggers
and uniform approaches
•  Map elements from human
designed levels
§ Walls
§ Doors
§ Decors
57
Pier Luca Lanzi
Step 1: Growth
•  Similar to the digger approach
•  Builds a map structured as a tree
•  Growth is controlled by a set of
parameters, including,
§ Type of elements
§ Number of rooms
§ Number of branches
§ Available area
58
Pier Luca Lanzi
Step 2 & 3: Additional Corridors and
Deadline Elimination
•  Additional Corridors
§ Similar to uniform generators
§ Based on the required percentage
of connections to create
§ Distance between areas
•  Deadline Elimination
§ Based on the percentage
of dead ends to eliminate
59
Pier Luca Lanzi
Map Evaluation
•  Given a map we needed to compute several statistics to filter the
most interesting ones
•  Maps are encoded as graphs
•  Compute several metrics
§ Max distance among rooms
§ Reachability
§ Flow
§ …
60
Pier Luca Lanzi
Some Findings
•  75% or more additional connections increase the complexity of
the map without improving complica le mappe senza migliorare la
raggiungibilità
•  The generator is robust with
respect to the room shape
•  By eliminating the start room,
we can reduce the reachability
over the entire map
Pier Luca Lanzi
Mappa generata
Pier Luca Lanzi
Video finale
Pier Luca Lanzi
we can do it, so can you!
Pier Luca Lanzihttp://trackgen.pierlucalanzi.net
Pier Luca Lanzi
http://www.youtube.com/watch?v=uIUYWzdMXog
Pier Luca Lanzihttp://www.michelepirovano.com/portfolio_swordgenerator.php
Pier Luca Lanzihttp://www.michelepirovano.com/portfolio_swordgenerator.php
Pier Luca Lanzi
http://www.facebook.com/polimigamecollective
https://twitter.com/@POLIMIGC
http://www.youtube.com/PierLucaLanzi
http://www.polimigamecollective.org

More Related Content

What's hot

What's hot (20)

[IGC 2017] 넥슨코리아 심재근 - 시스템 기획자에 대한 기본 지식과 준비과정
[IGC 2017] 넥슨코리아 심재근 - 시스템 기획자에 대한 기본 지식과 준비과정[IGC 2017] 넥슨코리아 심재근 - 시스템 기획자에 대한 기본 지식과 준비과정
[IGC 2017] 넥슨코리아 심재근 - 시스템 기획자에 대한 기본 지식과 준비과정
 
게임 디렉팅 튜토리얼
게임 디렉팅 튜토리얼게임 디렉팅 튜토리얼
게임 디렉팅 튜토리얼
 
Week 2, Game Design
Week 2, Game DesignWeek 2, Game Design
Week 2, Game Design
 
Software Engineer- A unity 3d Game
Software Engineer- A unity 3d GameSoftware Engineer- A unity 3d Game
Software Engineer- A unity 3d Game
 
[IGC 2016] 컴투스 김동준 - 기획 지망생은 무엇을 준비하나요?
[IGC 2016] 컴투스 김동준 - 기획 지망생은 무엇을 준비하나요?[IGC 2016] 컴투스 김동준 - 기획 지망생은 무엇을 준비하나요?
[IGC 2016] 컴투스 김동준 - 기획 지망생은 무엇을 준비하나요?
 
Introduction to Game Engine: Concepts & Components
Introduction to Game Engine: Concepts & ComponentsIntroduction to Game Engine: Concepts & Components
Introduction to Game Engine: Concepts & Components
 
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
 
Unreal Fest 2023 - Lumen with Immortalis
Unreal Fest 2023 - Lumen with ImmortalisUnreal Fest 2023 - Lumen with Immortalis
Unreal Fest 2023 - Lumen with Immortalis
 
게임제작개론 : #5 플레이어에 대한 이해
게임제작개론 : #5 플레이어에 대한 이해게임제작개론 : #5 플레이어에 대한 이해
게임제작개론 : #5 플레이어에 대한 이해
 
[IGC 2017] 넥슨코리아 오현근 - 평생 게임 기획자 하기
[IGC 2017] 넥슨코리아 오현근 - 평생 게임 기획자 하기[IGC 2017] 넥슨코리아 오현근 - 평생 게임 기획자 하기
[IGC 2017] 넥슨코리아 오현근 - 평생 게임 기획자 하기
 
02. 게임기획, 재미를 향한 끝없는 여정
02. 게임기획, 재미를 향한 끝없는 여정02. 게임기획, 재미를 향한 끝없는 여정
02. 게임기획, 재미를 향한 끝없는 여정
 
Horizon Zero Dawn: A Game Design Post-Mortem
Horizon Zero Dawn: A Game Design Post-MortemHorizon Zero Dawn: A Game Design Post-Mortem
Horizon Zero Dawn: A Game Design Post-Mortem
 
Level Design Workshop - GDC China 2012
Level Design Workshop - GDC China 2012Level Design Workshop - GDC China 2012
Level Design Workshop - GDC China 2012
 
Real-time Online Multiplayer with Godot Engine
Real-time Online Multiplayer with Godot EngineReal-time Online Multiplayer with Godot Engine
Real-time Online Multiplayer with Godot Engine
 
[IGC 2016] 블루사이드 황상훈 - 실전 시나리오 라이팅: PD가 원하면 나는 쓴다
[IGC 2016] 블루사이드 황상훈 - 실전 시나리오 라이팅: PD가 원하면 나는 쓴다 [IGC 2016] 블루사이드 황상훈 - 실전 시나리오 라이팅: PD가 원하면 나는 쓴다
[IGC 2016] 블루사이드 황상훈 - 실전 시나리오 라이팅: PD가 원하면 나는 쓴다
 
게임 디자이너와 게임 서버
게임 디자이너와 게임 서버게임 디자이너와 게임 서버
게임 디자이너와 게임 서버
 
게임제작개론: #1 게임 구성 요소의 이해
게임제작개론: #1 게임 구성 요소의 이해게임제작개론: #1 게임 구성 요소의 이해
게임제작개론: #1 게임 구성 요소의 이해
 
Multiplayer Game Sync Techniques through CAP theorem
Multiplayer Game Sync Techniques through CAP theoremMultiplayer Game Sync Techniques through CAP theorem
Multiplayer Game Sync Techniques through CAP theorem
 
What Is A Game Engine
What Is A Game EngineWhat Is A Game Engine
What Is A Game Engine
 
게임 기획과 Oop
게임 기획과 Oop게임 기획과 Oop
게임 기획과 Oop
 

Viewers also liked

Viewers also liked (20)

Procedural Content Generation with Unity
Procedural Content Generation with UnityProcedural Content Generation with Unity
Procedural Content Generation with Unity
 
Focus Junior - 14 Maggio 2016
Focus Junior - 14 Maggio 2016Focus Junior - 14 Maggio 2016
Focus Junior - 14 Maggio 2016
 
Data Driven Game Design
Data Driven Game DesignData Driven Game Design
Data Driven Game Design
 
Designing Puzzles for Video Games
Designing Puzzles for Video GamesDesigning Puzzles for Video Games
Designing Puzzles for Video Games
 
Transparency in Game Mechanics
Transparency in Game MechanicsTransparency in Game Mechanics
Transparency in Game Mechanics
 
Game Balancing
Game BalancingGame Balancing
Game Balancing
 
Game Mechanics
Game MechanicsGame Mechanics
Game Mechanics
 
Codemotion Milan - November 21 2015
Codemotion Milan - November 21 2015Codemotion Milan - November 21 2015
Codemotion Milan - November 21 2015
 
Presentazione Open Day del Politecnico di Milano (2016)
Presentazione Open Day del Politecnico di Milano (2016)Presentazione Open Day del Politecnico di Milano (2016)
Presentazione Open Day del Politecnico di Milano (2016)
 
Introduzione alla realizzazione di videogiochi - Fun
Introduzione alla realizzazione di videogiochi - FunIntroduzione alla realizzazione di videogiochi - Fun
Introduzione alla realizzazione di videogiochi - Fun
 
The Design Document
The Design DocumentThe Design Document
The Design Document
 
Elements for the Theory of Fun
Elements for the Theory of FunElements for the Theory of Fun
Elements for the Theory of Fun
 
Idea Generation and Conceptualization
Idea Generation and ConceptualizationIdea Generation and Conceptualization
Idea Generation and Conceptualization
 
DMTM 2015 - 12 Classification Rules
DMTM 2015 - 12 Classification RulesDMTM 2015 - 12 Classification Rules
DMTM 2015 - 12 Classification Rules
 
DMTM 2015 - 13 Naive bayes, Nearest Neighbours and Other Methods
DMTM 2015 - 13 Naive bayes, Nearest Neighbours and Other MethodsDMTM 2015 - 13 Naive bayes, Nearest Neighbours and Other Methods
DMTM 2015 - 13 Naive bayes, Nearest Neighbours and Other Methods
 
Machine Learning and Data Mining: 12 Classification Rules
Machine Learning and Data Mining: 12 Classification RulesMachine Learning and Data Mining: 12 Classification Rules
Machine Learning and Data Mining: 12 Classification Rules
 
La Matematica e la fisica da Pong ai giochi tripla A
La Matematica e la fisica da Pong ai giochi tripla ALa Matematica e la fisica da Pong ai giochi tripla A
La Matematica e la fisica da Pong ai giochi tripla A
 
Introduzione alla realizzazione di videogiochi - Elementi di game design
Introduzione alla realizzazione di videogiochi - Elementi di game designIntroduzione alla realizzazione di videogiochi - Elementi di game design
Introduzione alla realizzazione di videogiochi - Elementi di game design
 
Introduzione alla realizzazione di videogiochi - Presentazione del corso
Introduzione alla realizzazione di videogiochi - Presentazione del corsoIntroduzione alla realizzazione di videogiochi - Presentazione del corso
Introduzione alla realizzazione di videogiochi - Presentazione del corso
 
Introduzione alla realizzazione di videogiochi - Meccaniche
Introduzione alla realizzazione di videogiochi - MeccanicheIntroduzione alla realizzazione di videogiochi - Meccaniche
Introduzione alla realizzazione di videogiochi - Meccaniche
 

Similar to Procedural Content Generation

Introduction to Procedural Content Generation - Codemotion 29 Novembre 2014
Introduction to Procedural Content Generation - Codemotion 29 Novembre 2014Introduction to Procedural Content Generation - Codemotion 29 Novembre 2014
Introduction to Procedural Content Generation - Codemotion 29 Novembre 2014
Pier Luca Lanzi
 
Tooling for the JavaScript Era
Tooling for the JavaScript EraTooling for the JavaScript Era
Tooling for the JavaScript Era
martinlippert
 

Similar to Procedural Content Generation (20)

VDP2016 - Lecture 14 Procedural content generation
VDP2016 - Lecture 14 Procedural content generationVDP2016 - Lecture 14 Procedural content generation
VDP2016 - Lecture 14 Procedural content generation
 
Introduction to Procedural Content Generation - Codemotion 29 Novembre 2014
Introduction to Procedural Content Generation - Codemotion 29 Novembre 2014Introduction to Procedural Content Generation - Codemotion 29 Novembre 2014
Introduction to Procedural Content Generation - Codemotion 29 Novembre 2014
 
VDP2016 - Lecture 13 Data driven game design
VDP2016 - Lecture 13 Data driven game designVDP2016 - Lecture 13 Data driven game design
VDP2016 - Lecture 13 Data driven game design
 
Introduction to AI in computer games
Introduction to AI in computer gamesIntroduction to AI in computer games
Introduction to AI in computer games
 
DigitalCreationLita
DigitalCreationLitaDigitalCreationLita
DigitalCreationLita
 
Artificial intelligence in gaming.
Artificial intelligence in gaming.Artificial intelligence in gaming.
Artificial intelligence in gaming.
 
Junk Master Series : AltDevConf 2012
Junk Master Series : AltDevConf 2012Junk Master Series : AltDevConf 2012
Junk Master Series : AltDevConf 2012
 
Understanding and improving games through machine learning - Natasha Latysheva
Understanding and improving games through machine learning - Natasha LatyshevaUnderstanding and improving games through machine learning - Natasha Latysheva
Understanding and improving games through machine learning - Natasha Latysheva
 
Procedural Processes - Lessons Learnt from Automated Content Generation in "E...
Procedural Processes - Lessons Learnt from Automated Content Generation in "E...Procedural Processes - Lessons Learnt from Automated Content Generation in "E...
Procedural Processes - Lessons Learnt from Automated Content Generation in "E...
 
Raspberry Pi, Arduino and the Maker Movement
Raspberry Pi, Arduino and the Maker MovementRaspberry Pi, Arduino and the Maker Movement
Raspberry Pi, Arduino and the Maker Movement
 
Tooling for the JavaScript Era
Tooling for the JavaScript EraTooling for the JavaScript Era
Tooling for the JavaScript Era
 
Data Driven Game Design @ Campus Party 2018
Data Driven Game Design @ Campus Party 2018Data Driven Game Design @ Campus Party 2018
Data Driven Game Design @ Campus Party 2018
 
Computer-Vision based Centralized Multi-agent System on Matlab and Arduino Du...
Computer-Vision based Centralized Multi-agent System on Matlab and Arduino Du...Computer-Vision based Centralized Multi-agent System on Matlab and Arduino Du...
Computer-Vision based Centralized Multi-agent System on Matlab and Arduino Du...
 
Ticketmaster Network Telemtery
Ticketmaster Network Telemtery Ticketmaster Network Telemtery
Ticketmaster Network Telemtery
 
Lego mindstorms
Lego mindstormsLego mindstorms
Lego mindstorms
 
Sullivan randomness-infiltrate 2014
Sullivan randomness-infiltrate 2014Sullivan randomness-infiltrate 2014
Sullivan randomness-infiltrate 2014
 
Graph-Tool in Practice
Graph-Tool in PracticeGraph-Tool in Practice
Graph-Tool in Practice
 
Assessing Lag Perception in Electronic Sketching
Assessing Lag Perception in Electronic SketchingAssessing Lag Perception in Electronic Sketching
Assessing Lag Perception in Electronic Sketching
 
What's up about Plasma-MID?
What's up about Plasma-MID?What's up about Plasma-MID?
What's up about Plasma-MID?
 
Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill) Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill)
 

More from Pier Luca Lanzi

More from Pier Luca Lanzi (20)

11 Settembre 2021 - Giocare con i Videogiochi
11 Settembre 2021 - Giocare con i Videogiochi11 Settembre 2021 - Giocare con i Videogiochi
11 Settembre 2021 - Giocare con i Videogiochi
 
Breve Viaggio al Centro dei Videogiochi
Breve Viaggio al Centro dei VideogiochiBreve Viaggio al Centro dei Videogiochi
Breve Viaggio al Centro dei Videogiochi
 
Global Game Jam 19 @ POLIMI - Morning Welcome
Global Game Jam 19 @ POLIMI - Morning WelcomeGlobal Game Jam 19 @ POLIMI - Morning Welcome
Global Game Jam 19 @ POLIMI - Morning Welcome
 
GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...
GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...
GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...
 
GGJ18 al Politecnico di Milano - Presentazione di apertura
GGJ18 al Politecnico di Milano - Presentazione di aperturaGGJ18 al Politecnico di Milano - Presentazione di apertura
GGJ18 al Politecnico di Milano - Presentazione di apertura
 
Presentation for UNITECH event - January 8, 2018
Presentation for UNITECH event - January 8, 2018Presentation for UNITECH event - January 8, 2018
Presentation for UNITECH event - January 8, 2018
 
DMTM Lecture 20 Data preparation
DMTM Lecture 20 Data preparationDMTM Lecture 20 Data preparation
DMTM Lecture 20 Data preparation
 
DMTM Lecture 19 Data exploration
DMTM Lecture 19 Data explorationDMTM Lecture 19 Data exploration
DMTM Lecture 19 Data exploration
 
DMTM Lecture 18 Graph mining
DMTM Lecture 18 Graph miningDMTM Lecture 18 Graph mining
DMTM Lecture 18 Graph mining
 
DMTM Lecture 17 Text mining
DMTM Lecture 17 Text miningDMTM Lecture 17 Text mining
DMTM Lecture 17 Text mining
 
DMTM Lecture 16 Association rules
DMTM Lecture 16 Association rulesDMTM Lecture 16 Association rules
DMTM Lecture 16 Association rules
 
DMTM Lecture 15 Clustering evaluation
DMTM Lecture 15 Clustering evaluationDMTM Lecture 15 Clustering evaluation
DMTM Lecture 15 Clustering evaluation
 
DMTM Lecture 14 Density based clustering
DMTM Lecture 14 Density based clusteringDMTM Lecture 14 Density based clustering
DMTM Lecture 14 Density based clustering
 
DMTM Lecture 13 Representative based clustering
DMTM Lecture 13 Representative based clusteringDMTM Lecture 13 Representative based clustering
DMTM Lecture 13 Representative based clustering
 
DMTM Lecture 12 Hierarchical clustering
DMTM Lecture 12 Hierarchical clusteringDMTM Lecture 12 Hierarchical clustering
DMTM Lecture 12 Hierarchical clustering
 
DMTM Lecture 11 Clustering
DMTM Lecture 11 ClusteringDMTM Lecture 11 Clustering
DMTM Lecture 11 Clustering
 
DMTM Lecture 10 Classification ensembles
DMTM Lecture 10 Classification ensemblesDMTM Lecture 10 Classification ensembles
DMTM Lecture 10 Classification ensembles
 
DMTM Lecture 09 Other classificationmethods
DMTM Lecture 09 Other classificationmethodsDMTM Lecture 09 Other classificationmethods
DMTM Lecture 09 Other classificationmethods
 
DMTM Lecture 08 Classification rules
DMTM Lecture 08 Classification rulesDMTM Lecture 08 Classification rules
DMTM Lecture 08 Classification rules
 
DMTM Lecture 07 Decision trees
DMTM Lecture 07 Decision treesDMTM Lecture 07 Decision trees
DMTM Lecture 07 Decision trees
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 

Procedural Content Generation

  • 1. Pier Luca Lanzi Procedural Content Generation Pier Luca Lanzi, Daniele Loiacono, Michele Pirovano
  • 2. Pier Luca Lanzi 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
  • 3. Pier Luca Lanzi 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.
  • 6. Pier Luca Lanzi BBC Micro – 2 MHz MOS Technology 6502/6512 16-128 kB RAM 32-128 kB ROM
  • 10. Pier Luca Lanzi What the ingredients? domain knowledge artificial intelligence structured randomness multi-layering filters, limits & restrictions specialized algorithms gameplay integration
  • 11. Pier Luca Lanzi Ingredients #1 & #2 Domain Knowledge & Artificial Intelligence •  Domain Knowledge § 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
  • 13. Pier Luca Lanzi ingredient #3 structured randomness things look like they have been randomly generated but it is not completely at random!
  • 16. Pier Luca Lanzi they both look like “noise” but one of them feels like it has structure… it is structured randomness
  • 18. Pier Luca Lanzi Example: Building Mario Levels •  Library of chuncks. •  Irregular in size. •  Mixed purpose: § Mainly geometry. § Mainly gameplay. •  Anchor points (Mario) 18
  • 19. Pier Luca Lanzi Algorithm •  Chunk Filtering § Some chunks just don‘t match the current level. •  Chunk Selection § Various metrics, randomness and designer settings. •  Chunk Insertion § Remove overlapping components. •  Post-Processing § Cosmetic and gameplay adjustments. 19
  • 20. Pier Luca Lanzi Infinite Mario Level 20
  • 21. Pier Luca Lanzi Map & Cave Generators •  Cave generators typically are based on Cellular Automata •  Map generators typically an approach § Tile-Based § Digger § Uniform 21
  • 22. Pier Luca Lanzi Tile-Based Map Generation •  Simple to implement •  Requires rich tileset or it can easily lead to repetitions 22
  • 23. Pier Luca Lanzi Uniform Map Generators •  Two steps § First create rooms based on a high level grid § Next, create the corridors to connect the rooms •  Rather simple to implement •  Limited topology by the room shape and the grid 23 Rogue (1980)
  • 24. Pier Luca Lanzi Digger Generators •  Simulates the behavior of a mole that digs its den •  Generates maps that have a tree like structure 24
  • 25. Pier Luca Lanzi ingredient #4 multi-layering typically more layers of procedural content generation are applied in sequence
  • 26. Pier Luca Lanzi •  Warzone 2100 § Heights & Cliffs § Roads § Textures § Player Bases § Local Features •  Civilization 4 § Fractal Heightfield § Plate Tectonics § Tile Types § Rivers and Lakes § Map Bonuses
  • 27. Pier Luca Lanzi 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 element of iron, or each element of horses, and that completely solved the problem.” – Soren Johnson
  • 28. Pier Luca Lanzi ingredient #6 specialized algorithms placing special items, requires special tricks this tricks must be encoded in the PCG
  • 29. Pier Luca Lanzi 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.
  • 30. Pier Luca Lanzi ingredient #7 gameplay integration Is it fun to play? Is the progression adequate?
  • 32. Pier Luca Lanzi is this all there is?
  • 33. Pier Luca Lanzi PCG Is it done online? Or offline? Is it necessary content? Or optional? Do you use random seeds or parameter vectors? Is it stochastic? Or deterministic? Generate and test? Constructive?
  • 34. Pier Luca Lanzi Domain Knowledge •  To build an artificial intelligence, you typically need a lot of domain knowleddge •  When using PCG you‘re building an artificial level designer, so you usually need domain knowledge about level design •  So you‘ll probably need a real level designer and people who have some experience •  When you build a particular level you don‘t need to understand the general concepts behind the game mechanics as much as when you do it procedurally •  When you go procedurally, you have to understand all the space of options you are creating and understand how your game mechanics tie in with the level •  Provide ways to customize your algorithms and tools for controlling and visualizing the result 34
  • 35. Pier Luca Lanzi Inputs & Senses •  Procedural generation algorithms work on different sets of inputs and actions (when compared to traditional AI) •  Examples of Inputs § Line of Sight § Point Distance (A*, Dijkstra) § Obstacles & Clearance § Height •  Examples of Actions § Place resources § Layout buildings § Create roads/rivers § Adjust terrain 35
  • 37. Pier Luca Lanzi Level Generator #1 37
  • 38. Pier Luca Lanzi Human Designed Levels 38
  • 41. Pier Luca Lanzi Step 6. Walls & Doors 41
  • 42. Pier Luca Lanzi Step 7. Windows & More Doors 42
  • 43. Pier Luca Lanzi Step 8. Box Cover 43
  • 48. Pier Luca Lanzi No Man’s Sky from nucl.ai conference
  • 49. Pier Luca Lanzi Philosophy •  Artist directed •  Procedural generation is irrelevant to end user •  Motivation § Game world scale § Output from small team § Unexpected outputs § Individual experiences •  Engine agnostic to content origin •  Mix of general and specific techniques 49
  • 51. Pier Luca Lanzi Region Creation Process 1. Generation 2. Polygonisation 3. Spherification 4. Physics construction 5. AI knowledge construction 6. Decoration 51
  • 52. Pier Luca Lanzi Generation Requirements •  Directable and consistent •  Real-time •  Varied •  Real world and abstract shapes •  Easy to modify and add to •  Data local 52
  • 53. Pier Luca Lanzi Perlin/Simplex Noise •  Well known techniques § Widely applicable § Scalable § Repetitive § Insufficient •  Modified version § Perlin worms § Noise with a threshold § Paths, caves, lines 53
  • 54. Pier Luca Lanzi Structured Shapes •  Cellular noise patterns •  Worley/Voronoi Noise •  Pickpoints •  Calculate min distances •  Cliffs, paths, regions... 54
  • 55. Pier Luca Lanzi Mathematical Solids •  Gielis, Johan (2003), "A generic geometric transformation that unifies a wide range of natural and abstract shapes", American Journal of Botany •  Natural looking shape additions 55
  • 56. Pier Luca Lanzi Map Generation in In Verbis Virtus (Mattia Ferrari) 56
  • 57. Pier Luca Lanzi Map Generation for In Verbis Virtus • Requirements § Control over the complexity of the generated maps § Continuous representation § Avoid decors overlaps •  Combination of diggers and uniform approaches •  Map elements from human designed levels § Walls § Doors § Decors 57
  • 58. Pier Luca Lanzi Step 1: Growth •  Similar to the digger approach •  Builds a map structured as a tree •  Growth is controlled by a set of parameters, including, § Type of elements § Number of rooms § Number of branches § Available area 58
  • 59. Pier Luca Lanzi Step 2 & 3: Additional Corridors and Deadline Elimination •  Additional Corridors § Similar to uniform generators § Based on the required percentage of connections to create § Distance between areas •  Deadline Elimination § Based on the percentage of dead ends to eliminate 59
  • 60. Pier Luca Lanzi Map Evaluation •  Given a map we needed to compute several statistics to filter the most interesting ones •  Maps are encoded as graphs •  Compute several metrics § Max distance among rooms § Reachability § Flow § … 60
  • 61. Pier Luca Lanzi Some Findings •  75% or more additional connections increase the complexity of the map without improving complica le mappe senza migliorare la raggiungibilità •  The generator is robust with respect to the room shape •  By eliminating the start room, we can reduce the reachability over the entire map
  • 64. Pier Luca Lanzi we can do it, so can you!