Procedural Generation Lauri Kongas What is procedural generation? - - PowerPoint PPT Presentation

procedural generation
SMART_READER_LITE
LIVE PREVIEW

Procedural Generation Lauri Kongas What is procedural generation? - - PowerPoint PPT Presentation

Procedural Generation Lauri Kongas What is procedural generation? Procedural Generation It is the algorithmic creation of data Procedural Generation It is the algorithmic creation of data Almost anything can be created procedurally


slide-1
SLIDE 1

Procedural Generation

Lauri Kongas

slide-2
SLIDE 2

What is procedural generation?

slide-3
SLIDE 3

Procedural Generation

It is the algorithmic creation of data

slide-4
SLIDE 4

Procedural Generation

It is the algorithmic creation of data Almost anything can be created procedurally

slide-5
SLIDE 5

Procedural generation vs manual creation

Depends on the objectives

slide-6
SLIDE 6

Procedural generation vs manual creation

Depends on the objectives When used in the right circumstances it can save

  • Memory
slide-7
SLIDE 7

Procedural generation vs manual creation

Depends on the objectives When used in the right circumstances it can save

  • Memory
  • Disk space
slide-8
SLIDE 8

Procedural generation vs manual creation

Depends on the objectives When used in the right circumstances it can save

  • Memory
  • Disk space
  • Design and development cost
slide-9
SLIDE 9

Apparent randomness is a key ingredient in procedural generation

slide-10
SLIDE 10

Noise

What is noise?

slide-11
SLIDE 11

Noise

What is noise? Pseudorandom vs truly random

slide-12
SLIDE 12

The issue with white noise

Nature is smooth

slide-13
SLIDE 13

The issue with white noise

Nature is smooth Two points close to each other on the surface of an object will usually look similar. Points on the surface far from each other may look different.

slide-14
SLIDE 14

The issue with white noise

Nature is smooth Two points close to each other on the surface of an object will usually look similar. Points on the surface far from each other may look different. What we want is gradual local changes, but large global changes

slide-15
SLIDE 15

The issue with white noise

Nature is smooth Two points close to each other on the surface of an object will usually look similar. Points on the surface far from each other may look different. What we want is gradual local changes, but large global changes That’s not how random number generators usually work

slide-16
SLIDE 16

The issue with white noise

slide-17
SLIDE 17

This is better

slide-18
SLIDE 18

Value Noise

A simple type of noise which can be useful for a variety of applications, e.g. creating textures

slide-19
SLIDE 19

Value noise 2D example

1. Generate random values in one dimension

slide-20
SLIDE 20

Value noise 2D example

  • 2. Generate random values in the other dimension as well
slide-21
SLIDE 21

Value noise 2D example

  • 3. Define a grid to use for interpolation
slide-22
SLIDE 22

Value noise 2D example

  • 4. Zoom in and interpolate (smoothstep function can give nice results)
slide-23
SLIDE 23

Value noise 2D example

  • 5. Stack multiple layers on top of each other with varying zoom levels and weights
slide-24
SLIDE 24

Use case study: Generating the Milky Way galaxy in Elite Dangerous

slide-25
SLIDE 25

History of Elite

4 Elite games have been released over the years

slide-26
SLIDE 26

History of Elite

4 Elite games have been released over the years Pretty old for a video game franchise - first game released in 1984

slide-27
SLIDE 27

History of Elite

4 Elite games have been released over the years Pretty old for a video game franchise - first game released in 1984 The games are set in space, the player will engage in combat, exploration, trading, etc

slide-28
SLIDE 28

History of Elite

4 Elite games have been released over the years Pretty old for a video game franchise - first game released in 1984 The games are set in space, the player will engage in combat, exploration, trading, etc Both the older and the newer games feature a significant amount of procedural generation, especially in terms of game world generation

slide-29
SLIDE 29

Elite (1984)

Wireframe graphics with hidden line removal

slide-30
SLIDE 30

Elite (1984)

Wireframe graphics with hidden line removal 8 procedurally generated galaxies (developers wanted to go for 248 galaxies, but publisher refused)

slide-31
SLIDE 31

Elite (1984)

Wireframe graphics with hidden line removal 8 procedurally generated galaxies (developers wanted to go for 248 galaxies, but publisher refused) 256 star systems per galaxy

slide-32
SLIDE 32

Elite (1984)

