CS 387: GAME AI PROCEDURAL CONTENT GENERATION

Similar documents
Algorithms. How data is processed. Popescu

Expository/ Informational. Non-Fiction. Organizational Aids: Bold print, Bullets, Headings, Captions, Italics, etc.

Step 1: Prepare To Use the System

STAR Student Test Questions The Little Pine Tree

Structures of Life. Investigation 1: Origin of Seeds. Big Question: 3 rd Science Notebook. Name:

TOUCH IOT WITH SAP LEONARDO

TEACHER NOTES MATH NSPIRED

CLASSROOM NEWS Week of January 23, 2017! jmccool3rdgrade.weebly.com! (302)

Folk Literature..And Academic Vocabulary

The jar of salad cream

Planning: Regression Planning

Apples. Where Did Apples Come From?

Grade 3 Reading Practice Test

Activity 10. Coffee Break. Introduction. Equipment Required. Collecting the Data

Feeling Hungry. How many cookies were on the plate before anyone started feeling hungry? Feeling Hungry. 1 of 10

Predicting Wine Quality

Allergies and Intolerances Policy

Were the Aztecs really that brutal? Basic Introduction to the Aztecs. The Aztecs

olives from calabria with love

A BOOK DISCUSSION Guide

Guidelines for Submitting a Hazard Analysis Critical Control Point (HACCP) Plan

Concept: Multiplying Fractions

NVIVO 10 WORKSHOP. Hui Bian Office for Faculty Excellence BY HUI BIAN

Welcome to the Play it Safe campaign pack

Honeybees Late Fall Check

Managing Multiple Ontologies in Protégé

Name Date. Materials 1. Calculator 2. Colored pencils (optional) 3. Graph paper (optional) 4. Microsoft Excel (optional)

Let Me Eat Cake: A Celebration Of Flour, Sugar, Butter, Eggs, Vanilla, Baking Powder, And A Pinch Of Salt By Leslie F. Miller READ ONLINE

EMC Publishing s C est à toi! 3, 2E Correlated to the Colorado World Language Frameworks French 3

The Path to a Longer, Healthier Life

Esri Demographic Data Release Notes: Israel

Simulation of the Frequency Domain Reflectometer in ADS

Reaction to the coffee crisis at the beginning of last decade

Mini Project 3: Fermentation, Due Monday, October 29. For this Mini Project, please make sure you hand in the following, and only the following:

Jure Leskovec, Computer Science Dept., Stanford

BLACK COFFEE BY AGATHA CHRISTIE DOWNLOAD EBOOK : BLACK COFFEE BY AGATHA CHRISTIE PDF

ARM4 Advances: Genetic Algorithm Improvements. Ed Downs & Gianluca Paganoni

Seriously, CELIAC. talk.

FREQUENTLY ASKED QUESTIONS (FAQS)

Social Media: Content Drives Community Groups

Pevzner P., Tesler G. PNAS 2003;100: Copyright 2003, The National Academy of Sciences

Roya Survey Developers Bil Doyle Brad Johns Greg Johnson Robin McNal y Kirsti Wal Graduate Consultant Mohammad Sajib Al Seraj Avinash Subramanian

You know what you like, but what about everyone else? A Case study on Incomplete Block Segmentation of white-bread consumers.

Noun-Verb Decomposition

Caffeine And Reaction Rates

Title: Farmers Growing Connections (anytime in the year)

The Definitive Guide to Crushing ICOs

Our Favorite Breakfast & Brunch Recipes Cookbook (Our Favorite Recipes Collection)

MUMmer 2.0. Original implementation required large amounts of memory

Name: Monitor Comprehension. The Big Interview

Analysis of Things (AoT)

MacKillop Catholic College Allergy Awareness and Management Policy

5 Populations Estimating Animal Populations by Using the Mark-Recapture Method

Which of your fingernails comes closest to 1 cm in width? What is the length between your thumb tip and extended index finger tip? If no, why not?

DEVELOPING PROBLEM-SOLVING ABILITIES FOR MIDDLE SCHOOL STUDENTS

A Story That Stirred Up Anger

Learning Connectivity Networks from High-Dimensional Point Processes

Proposal for Instruction Manual/Feasibility Study /Rewrite of Manual on Starbucks Barista Espresso Machine

Biologist at Work! Experiment: Width across knuckles of: left hand. cm... right hand. cm. Analysis: Decision: /13 cm. Name

Score / Name: P: CHAPTER 1 BELLWORK

N e w Yo r k C i t y / N YS T L C ata lo g for FAMIS purchases

