an introduction to procedural content generation

32
Pier Luca Lanzi e Michele Pirovano Codemotion Milan November 2014 Introduction to Procedural Content Generation

Upload: codemotion

Post on 05-Jul-2015

169 views

Category:

Technology


0 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

Introduction to Procedural

Content Generation

Page 2: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

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

Page 3: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

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.

Page 4: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

http://en.wikipedia.org/wiki/Rogue_(video_game)#mediaviewer/File:Rogue_Screen_Shot

_CAR.PNG

Page 5: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

Page 6: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

BBC Micro – 2 MHz MOS Technology 6502/6512

16-128 kB RAM 32-128 kB ROM

Page 7: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

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

Page 8: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

Page 9: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

Page 10: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

What the ingredients?

domain knowledge

artificial intelligence

structured randomness

multi-layering

filters, limits & restrictions

specialized algorithms

gameplay integration

Page 11: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

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

Page 12: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

Page 13: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

ingredient #3

structured randomness

things look like they have been randomly

generated but it is not completely at

random!

Page 14: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

f(x) = sin(x)

Page 15: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

Page 16: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

they both look like “noise”

but one of them feels like it has structure…

it is structured randomness

Page 17: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

Page 18: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

ingredient #4

multi-layering

typically more layers of procedural

content generation are applied in sequence

Page 19: An Introduction to Procedural Content Generation

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

Page 20: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

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

Page 21: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

ingredient #6

specialized algorithms

placing special items, requires special

tricks

this tricks must be encoded in the PCG

Page 22: An Introduction to Procedural Content Generation

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.

Page 23: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

ingredient #7

gameplay integration

Is it fun to play? Is the progression

adequate?

Page 24: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

Page 25: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

is this all there is?

Page 26: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

PC

G

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?

Page 27: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

we can do it, so can you!

Page 28: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

http://trackgen.pierlucalanzi.net

Page 29: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

http://www.youtube.com/watch?v=uIUYWzdMXog

Page 30: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

http://www.michelepirovano.com/portfolio_swordgenerator.php

Page 31: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

http://www.michelepirovano.com/portfolio_swordgenerator.php

Page 32: An Introduction to Procedural Content Generation

Pier Luca Lanzi e Michele Pirovano – Codemotion Milan

November 2014

http://www.polimigamecollective.org

http://www.facebook.com/polimigamecollective

http://www.youtube.com/PierLucaLanzi