Wireframe graphics with hidden line removal 8 procedurally generated galaxies (developers wanted to go for 248 galaxies, but publisher refused) 256 star systems per galaxy One planet and space station per system

slide-33
SLIDE 33

Elite (1984)

Wireframe graphics with hidden line removal 8 procedurally generated galaxies (developers wanted to go for 248 galaxies, but publisher refused) 256 star systems per galaxy One planet and space station per system Some issues with procedural star system and planet generation

slide-34
SLIDE 34

Frontier: Elite II (1993)

Procedurally generated and varied star systems Newtonian physics

slide-35
SLIDE 35

Frontier: Elite II (1993)

Procedurally generated and varied star systems Newtonian physics Seamless landing on planets

slide-36
SLIDE 36

Frontier: First Encounters (1995)

Procedural texturing (snow, plants, planet surfaces, etc.)

slide-37
SLIDE 37

Frontier: First Encounters (1995)

Procedural texturing (snow, plants, planet surfaces, etc.) Gouraud shading

slide-38
SLIDE 38

Elite: Dangerous (2014)

Released 30 years after the original

slide-39
SLIDE 39

Elite: Dangerous (2014)

Set in the 34th century when humanity has colonized other star systems in the galaxy

slide-40
SLIDE 40

Setting of Elite: Dangerous

The entire 1:1 scale Milky Way galaxy

slide-41
SLIDE 41

Setting of Elite: Dangerous

The entire 1:1 scale Milky Way galaxy 400 billion star systems spread across different structures in the galaxy

slide-42
SLIDE 42

Setting of Elite: Dangerous

The entire 1:1 scale Milky Way galaxy 400 billion star systems spread across different structures in the galaxy Nebulae, dust, all kinds of other objects

slide-43
SLIDE 43

Mass distribution in the galaxy

Astronomers have constructed a top-down view of the galaxy’s luminosity

slide-44
SLIDE 44

Mass distribution in the galaxy

Astronomers have constructed a top-down view of the galaxy’s luminosity Mass distribution is based on luminosity distribution

slide-45
SLIDE 45

Mass distribution in the galaxy

Astronomers have constructed a top-down (2D) view of the galaxy’s luminosity Mass distribution is derived from luminosity distribution That distribution is given a third dimension

slide-46
SLIDE 46

Sectors

Galaxy is divided into sectors (cubes) based on octrees (8 children per parent)

slide-47
SLIDE 47

Sectors

Galaxy is divided into sectors (cubes) based on octrees (8 children per parent) 8 layers of these cubes - linear dimensions from 10ly to 1280ly

slide-48
SLIDE 48

Sectors

Galaxy is divided into sectors (cubes) based on octrees (8 children per parent) 8 layers of these cubes - linear dimensions from 10ly to 1280ly Child sectors inherit information from parent sectors

slide-49
SLIDE 49

Sectors

Galaxy is divided into sectors (cubes) based on octrees (8 children per parent) 8 layers of these cubes - linear dimensions from 10ly to 1280ly Child sectors inherit information from parent sectors Bigger sectors are used to generate more rare systems (e.g primary neutron star)

slide-50
SLIDE 50

Sectors

Galaxy is divided into sectors (cubes) based on octrees (8 children per parent) 8 layers of these cubes - linear dimensions from 10ly to 1280ly Child sectors inherit information from parent sectors Bigger sectors are used to generate more rare systems (e.g primary neutron star) Smaller are used to generate more common systems (e.g. primary red dwarf)

slide-51
SLIDE 51

Sectors

Galaxy is divided into sectors (cubes) based on octrees (8 children per parent) 8 layers of these cubes - linear dimensions from 10ly to 1280ly Child sectors inherit information from parent sectors Bigger sectors are used to generate more rare systems (e.g primary neutron star) Smaller are used to generate more common systems (e.g. primary red dwarf) Generation happens until sector has run out of allocated mass or number space

slide-52
SLIDE 52

Sectors

Galaxy is divided into sectors (cubes) based on octrees (8 children per parent) 8 layers of these cubes - linear dimensions from 10ly to 1280ly Child sectors inherit information from parent sectors Bigger sectors are used to generate more rare systems (e.g primary neutron star) Smaller are used to generate more common systems (e.g. primary red dwarf) Generation happens until sector has run out of allocated mass or number space Sectors have attributes like mass, metallicity, type and age

slide-53
SLIDE 53

Generating the primary star of a system