Lesson 3. Activity 3. Caffeine Check (15 mins) Bump Out / Caffeine Check. The Punchline! Key Messages. Objectives. Preparation. Level 2.

Read & Download (PDF Kindle) American Heart Association Low-Fat, Low-Cholesterol Cookbook, 3rd Edition: Delicious Recipes To Help Lower Your

Read & Download (PDF Kindle) American Heart Association Low-Fat, Low-Cholesterol Cookbook

Royal Holiday Bride (Reigning Men)

Napa County Planning Commission Board Agenda Letter

Girl Guides of Canada Cookie Challenge. Guides

Introduction to Measurement and Error Analysis: Measuring the Density of a Solution

World s finest beer s are From Belgium WORLDS MOST ADVANCE BREWERY EQUIPMENTS. Shivsu Canada Pure Fillers

QUICK SERVE RESTAURANT MANAGEMENT SERIES EVENT PARTICIPANT INSTRUCTIONS

1 What s your favourite type of cake? What ingredients do you need to make a cake? Make a list. 3 Listen, look and sing Let s go shopping!

Fractions with Frosting

Lecture 9: Tuesday, February 10, 2015

ARTIFACT A ARTIFACT B

learning goals ARe YoU ReAdY to order?

Allergy Awareness and Management Policy

SAP Fiori - Take Order

SAT Planning in Description Logics: Solving the Classical Wolf Goat Cabbage Riddle. Michael Wessel

Insiders' Guide To Denver, 6th (Insiders' Guide Series) By Linda Castrone

PARABLE OF THE SOWER

PISA Style Scientific Literacy Question

Jure Leskovec Stanford University

Family Wallchart guide

Route List Configuration

World Atlas Of Tea From The Leaf To The Cup The Worlds Teas Explored And Enjoyed

Tales of King Arthur part English 2322: British Literature: Anglo-Saxon Mid 18th Century D. Glen Smith, instructor

NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY DEPARTMENT OF HOSPITALITY MANAGEMENT COURSE OUTLINE COURSE #: HMGT 4961 COURSE TITLE: CONTEMPORARY CUISINE

Opportunities. SEARCH INSIGHTS: Spotting Category Trends and. thinkinsights THE RUNDOWN

GLOBALIZATION UNIT 1 ACTIVATE YOUR KNOWLEDGE LEARNING OBJECTIVES

$12,580 from the Sugar House Marketing Account

Analyzing Human Impacts on Population Dynamics Outdoor Lab Activity Biology

Lesson 11: Comparing Ratios Using Ratio Tables

Introduction to Management Science Midterm Exam October 29, 2002

Solubility Lab Packet

LIFE YOUR DIVERSIFY FOR YOU SUMMER SAVING IDEAS. Cucumber Sushi THIS SPUD'S POSITIVE POINT OF VIEW. Experiencing Nature THIS EDITION FEATURES:

Roux Bot Home Cooker. UC Santa Cruz, Baskin Engineering Senior Design Project 2015

Experiment # Lemna minor (Duckweed) Population Growth

What s Cookin Good Lookin. Lookin. Our Classroom Cookbook. A Lesson in Expository, Persuasive and Procedural Texts

First what are Chocolate Transfers? There are two kinds:

The International Cookbook For Kids

Transcription:

CS 387: GAME AI PROCEDURAL CONTENT GENERATION 5/19/2016 Instructor: Santiago Ontañón santi@cs.drexel.edu Class website: https://www.cs.drexel.edu/~santi/teaching/2016/cs387/intro.html

Reminders Check BBVista site for the course regularly Also: https://www.cs.drexel.edu/~santi/teaching/2016/cs387/intro.html

Outline Procedural Content Generation Name Generation Map Generation Plot Generation Other Algorithms

Outline Procedural Content Generation Name Generation Map Generation Plot Generation Other Algorithms

Computational Narrative Algorithmically analyze, structure and generate stories. Generating stories is an AI-complete problem. Involves many yet-unsolved problems: believable characters / emotional modeling natural language generation common sense reasoning narrative aesthetics Let me talk about story generation, and the we will discuss how would this be adapted to games.

The Policeman s Beard is Half Constructed

The Policeman s Beard is Half Constructed Bill sings to Sarah. Sarah sings to Bill. Perhaps they will do other dangerous things together. They may eat lamb or stroke each other. They may chant of their difficulties and their happiness. They have love but they also have typewriters. That is interesting.

Story Generation Computers are far from generating novels or plots at the level of human authors. However, many useful techniques have emerged from the story generation research community. Specially applicable to video games.

Choose Your Own Adventure

Choose Your Own Adventure

