Top Banner
A Procedural Balanced Map Generator with Self-Adaptive Complexity for the Real-Time Strategy Game Planet Wars Ra´ ul Lara-Cabrera, Carlos Cotta, Antonio J. Fern´ andez-Leiva Dept. Lenguajes y Ciencias de la Computaci´on, University of M´ alaga, SPAIN http://anyself.wordpress.com http://dnemesis.lcc.uma.es
18

Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Jul 07, 2015

Download

Technology

Carlos Cotta

Paper presented at EvoGAMES 2013 (held within EvoStar 2013 in Vienna, Austria).

Procedural content generation (PCG) is the programmatic generation of game content using a random or pseudo-random process that results in an unpredictable range of possible gameplay spaces. This methodology brings many advantages to game developers, such as reduced memory consumption. This works presents a procedural balanced map generator for a real-time strategy game: Planet Wars. This generator uses an evolutionary strategy for generating and evolving maps and a tournament system for evaluating the quality of these maps in terms of their balance. We have run several experiments obtaining a set of playable and balanced maps
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

A Procedural Balanced Map Generator with Self-AdaptiveComplexity for the Real-Time Strategy Game Planet Wars

Raul Lara-Cabrera,Carlos Cotta,

Antonio J. Fernandez-Leiva

Dept. Lenguajes y Ciencias de laComputacion, University of Malaga,

SPAIN

http://anyself.wordpress.comhttp://dnemesis.lcc.uma.es

Page 2: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Introduction

Procedural Content Generation

� Creating game content automatically, through algorithmic means.

� Maps, levels, dialogues, characters, rule-sets, weapons...

Benefits

� Reduced memory consumption

� Saving in the expense of manually creating game content

� Endless or infinite games

2 / 16

Page 3: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

PCG in the game industry

Borderlands (Gearbox, 2009)

Uses a PCG system to createweapons, enemies and itemswith different properties.

Minecraft (Mojang, 2011)

Sandbox-building game with aninfinite map which is expandeddynamically.

3 / 16

Page 4: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Planet Wars

� Real-time strategy (RTS) game based on Galcon and used in theGoogle AI Challenge 2010

� Its objective is to take over all the planets on the map or eliminateall of your opponents ships

4 / 16

Page 5: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Aims and Scope

1st Goal – Content GenerationUse an evolutionary algorithm to design maps for Planet Wars leadingto balanced games.

Balance is used here as a proxy for attractiveness. Balanced games:

� are more interesting for all kind of players

� increase the motivation of players

� increase the duration of the game

2nd Goal – Self-Adaptation

Explore self-adaptation at different levels in this context.

5 / 16

Page 6: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Maps

� Maps are plain text files

� Each line represents aplanet

� Planet’s attributes:� X and Y position� Size (growth rate)� Initial number of ships� Owner

6 / 16

Page 7: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Individuals

...

Planet

x (real)y (real)size (integer)number of ships (integer)

x,y mutation steps (real)size, ships mutation steps (real)

Array of planets (variable length)

7 / 16

Page 8: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Objective function

fitness =

(1

Nm

Nm∑i=1

Ki · tiPi + Si + 1

)2

Nm = number of matches

Ki = percentage of occupied planets

ti = number of turns

Pi =

∑tij=1

∣∣∣P(1)ij − P

(2)ij

∣∣∣ti

, (difference between number of planets)

Si =

∑tij=1

∣∣∣S (1)ij − S

(2)ij

∣∣∣ti

, (difference between number of ships)

8 / 16

Page 9: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Objective function

fitness =

(1

Nm

Nm∑i=1

Ki · tiPi + Si + 1

)2

Nm = number of matches

Ki = percentage of occupied planets

ti = number of turns

Pi =

∑tij=1

∣∣∣P(1)ij − P

(2)ij

∣∣∣ti

, (difference between number of planets)

Si =

∑tij=1

∣∣∣S (1)ij − S

(2)ij

∣∣∣ti

, (difference between number of ships)

8 / 16

Page 10: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Objective function

fitness =

(1

Nm

Nm∑i=1

Ki · tiPi + Si + 1

)2

Nm = number of matches

Ki = percentage of occupied planets

ti = number of turns

Pi =

∑tij=1

∣∣∣P(1)ij − P

(2)ij

∣∣∣ti

, (difference between number of planets)

Si =

∑tij=1

∣∣∣S (1)ij − S

(2)ij

∣∣∣ti

, (difference between number of ships)

8 / 16

Page 11: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Breeding mechanism

Mutation

� Gaussian perturbation (real)

σ′i = σi · eτ′·N(0,1)+τ ·Ni (0,1)

x ′i = xi + σi · Ni (0, 1)

� Geometrically distributed perturbation (integers)

ς′i = max(1, ςi · eτ ·N(0,1)+τ ′·N(0,1))

ψi = 1 − (ς′i /m)

1 +

√1 +

(ς′im

)2−1

z ′i = zi +

⌊ln(1 − U(0, 1))

ln(1 − ψi )

⌋−⌊ln(1 − U(0, 1))

ln(1 − ψi )

9 / 16

Page 12: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Breeding mechanism

Recombination

� “cut and splice”

Other parameters

� (µ+ λ) generational scheme with µ = 10 and λ = 100

� Binary tournament selection

10 / 16

Page 13: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Experiments

� Two experiments (10 executions each):� ES with self-adapting strategy for mutation steps and genome length� ES with self-adapting strategy for mutation steps and fixed genome

length (23 planets)

� 100 generations each execution

� Maximum game length: 400 turns� Evaluation: three bots and three matches on each map

� Google AI Challenge 2010 participants� Ranked in the top 100 out of 4600� Having their source code available

11 / 16

Page 14: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Results: fitness

0

50000

100000

150000

0 2500 5000 7500 10000evaluations

fitne

ss

12 / 16

Page 15: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Results: individual size

16

18

20

22

24

26

0 2500 5000 7500 10000evaluations

best

indi

vidu

al s

ize

13 / 16

Page 16: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Results: maps

14 / 16

Page 17: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Conclusions

� We have introduced a simple procedural map generator for a RTSgame that is capable of generating balanced maps for two playergames

� The algorithm with self-adapted number of planets has a betterperformance than the algorithm with this value fixed

� High balanced maps tend to have around 17 planets� Future work:

� Interactivity� Pro-activity� Deal with other maps’ features, such as dynamism and aesthetics

15 / 16

Page 18: Evolving Balanced Maps for Planet Wars Using Self-Adaptive EAs

Thanks for your attention!

AnySelf Project

Please find us in Facebook

http://facebook.com/AnySelfProject

and in Twitter

@anyselfproject

16 / 16