Artificial Intelligence in Game Design Content Generation.

19
Artificial Intelligence in Game Design Content Generation

Transcript of Artificial Intelligence in Game Design Content Generation.

Page 1: Artificial Intelligence in Game Design Content Generation.

Artificial Intelligence in Game Design

Content Generation

Page 2: Artificial Intelligence in Game Design Content Generation.

Content Generation

• Creating world for game– Terrain for battle games– Levels for shooters– Tracks for racing games …

• Most expensive part of development!

• Goal: Generate content automatically– Cheaper, faster– Infinite replayability

Page 3: Artificial Intelligence in Game Design Content Generation.

Terrain Maps

• Most commonly applied to terrain maps in civilization games

Goals (possibly contradictory):• “Realistic” appearing terrain

– Continents, islands, mountains, beaches, deserts, etc.

• “Fair” to all players– Equal amounts of resources, water, and

flat areas for building cities near initial position for each player

Page 4: Artificial Intelligence in Game Design Content Generation.

Land Mass Generation

One method: • Grow “land clumps” from each player location

– Initial “territory” each player given chance to expand into before running into other players

Page 5: Artificial Intelligence in Game Design Content Generation.

Land Mass Generation

• Each iteration grows clump by 1 tile– After given number of tiles, rest of map becomes “water”

• Chosen randomly from tiles adjacent to existing clump– Must not be part of another player’s clump

• Evaluated using “fitness” criteria • Nearness to initial player position

• Number of adjacent tiles already part of player’s clump

• Distance from other player’s clumps

– If tile fails, choose another– Goal: avoid “peninsulas”

P1P1

P1P1P1

P1

P1

P1 P1

P1

P1

Page 6: Artificial Intelligence in Game Design Content Generation.

Island Map Generation

• Each player initially given separate island– Can be built like land clumps– Additional criteria:

New land tiles for player not allowed within some distance of tiles for other players (keep islands separated)

– Additional islands can be generated in empty spaces after player islands created

Page 7: Artificial Intelligence in Game Design Content Generation.

Terrain Generation

• Creating “realistic” looking map of land masses• Generally height based

– Defining h(x, y) for points on the map

– Low at beaches– High in mountains– Flat areas for city

development– …

Page 8: Artificial Intelligence in Game Design Content Generation.

Fractals

• Shapes which appear the same at any scale (self-similar)

• Based on some “variance” applied at each level of detail– Modify area by some variance v– Subdivide into sub areas

– Higher v more “jagged” look

Page 9: Artificial Intelligence in Game Design Content Generation.

Fractals• One dimensional example:

– Start wi th line:

– Vary height of center of line by random value between –v and v:

– Vary height of center of each segment by –v/2 and v/2:

Page 10: Artificial Intelligence in Game Design Content Generation.

Fractals• One dimensional example:

– Vary height of center of each segment by –v/4 and v/4:

– And so on, until have as much detail as necessary

Page 11: Artificial Intelligence in Game Design Content Generation.

Fractals

• Create “random” terrain by doing this in two dimensions

Page 12: Artificial Intelligence in Game Design Content Generation.

Adding Detail

• Smoothing used to level out terrain in areas that should be flat– Beaches at interface of land/water tiles– Flat areas designed to allow players to build cities, etc.

• Done by averaging heights in “flat” areas

Page 13: Artificial Intelligence in Game Design Content Generation.

Adding Detail

• Create mountains in non-flat areas– Choose a location and increase its height– Use averaging to affect height of nearby locations (foothills)– Use wander behavior to create a mountain range over a certain

distance

Page 14: Artificial Intelligence in Game Design Content Generation.

Adding Details

• Create rivers as paths from mountains to ocean– Choose random point on coast– Seek nearest point at base of a mountain– Add wander to avoid a straight line

Page 15: Artificial Intelligence in Game Design Content Generation.

Resource Distribution

• Must make sure resources are distributed fairly among all players– Gold, oil, uranium, etc.– Land on which structures can be built

• Goals:– Each player should have same amount of resources available at

any stage of game (depending on amount of territory captured)– Players should be encouraged to explore increasingly further

from their initial position

Page 16: Artificial Intelligence in Game Design Content Generation.

Resource Distribution

• Generate rings around player initial position• Randomly place r resources within each ring

– r increases with each ring

P1R

R

R

R

R

RR

R

R

R

P2

R

R

R

R

R

R

R

R

RR

Page 17: Artificial Intelligence in Game Design Content Generation.

Generate and Test

• Generate level content in some random way

• Evaluate that content– How playable/fun/challenging is it?– Is the level of difficulty appropriate for that point in game?

• Modify that content– Change features that are not appropriate

Page 18: Artificial Intelligence in Game Design Content Generation.

Track Generation

• Track generated as sequence of randomly generated spline curves

• AI driver used to evaluate the difficulty level track– Overall time to drive the track– Variation in speed needed to drive the

track

• Individual spline curvatures modified for track sections which vary from the rest of the level

Page 19: Artificial Intelligence in Game Design Content Generation.

Mario Level Generation

• Two-dimensional level generated– Pits, coins, enemies, etc.

• Evaluated by human players– Fun: time moving right, enemies stomped, etc– Frustration: time standing still, falls into pits, etc.