Automated Planning Planning: Find the sequence of actions that will take us from an initial state to a target state Automated Planning: Typically solved with specialized search algorithms

Automated Planning: Example Blocks world C B A C A B Table Initial State Table Target State Possible actions: Take(X) Put(X,Y)

Automated Planning: Example Action definition: Take(X) Preconditions: We have nothing in our hands X is a block Nothing on top of X Postconditions: X is not on top of anything X is in our hands Put(X,Y) Preconditions: X is in our hands Y is the table or Y is a block with nothing on top Postconditions: X is not in our hands X is on top of Y

Automated Planning: Example C B A C A B Table Initial State Table Target State Solution: - Take(B) - Put(B,Table) - Take(A) - Put(A,B) - Take(C) - Put(C,A)

Automated Planning Many approaches to solve the problem exist: Simplest is known as Forward Search, and it means using A* Forward Search: Each possible configuration of the world is a state in the A* search Heuristic measures how many of the conditions in the target state are not satisfied, for example: Current State: on(a,table) on(b,a) on(c,table) Target State: on(b,table) on(a,b) on(c,a) h(s) = 3

Planning with A*: B A Table S0 C 3 C A B Table OPEN = [S0] CLOSED = []

Planning with A*: B 3 Take(B) B A Table S0 C Take(C) OPEN = [S1,S2] CLOSED = [S0] 3 A Table S1 C B A Table S2 C 3 C A B Table

Planning with A*: B 3 Put(B,C) B 3 Take(B) 3 A Table S1 C Put(B,Table) A Table S3 C 2 C B A Table C A B Table C A B Table S0 C 3 S4 Take(C) B A Table OPEN = [S2,S4,S3] CLOSED = [S0,S1] S2

Automated Planning The example I showed is what is known as classic planning There are other variants of the planning problem: Temporal planning (actions take time) Probabilistic planning (actions have probabilistic effects) Nonlinear planning (plans might have parallel actions) Many other algorithms: Means-ends-analysis Graph-plan FF HTN Many heuristics: Relaxation

Tale-spin James Meehan 1976 The program, simply described, simulates a small world of characters who are motivated to act by having problems to solve. When an event occurs, it is expressed in English, thus forming the text of the story. Central to the simulation, therefore, are the techniques for solving problems

Tale-spin A story is generated in the following way, Given: An initial state (entered by the user): Characters Setting (relationships between the characters, locations, etc.) One character with a goal (hungry, thirsty, etc.) A set of possible actions to perform (defined in the system) Find a plan that makes the problem disappear: Both the initial state and each event (action or goal) will be translated to natural language, thus forming the story

Tale-spin: Example Once upon a time George ant lived near a patch of ground. There was a nest in an ash tree. Wilma bird lived in the nest. There was some water in a river. Wilma knew that the water was in the river. George knew that the water was in the river. One day Wilma was very thirsty. Wilma wanted to get near some water. Wilma flew from her nest across a meadow through a valley to the river. Wilma drank the water. Wilma was not thirsty any more. George was very thirsty. George wanted to get near some water. George walked from his patch of ground across the meadow through the valley to a river bank. George fell into the water. George wanted to get near the valley. George couldn't get near the valley. George wanted to get near the meadow. George couldn't get near the meadow. Wilma wanted George to get near the meadow. Wilma wanted to get near George. Wilma grabbed George with her claw. Wilma took George from the river through the valley to the meadow. George was devoted to Wilma. George owed everything to Wilma. Wilma let go of George. George fell to the meadow. The end.

Tale-spin: Example goal Once upon a time George ant lived near a patch of ground. There was a nest in an ash tree. Wilma bird lived in the nest. There was some water in a river. Wilma knew that the water was in the river. George knew that the water was in the river. One day Wilma was very thirsty. Wilma wanted to get near some water. Wilma flew from her nest across a meadow through a valley to the river. Wilma drank the water. Wilma was not thirsty any more. Initial state Story 1 goal George was very thirsty. George wanted to get near some water. George walked from his patch of ground across the meadow through the valley to a river bank. George fell into the water. George wanted to get near the valley. George couldn't get near the valley. George wanted to get near the meadow. George couldn't get near the meadow. Wilma wanted George to get near the meadow. Wilma wanted to get near George. Wilma grabbed George with her claw. Wilma took George from the river through the valley to the meadow. George was devoted to Wilma. George owed everything to Wilma. Wilma let go of George. George fell to the meadow. The end. Story 2