Lots of different attributes - e.g. metallicity, magnitude, position in the sector, radius, initial and final mass, existence of a planetary nebula, surface temperature, classification

slide-54
SLIDE 54

Star color

Black body radiation

slide-55
SLIDE 55

Evolution of a star

Different stages of a star’s life are simulated - proto-star, main sequence, giant, death (stellar remnants) Star evolution depends on the initial mass of the star

slide-56
SLIDE 56

Star system generation

slide-57
SLIDE 57

Creating the rest of the star system

Generate the main bodies (stars) by simulating collapse of gas

slide-58
SLIDE 58

Creating the rest of the star system

Generate the main bodies (stars) by simulating collapse of gas Generate a protoplanetary disk from the remaining mass (elemental distribution)

slide-59
SLIDE 59

Creating the rest of the star system

Generate the main bodies (stars) by simulating collapse of gas Generate a protoplanetary disk from the remaining mass (elemental distribution) Simulate clumping in stable orbits around the star

slide-60
SLIDE 60

Creating the rest of the star system

Generate the main bodies (stars) by simulating collapse of gas Generate a protoplanetary disk from the remaining mass (elemental distribution) Simulate clumping in stable orbits around the star Step through time

slide-61
SLIDE 61

Stepping through time

A lot of physics simulation going on:

  • Gravitational clumping
slide-62
SLIDE 62

Stepping through time

A lot of physics simulation going on:

  • Gravitational clumping
  • Gravitational heating
slide-63
SLIDE 63

Stepping through time

A lot of physics simulation going on:

  • Gravitational clumping
  • Gravitational heating
  • Moon / ring formation around clumps of mass
slide-64
SLIDE 64

Stepping through time

A lot of physics simulation going on:

  • Gravitational clumping
  • Gravitational heating
  • Moon / ring formation around clumps of mass
  • Mass erosion from radiation pressure
slide-65
SLIDE 65

Stepping through time

A lot of physics simulation going on:

  • Gravitational clumping
  • Gravitational heating
  • Moon / ring formation around clumps of mass
  • Mass erosion from radiation pressure
  • Special events
slide-66
SLIDE 66

Stepping through time

Identifying the resulting clumps of mass:

  • Gas giant vs brown dwarf vs star
slide-67
SLIDE 67

Stepping through time

Identifying the resulting clumps of mass:

  • Gas giant vs brown dwarf vs star
  • Chemical composition - icy, rocky, metallic planets
slide-68
SLIDE 68

Stepping through time

Identifying the resulting clumps of mass:

  • Gas giant vs brown dwarf vs star
  • Chemical composition - icy, rocky, metallic planets
  • Tidal heating, tidal locking
slide-69
SLIDE 69

Stepping through time

Identifying the resulting clumps of mass:

  • Gas giant vs brown dwarf vs star
  • Chemical composition - icy, rocky, metallic planets
  • Tidal heating, tidal locking
  • Tectonics, volcanism, atmosphere
slide-70
SLIDE 70

Unique ID of an astronomical object

slide-71
SLIDE 71

Nebulae

Based on 3D volume textures for density

slide-72
SLIDE 72

Nebulae

Based on 3D volume textures for density 1D RGB texture to define density to light absorption relationship

slide-73
SLIDE 73

Nebulae

Based on 3D volume textures for density 1D RGB texture to define density to light absorption relationship Step through while subtracting colors

slide-74
SLIDE 74

Planet surfaces

Non-landable planets - perfect spheres with normal-mapped surfaces

slide-75
SLIDE 75

Planet surfaces

Landable planets - start out as cubes, subdivision is used to enhance resolution the closer the player gets, terrain is based on layered noise

slide-76
SLIDE 76

Planet surfaces

slide-77
SLIDE 77

Combining procedurally generated with real

The galaxy in Elite: Dangerous also contains thousands of real stars, nebulae and

  • ther objects from stellar catalogs
slide-78
SLIDE 78

Galaxy map

When moving around in the in-game galaxy map, star system information is generated and displayed on the fly around the focused area

slide-79
SLIDE 79

Galaxy map

When moving around in the in-game galaxy map, star system information is generated and displayed on the fly around the focused area The radius of generation in the galaxy map is dependent on the star density of the focused area

slide-80
SLIDE 80
slide-81
SLIDE 81
slide-82
SLIDE 82
slide-83
SLIDE 83

Thank you!