CS 680: GAME AI
WEEK 7: PROCEDURAL CONTENT GENERATION
2/27/2012 Santiago Ontañón santi@cs.drexel.edu https://www.cs.drexel.edu/~santi/teaching/2012/CS680/intro.html
CS 680: GAME AI WEEK 7: PROCEDURAL CONTENT GENERATION 2/27/2012 - - PowerPoint PPT Presentation
CS 680: GAME AI WEEK 7: PROCEDURAL CONTENT GENERATION 2/27/2012 Santiago Ontan santi@cs.drexel.edu https://www.cs.drexel.edu/~santi/teaching/2012/CS680/intro.html Reminders Progress self-check indicator: Your progress is good is
2/27/2012 Santiago Ontañón santi@cs.drexel.edu https://www.cs.drexel.edu/~santi/teaching/2012/CS680/intro.html
building in project 2) (even if it’s not perfect)
“From Abstraction to Reality: Integrating Drama Management into a Playable Game Experience”
“Computational Approaches to Storytelling and Creativity”
“STORYEVAL: An Empirical Evaluation Framework for Narrative Generation”
“From Abstraction to Reality: Integrating Drama Management into a Playable Game Experience”
“Computational Approaches to Storytelling and Creativity”
“STORYEVAL: An Empirical Evaluation Framework for Narrative Generation”
content automatically, through algorithmic means.
content automatically, through algorithmic means.
Next week
without PCG
“expanded description”
type of leaves, color, health, etc.). A few bytes (1KByte at most)
procedure with which it is expanded, there are many families of PCG methods.
When is PCG performed? Content Degrees of control Determinism Technique Online Optional Purely random Stochastic Constructive Offline Necessary Control vector Deterministic Generate & Test Togelius, Yannakakis, Stanley, Browne (2011)
When is PCG performed? Content Degrees of control Determinism Technique Online Optional Purely random Stochastic Constructive Offline Necessary Control vector Deterministic Generate & Test Executed during the game: Must be fast and reliable Executed during game design: Maybe slower, and less need for strong reliability
When is PCG performed? Content Degrees of control Determinism Technique Online Optional Purely random Stochastic Constructive Offline Necessary Control vector Deterministic Generate & Test Content generated is only an “add-on”
important if it’s flawed Content generated is the core of the game: main map, main plot, etc. Must be flawless
When is PCG performed? Content Degrees of control Determinism Technique Online Optional Purely random Stochastic Constructive Offline Necessary Control vector Deterministic Generate & Test Only way to control
the random seed (no “short description”) PCG expands a “short description” with which the game designer has control of the
When is PCG performed? Content Degrees of control Determinism Technique Online Optional Purely random Stochastic Constructive Offline Necessary Control vector Deterministi c Generate & Test Outcome is unpredictable Given same input, algorithm always provides the same
When is PCG performed? Content Degrees of control Determinism Technique Online Optional Purely random Stochastic Constructive Offline Necessary Control vector Deterministic Generate & Test Algorithm designed in such a way that the
achieves the desired effect Given an “evaluation function”, the algorithm generates candidates until one satisfies the function
satisfying (maximizing) the evaluation function
“From Abstraction to Reality: Integrating Drama Management into a Playable Game Experience”
“Computational Approaches to Storytelling and Creativity”
“STORYEVAL: An Empirical Evaluation Framework for Narrative Generation”
shown to work for many applications:
Living room Bedroom Bedroom Kitchen
room (create doors)
Living room Bedroom Bedroom Kitchen
Living room Bedroom Bedroom Kitchen
probability of have different pieces of furniture)
Living room Bedroom Bedroom Kitchen Table Shelves Stove Bed Bed Chair
fine tuned to generate exactly what we want, and the way we want)
the game designer to give a name each of them. Time consuming.
as the given language
like
language:
time of the evasion?—what it was he'd planned to do if the evasion worked all right and he managed to set a nigger free that was already free before? And he said, what he had planned in his head from the start, if we got Jim out all safe, was for us to run him down the river on the raft, and have adventures plumb to the mouth of the river, and then tell him about his being free, and take him back up home on a steamboat, in style, and pay him for his lost time, and write word ahead and get out all the niggers around, and have them waltz him into town with a torchlight procession and a brass-band, and then he would be a hero, and so would we. But I reckoned it was about as well the way it
T H E F I R S T P(letter | previous letter)
2 a b c d … x y z a 759 927 1547 37 2296 1 3297 b 541 105 435 147 c 1144 63 9 78 d 564 9 4 178 15108 … … x 26 28 30 104 y 77 253 1 5896 z 2 55 19 8 78 15187 5317 36105 1630 37 2296 1 28597
do the following:
With English Corpus: Weng Outood Wasel Tehe Botowacout Eangis Wand Heno Bemit With Spanish Corpus: Favo Destel Biscile Cótano Taló Lubía Akete Antriliden Dichado With Chinese Corpus: Yuìn Hòhéngjībì Jīng Xùgshuì Zhuán Sǎngzhò Dùyón Pádén Mǐlì
letters)
samples, and selecting only the ones that satisfy restrictions (Generate & Test)
through which that content would have been generated in the real world
known, e.g. based on fractals)
natural
diamond diamond square square
diamond diamond square square Average of the outer 4 dots +random noise
diamond diamond square square Average of the 3 (4) neighbors +random noise
[Olsen, 2004]
games, e.g. Galaxies in Masters of Orion 3
“From Abstraction to Reality: Integrating Drama Management into a Playable Game Experience”
“Computational Approaches to Storytelling and Creativity”
“STORYEVAL: An Empirical Evaluation Framework for Narrative Generation”
goal
function
the current value of h(s)
Current state
Current state neighbors
Current state
Current state
Problem
to alleviate this)
“From Abstraction to Reality: Integrating Drama Management into a Playable Game Experience”
“Computational Approaches to Storytelling and Creativity”
“STORYEVAL: An Empirical Evaluation Framework for Narrative Generation”
Unreliable Constructive Method Correctness Verification Search Method Evaluation Function
Unreliable Constructive Method Correctness Verification Search Method Evaluation Function For example: verify that a path exists from the start to the goal
evaluation function guides the search towards a complete design
improves them bit by bit, guided by the evaluation function
(maps, plots, quests, etc.)
a)
A candidate that satisfied a minimum criteria of quality is found
b)
After some fixed amount of search (returning the best individual found so far)
a)
Evaluating only complete designs, and measuring how good they are (suitable for hill-climbing algorithms, like GAs)
b)
Evaluating partial designs, and measuring how close are they to completion (suitable for heuristic search algorithms, like A*)
“designs”
possible storylines a game could have!)
rectangular rooms that fit in a 32x32 grid.
abstraction
1.
No abstraction: representation is the content of each map cell
2.
Some abstraction: representation of walls, size of walls, and
3.
More abstraction: set of parameters characterizing a map (number of rooms, corridors, etc.)
Design Space Search
Design Space Search Every point in the design space is an “abstracted map” that corresponds to exactly
Design Space Search The mapping between “abstracted map” and “actual map” should be deterministic. If it’s not, at least all the “actual maps” resulting from an “abstracted map” must have same or nearly identical evaluation Otherwise, the evaluation function will not be useful for the search algorithm.
encoded with it
evaluation function values (for Hill Climbing algorithms)
good
we from finding a complete design
how good is the design.
finished.
designs
[Togelius, Preuss, Yanakakis 2010]
simulation-based measures:
another
for any player
bases to others overlap
functions
When is PCG performed? Content Degrees of control Determinism Technique Online Optional Purely random Stochastic Constructive Offline Necessary Control vector Deterministic Generate & Test Control vector here is the number of bases, resources and mountain formations desired
[Hastings, Guha, Stanley 2010]
When is PCG performed? Content Degrees of control Determinism Technique Online Optional Purely random Stochastic Constructive Offline Necessary Control vector Deterministic Generate & Test
whereas constructive methods would only generate what they were designed to generate
week)
“From Abstraction to Reality: Integrating Drama Management into a Playable Game Experience”
“Computational Approaches to Storytelling and Creativity”
“STORYEVAL: An Empirical Evaluation Framework for Narrative Generation”
generation techniques to a game engine.
game engines we have used for projects 1 or 2: Starcraft, S3 or GraphicIFEngine
the system to generate maps/rooms/story
procedurally generated:
layouts for the mansion. Constraints: there is a set of objects that must be there
generate the outside map (mansion, bar, etc.) stay the same
techniques to generate new maps
generate a new kind of unit/building in S3
balance of power between the different units in S3 (hitpoints, damage, speed, etc.)
generate optional sub-plots in the game
“From Abstraction to Reality: Integrating Drama Management into a Playable Game Experience”
“Computational Approaches to Storytelling and Creativity”
“STORYEVAL: An Empirical Evaluation Framework for Narrative Generation”