Tale-spin Tale-spin uses a form of means-ends analysis planning Means-ends analysis starts with the conditions in the target state not yet satisfied in the current state, and tries to find an action to satisfy them. For example: John bear is not hungry can be satisfied with the action John bear ate X. But for John bear to eat something, he must have it, etc. Difference with A* planning (explained before) is: A* searches forwards (from initial state to target state) Means-ends-analysis searches backwards (from target state to initial state)

Tale-spin: Example Initial state (user defined): Once upon a time Sam bear lived in a cave. Sam knew that Sam was in his cave. There was a beehive in an apple tree. Betty bee knew that the beehive was in the apple tree. Betty was in her beehive. Betty knew that Betty was in her beehive. There was some honey in Betty's beehive. Betty knew that the honey was in Betty's beehive. Betty had the honey. Betty knew that Betty had the honey. Sam knew that Betty was in her beehive. Sam knew that Betty had the honey. There was a rose flower in a flowerbed. Sam knew that the rose flower was in the flowerbed. Problem: Sam bear is hungry.

Tale-spin: Example Once upon a time Sam bear lived in a cave. Sam knew that Sam was in his cave. There was a beehive in an apple tree. Betty bee knew that the beehive was in the apple tree. Betty was in her beehive. Betty knew that Betty was in her beehive. There was some honey in Betty's beehive. Betty knew that the honey was in Betty's beehive. Betty had the honey. Betty knew that Betty had the honey. Sam knew that Betty was in her beehive. Sam knew that Betty had the honey. There was a rose flower in a flowerbed. Sam knew that the rose flower was in the flowerbed. Goal: Sam bear not hungry

Tale-spin: Example Once upon a time Sam bear lived in a cave. Sam knew that Sam was in his cave. There was a beehive in an apple tree. Betty bee knew that the beehive was in the apple tree. Betty was in her beehive. Betty knew that Betty was in her beehive. There was some honey in Betty's beehive. Betty knew that the honey was in Betty's beehive. Betty had the honey. Betty knew that Betty had the honey. Sam knew that Betty was in her beehive. Sam knew that Betty had the honey. There was a rose flower in a flowerbed. Sam knew that the rose flower was in the flowerbed. Tale-spin knows (for each type of goal) the set of actions that can satisfy it. In this case: go towards something edible have something edible One is picked at random Goal: Sam bear not hungry

Tale-spin: Example Once upon a time Sam bear lived in a cave. Sam knew that Sam was in his cave. There was a beehive in an apple tree. Betty bee knew that the beehive was in the apple tree. Betty was in her beehive. Betty knew that Betty was in her beehive. There was some honey in Betty's beehive. Betty knew that the honey was in Betty's beehive. Betty had the honey. Betty knew that Betty had the honey. Sam knew that Betty was in her beehive. Sam knew that Betty had the honey. There was a rose flower in a flowerbed. Sam knew that the rose flower was in the flowerbed. Goal: have something edible Goal: Sam bear not hungry

Tale-spin: Example Once upon a time Sam bear lived in a cave. Sam knew that Sam was in his cave. There was a beehive in an apple tree. Betty bee knew that the beehive was in the apple tree. Betty was in her beehive. Betty knew that Betty was in her beehive. There was some honey in Betty's beehive. Betty knew that the honey was in Betty's beehive. Betty had the honey. Betty knew that Betty had the honey. Sam knew that Betty was in her beehive. Sam knew that Betty had the honey. There was a rose flower in a flowerbed. Sam knew that the rose flower was in the flowerbed. Tale-spin knows (for each type of character) the set of thins they eat. In this case, a bear: Honey Salmon etc. One is picked at random Goal: have honey Goal: Sam bear not hungry

Tale-spin: Example Once upon a time Sam bear lived in a cave. Sam knew that Sam was in his cave. There was a beehive in an apple tree. Betty bee knew that the beehive was in the apple tree. Betty was in her beehive. Betty knew that Betty was in her beehive. There was some honey in Betty's beehive. Betty knew that the honey was in Betty's beehive. Betty had the honey. Betty knew that Betty had the honey. Sam knew that Betty was in her beehive. Sam knew that Betty had the honey. There was a rose flower in a flowerbed. Sam knew that the rose flower was in the flowerbed. Every time a goal is posted, Tale-spin generates text, to motivate the actions of the characters. In this case: Sam bear wanted to get some honey Goal: have honey Goal: Sam bear not hungry

