procedural content generation - cornell university...procedural content generation interesting for...

85
CS/INFO 4154: Analytics-driven Game Design Procedural Content Generation Class 13:

Upload: others

Post on 27-Jun-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

CS/INFO 4154:Analytics-driven Game Design

Procedural Content Generation

Class 13:

Page 2: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Procedural Content Generation Interesting for both programming and design

Source: Mojang

Page 3: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Today you will learn Two bread-and-butter techniques

Perlin Noise Grammars

How Minecraft’s terrain generation works*

*to the extent that has been discussed publicly

Page 4: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Outline History Techniques for Aesthetics Techniques for Structure

Page 5: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Outline History Techniques for Aesthetics Techniques for Structure

Page 6: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Rogue (1980)

Page 7: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

1980 – 1996 A bunch of games I’ve never played

Nethack (1987)

Page 8: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Diablo I - III (1996, 2002, 2012)

Source: www.dlcompare.com

Page 9: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Spore (2008)

Source: spore.wikia.com

Page 10: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Spore (2008)

Source: spore.wikia.com

Page 11: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Spore (2008)

Hecker et al. SIGGRAPH 2008

Page 12: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Spelunky (2008)

Page 13: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Elder Scrolls V: Skyrim (2011)

Page 14: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

FTL (2012)

Page 15: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Clicker Heroes (2014)

Page 16: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Infinite Mario (2008)

Markus Persson

Page 17: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Minecraft (2009)

Page 18: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Challenges

“You’ve just taken a really hard problem and made it harder”

Source: spore.wikia.com

Kate Compton, who worked on Spore

Page 19: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Challenges Good? Fun? Beatable? Consistent? Is it always acceptable? Interesting? As good as human-designed content?

Page 20: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Outline History Techniques for Aesthetics Techniques for Structure

Page 21: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Pair discussion: Aesthetics Describe this scene

What is in it? How is it organized?

Page 22: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Idea: Random mountains

Ugly Unstructured

Page 23: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Actual surface of the earth

Source: Google maps

Page 24: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Management of Randomness

more random

more structured

Random numbers

Page 25: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Management of Randomness

more random

more structured

Perlin Noise

Random numbers

Page 26: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Perlin Noise

Page 27: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Perlin Noise Mountains

Source: Giliam de Carpentier

Page 28: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

2D mountains

Page 29: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

How to make 3D mountains?

Source: Mojang

Page 30: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

How to make 3D mountains?

Page 31: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Idea: do this on a grid

Page 32: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Step 1: Random gradients

Page 33: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Step 2: Slopes as vectors

Page 34: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Step 3: Pick a target point

Page 35: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Step 4: Isolate local vectors

Page 36: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Step 5: Get vectors to target point

Page 37: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Step 5: Vectors to target point

Page 38: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Step 5: Vectors to target point

Page 39: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Step 6: Dot products

0

0 .6

.3

Page 40: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Step 7: Interpolate

0

0 .6

.3

.15

Page 41: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Minecraft with pure Perlin Noise

Source: http://blog.movingblocks.net/2011/06/11/goodbye-perlin-noise-2d-perlin-noise-3d/

Page 42: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Comparison?

Page 43: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Other problem: periodicity

Page 44: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Solution: Octaves

Page 45: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Octaves

https://www.redblobgames.com/maps/terrain-from-noise/

Page 46: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Outline History Techniques for Aesthetics Techniques for Structure

Page 47: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Returning to Spelunky

Page 48: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Review: design patterns

Page 49: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Pair activity: what makes a maze valid?

Page 50: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Constraints must have an entrance must have an exit must have a path to get to the exit cells have four walls walls can be open or closed exterior walls (except entrance/exit) must be closed can get from cell to adjacent cell if wall is open

Page 51: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Management of Randomness

more random

more structured

Perlin Noise

Random numbers

Grammars

Page 52: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Grammars

S → a a

Page 53: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Grammars

S → a | b ab

Page 54: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Grammars

S → Sb | aSSbSbbabb

S → SbS → SbS → Sa

Page 55: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Grammars

S → Sb | a aababbabbb

Page 56: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Grammars

S → aScS → b

abcaabcc

aaabccc

Page 57: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Individual Check

S → X | YX → XX | abY → YY | bc

ababababbcbc

bcbcbcbcbc

NOT: ababbc

Page 58: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Shape Grammar

A

B

Page 59: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Shape Grammar

B

Page 60: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Shape Grammar

Page 61: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Spelunky Level Generation

Source: Derek Yu

Page 62: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Spelunky Level Generation

Source: Derek Yu

Page 63: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Spelunky Level Generation

Source: Derek Yu

Page 64: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Spelunky Level Generation

Source: Derek Yu

Page 65: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Spelunky Level Generation

Source: Derek Yu

Page 66: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Spelunky Level Generation

Source: Derek Yu

Page 67: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Problem with grammars

Source: Derek Yu

Individual cells don’t really know about each other

Page 68: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Zelda: Twilight Princess

Source: ZorZelda Youtube

Page 69: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Missions

Dormans et al. FDG 2010

Page 70: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Graph Grammars

Dormans et al. FDG 2010

Page 71: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Level Task

Task Task Task

Dormans et al. FDG 2010

Page 72: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Key DoorTask

Dormans et al. FDG 2010

Page 73: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Key Door

KeyDoor

Key

Dormans et al. FDG 2010

Page 74: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Dormans et al. FDG 2010

Page 75: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

How to get this into a space?

Dormans et al. FDG 2010

Page 76: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Idea: combine with shape grammar

Dormans et al. FDG 2010

Page 77: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Dormans et al. FDG 2010

Page 78: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Dormans et al. FDG 2010

Page 79: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Returning to Infinite Mario

Page 80: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Describe this scene

Page 81: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Management of Randomness

more random

more structured

Perlin Noise

Random numbers

Grammars

Constraint satisfaction

Page 82: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

LaunchPad

Smith et al. TCIAIG 2011

Page 83: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

LaunchPad

Smith et al. TCIAIG 2011

Page 84: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Management of Randomness

more random

more structured

Perlin Noise

Random numbers

Grammars

Constraint satisfaction

Page 85: Procedural Content Generation - Cornell University...Procedural Content Generation Interesting for both programming and design Source: Mojang Today you will learn Two bread-and-butter

Summary Procedural content generation

enhances design power enables some games (Minecraft) combines programming and design

Key techniques Perlin Noise Grammars