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
Reminders • Progress self-check indicator: • Your progress is good is you have: • Project 1 completed. • You have a working drama manager (or whatever is that you are building in project 2) (even if it’s not perfect) • Progress self-check indicator (next week): • Your progress is good is you have: • Project 1 completed. • Project 2 completed
Outline • Student Presentation: “From Abstraction to Reality: Integrating Drama Management into a Playable Game Experience” • Student Presentation: “Computational Approaches to Storytelling and Creativity” • Student Presentation: “STORYEVAL: An Empirical Evaluation Framework for Narrative Generation” • Introduction to Procedural Content Generation • Constructive Methods for PCG • (Brief Introduction to Hill-Climbing algorithms) • Search-based PCG • Project 3 • Project Discussion
Outline • Student Presentation: “From Abstraction to Reality: Integrating Drama Management into a Playable Game Experience” • Student Presentation: “Computational Approaches to Storytelling and Creativity” • Student Presentation: “STORYEVAL: An Empirical Evaluation Framework for Narrative Generation” • Introduction to Procedural Content Generation • Constructive Methods for PCG • (Brief Introduction to Hill-Climbing algorithms) • Search-based PCG • Project 3 • Project Discussion
Procedural Content Generation • Procedural content generation (PCG): creation game content automatically , through algorithmic means. • Game content: • Maps • Items • Plot / story • Game play • Dialogue • etc.
Procedural Content Generation • Procedural content generation (PCG): creation game content automatically , through algorithmic means. • Game content: • Maps • Items Next week • Plot / story • Game play • Dialogue • etc.
Example: Maps in Civilization IV
Why Procedural Content Generation? • In early games: space saving • Games using PCG do not have to save map data to disk • Early games ran in old computers with little memory to spare • In modern games: • Makes the creation of large worlds possible: • Skyrim / Starwars Galaxies, etc. would be impossible (prohibitive cost) without PCG • New gameplay possibilities based on PCG: • Roguelikes • Spore • Galactic Arms Race
Star Wars Galaxies
Skyrim (also Oblivion, Daggerfall)
S.T.A.L.K.E.R.
Spore
Darwinia • http://www.introversion.co.uk/darwiniaplus/
Murder!
Nethack (and other roguelikes)
Infinite Mario • http://www.supermariobrothers.org/infinite-mario.html
Galactic Arms Race
Procedural Content Generation • Expand content from a “ short description ” to an “ expanded description ” • E.g for Skyrim: • Short description: parameters that define a tree (size, amount of snow, type of leaves, color, health, etc.). A few bytes (1KByte at most) • Expanded description: tree mesh. Several MegaBytes. • Depending of the nature of the “short description”, or the procedure with which it is expanded, there are many families of PCG methods.
Classification of PCG Techniques When is Degrees of PCG Content Determinism Technique control performed? Purely Online Optional Stochastic Constructive random Control Generate & Offline Necessary Deterministic vector Test Togelius, Yannakakis, Stanley, Browne (2011)
Classification of PCG Techniques Executed during When is the game: Degrees of PCG Content Determinism Technique Must be fast and control performed? reliable Purely Online Optional Stochastic Constructive Executed during random game design: Maybe slower, and less need for strong Control Generate & Offline Necessary Deterministic reliability vector Test
Classification of PCG Techniques Content generated is only an “add-on” When is of the game. Not Degrees of PCG Content Determinism Technique important if it’s control performed? flawed Purely Online Optional Stochastic Constructive random Content generated is the core of the game: main map, Control Generate & main plot, etc. Offline Necessary Deterministic vector Test Must be flawless
Classification of PCG Techniques Only way to control When is Degrees of outcome is through PCG Content Determinism Technique control the random seed performed? (no “short description”) Purely Online Optional Stochastic Constructive random PCG expands a “short description” with which the Control Generate & Offline Necessary Deterministic game designer has vector Test control of the outcome
Classification of PCG Techniques When is Degrees of PCG Content Determinism Technique control Outcome is performed? unpredictable Purely Online Optional Stochastic Constructive random Given same input, algorithm always Control Deterministi Generate & Offline Necessary provides the same vector c Test output
Classification of PCG Techniques When is Degrees of Algorithm designed PCG Content Determinism Technique control in such a way that the performed? outcome always achieves the desired Purely effect Online Optional Stochastic Constructive random Given an “ evaluation Control Generate & function ”, the Offline Necessary Deterministic vector Test algorithm generates candidates until one satisfies the function
Constructive vs Generate & Test • Constructive algorithms: • Task-specific • Typically, they are “tricks” • Require a lot of fine tuning • Generate & Test: • AI-like • Evaluation function defines what are we looking for • A search algorithm (e.g. Hill-climbing) used to search an individual satisfying (maximizing) the evaluation function • Generic
Outline • Student Presentation: “From Abstraction to Reality: Integrating Drama Management into a Playable Game Experience” • Student Presentation: “Computational Approaches to Storytelling and Creativity” • Student Presentation: “STORYEVAL: An Empirical Evaluation Framework for Narrative Generation” • Introduction to Procedural Content Generation • Constructive Methods for PCG • (Brief Introduction to Hill-Climbing algorithms) • Search-based PCG • Project 3 • Project Discussion
Constructive Approaches to PCG • Typically application specific • Most common are map-generation approaches • Some generic families of techniques that have been shown to work for many applications: • Statistical approaches • Simulation-based approaches • Grammar approaches
Examples of Constructive Approaches • Application Specific • Statistical approaches • Simulation-based approaches
Example: Application Specific Method • House-blueprint generation for Zelda-like games • Input parameters: • Size of the grid (e.g. 32x32) • Number of rooms of each tipe (bedrooms, living rooms, etc.) • Output: • Full floor plan of a house for direct use in a game • Assumptions: • Rooms are rectangles
Example: Application Specific Method • Step 1: Generate random rectangles
Example: Application Specific Method • Step 2: Push them away enough for avoiding collisions
Example: Application Specific Method • Step 3: Assign the role of each one (at random) Living room Kitchen Bedroom Bedroom
Example: Application Specific Method • Step 4: Make sure all rooms are reachable from a living room (create doors) Living room Kitchen Bedroom Bedroom
Example: Application Specific Method • Step 5: Create one or several outside doors Living room Kitchen Bedroom Bedroom
Example: Application Specific Method • Step 6: Add furniture (each room type has a different probability of have different pieces of furniture) Shelves Stove Living room Kitchen Table Bed Bed Bedroom Bedroom Chair
Example: Application Specific Method • Step 7: Render the house
Example: Application Specific Method • Step 7: Render the house
Application Specific Methods • They work • They need a lot of fine tuning: • In the example: how many pieces of furniture per room • They do not generalize to any other application • Very common in games (because they work, and can be fine tuned to generate exactly what we want, and the way we want)
Examples of Constructive Approaches • Application Specific • Statistical approaches • Simulation-based approaches
Example: Statistical Approaches • Name generation • Application: large games with lots of NPCs/items require the game designer to give a name each of them. Time consuming. • Approach: • Model the statistical properties of a given language • Generate random words that have the same statistical properties as the given language
Recommend
More recommend