Tale-spin: Example Once upon a time Sam bear lived in a cave. Sam knew that Sam was in his cave. There was a beehive in an apple tree. Betty bee knew that the beehive was in the apple tree. Betty was in her beehive. Betty knew that Betty was in her beehive. There was some honey in Betty's beehive. Betty knew that the honey was in Betty's beehive. Betty had the honey. Betty knew that Betty had the honey. Sam knew that Betty was in her beehive. Sam knew that Betty had the honey. There was a rose flower in a flowerbed. Sam knew that the rose flower was in the flowerbed. Goal: have honey Goal: Sam bear not hungry

Tale-spin: Example Tale-spin searches among the possible actions that can satisfy have honey : Once upon a time Sam bear lived in a cave. Sam knew that Sam was in his cave. There was a beehive in an apple tree. Betty bee knew that the beehive was in the apple tree. Betty was in her beehive. Betty knew that Betty was in her beehive. There was some honey in Betty's beehive. Betty knew that the honey was in Betty's Take(honey) beehive. Betty had the honey. Betty knew that Betty had the honey. Sam knew that Betty was in her beehive. Sam knew that Betty had the honey. There was a rose flower in a flowerbed. Sam knew that the rose flower was in the flowerbed. Persuade-to-give(Betty,honey) Persuade-to-abandon(Betty,honey) etc. Take(honey) cannot be used, since its precondition is that honey is not owned by someone else. So, Tale-spin selects one of the others at random. Goal: have honey Goal: Sam bear not hungry

Tale-spin: Example Once upon a time Sam bear lived in a cave. Sam knew that Sam was in his cave. There was a beehive in an apple tree. Betty bee knew that the beehive was in the apple tree. Betty was in her beehive. Betty knew that Betty was in her beehive. There was some honey in Betty's beehive. Betty knew that the honey was in Betty's beehive. Betty had the honey. Betty knew that Betty had the honey. Sam knew that Betty was in her beehive. Sam knew that Betty had the honey. There was a rose flower in a flowerbed. Sam knew that the rose flower was in the flowerbed. Goal: persuade Betty to abandon honey Goal: have honey Goal: Sam bear not hungry

Tale-spin Goals: hungry, have something, persuade someone, go somewhere, etc. For each goal: a collection of strategies and preconditions Domain knowledge: Which actions can certain characters execute Which food do different animals like Inter-character relations and how to they affect the actions the can execute etc. Using those 3 things: stories are generated at random, from the set of possible ways to solve goals.

Tale-spin Planning-based story generation Generated stories are about solving problems Each individual character plans on its own (no joint behaviors between characters): Tale-spin is character centric Stories are always coherent (actions of characters are motivated)

Other Approaches Simulation-based approaches: Define an initial state, populated by characters Simulate what would characters do (personality models) Analogy and case-based approaches: Have a library of predefined stories Build new stories by finding analogies of a given initial situations with previous defined stories

Story Generation in Existing Games Backstory Generation Plot generation Quest generation

Story Generation in Existing Games Backstory Generation: Dwarf Fortress Plot generation Quest generation During world generation : after a fractal + simulation process generates the world, civilizations, races, battles, heroes, etc. are simulated to create a backstory to the world. Backstory generation uses a simulation-based approach.

Story Generation in Existing Games Backstory Generation: Dwarf Fortress Plot generation Quest generation There are tools, like legend viewer to then browse through the cities, heroes, etc. created during world creation.

Story Generation in Existing Games Backstory Generation Plot generation: Façade Quest generation Given a set of beats (predefined story snippets), Façade determines which beats to select next in order to get an interesting story. Beats have pre and postconditions (like in planning), that determine whether they can be triggered or not.

Story Generation in Existing Games Backstory Generation Plot generation: Murder! Quest generation Based on a year, a type of house, and a difficulty level. Murder! would generate a new mystery for the player to solve. How exactly this happened has never been documented. But it is likely it worked using a pattern-based approach (very similar to a grammar-based approach)

Story Generation in Existing Games Backstory Generation Plot generation Quest generation: Skyrim Based on parametrized templates : There are a collection of preauthored templates. Example: Fetch a BOOK from XXX BOOK can be any book, and XXX a location. Each template has a list of NPCs can can request it, and a list of possible values for all the parameters.

Story Generation in Games Plot generation: Story generation can be used to automatically generate plot Given an initial state (generated, for example, using PCG), and a goal (selected, for example, at random from a set of goals): generate a story from initial state to goal: that is the path that the player will have to follow. Quest generation (analogous): Given a goal for the player (generated, for example, at random) Generate a story in which the player achieves the goal from the current state. The actions in that story are the things the player needs to do to accomplish the quest.

Outline Procedural Content Generation Name Generation Map Generation Plot Generation Other Algorithms

Other Algorithms Cellular Automatons Ad-hoc Algorithms Statistical Approaches Many more!