presentation ai seminar - washington state universitycook/aiseminar/papers/jessai...computer game...

73
AI Seminar Presentation Jess Dahmen

Upload: others

Post on 11-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

AI Seminar PresentationJess Dahmen

Page 2: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Automatic Game Design Via Mechanic GenerationAlexander Zook and Mark O. Riedl

Page 3: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

The Question

Can an intelligent system design a computer game?

Page 4: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Computer Game

● Mechanics ***○ rules governing logical state changes in game

● Content○ non-procedural assets○ art, sounds, animations, levels, maps etc.

Page 5: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Content

ARTMUSIC

ANIMATIONS

MAPS

LEVELS

Page 6: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

By automatically designing game mechanics

● Create games unique to each player● Generate solutions to design problems

humans may not be able to think of● Create games across domains (domain

independent)● Create new game genres

Page 7: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Generation

● Create mechanics○ from low-level primitives○ check and update variables

● De novo synthesis of game agent actions○ given knowledge of game domain

Page 8: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

De Novo synthesis

Game Agent Actions Mechanic Generation

Page 9: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanics

● Take the form of planning operators

● Representation specialized to game mechanics

Page 10: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Generate and Test Process

● Generate mechanics that meet design requirements○ Constraint Solver

● Test generated mechanics to meet playability requirements○ Planner○ Mechanic Generation creates the operators

Page 11: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Design Requirements

How actions work in a game

Page 12: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Playability Requirements

● Ensures you can play the game and reach some goal

● May be limits on the actions taken to achieve the goal

Page 13: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Process

Generate Mechanics Test Mechanics

Constraint Solver Planner

Page 14: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Generation

Requirements Game Mechanics

Page 15: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Constraint Solver

● Generic approach to search combinatorial spaces

● Hard and soft requirements○ Required○ Optimized

● Searching for mechanics that meet design criteria

Page 16: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Planner

● Used for proving presence or absence of play traces within game domain

● Play trace: sequences of mechanic choices and state updates

Page 17: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Structure

● Based on planning domain representations● Find a sequence of operations that transform

the world from initial state to one in which goal situation holds

Initial State Goal State

Operations

Page 18: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

PDDLComponents of a PDDL planning task:

• Objects: Things in the world that interest us.• Predicates: Properties of objects that we are interested in; can be true or false. • Initial state: The state of the world that we start in.• Goal specification: Things that we want to be true.• Actions/Operators: Ways of changing the state of the world.

From: http://www.cs.toronto.edu/~sheila/2542/s14/A1/introtopddl2.pdf

Page 19: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Example: Gripper Task

Room 1 Room 2

Robot

Goal: Move all the objects to Room 2

Page 20: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

PDDL Representation

http://www.cs.toronto.edu/~sheila/2542/s14/A1/introtopddl2.pdf

Page 21: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Defining the Mechanic Generation Problem

Some definitions...

Page 22: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Generation

Constructing a set of game mechanics that meet playability and design requirements

Page 23: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Playability Requirements

● Ensures you can play the game and reach some goal

● May be limits on the actions taken to achieve the goal

Page 24: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Design Requirements

How actions work in a game

Page 25: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Game Domain

State and Transition Models

Page 26: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

State Model

Entities that make up the gameParametersAllowed ranges of values

Page 27: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Transition Model

How states change from one another

Page 28: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Game Instance

● Setting from a game domain● example: level in platformer or single battle

in RPG

Page 29: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Avatar-Centric Mechanics

Transitions initiated by the player or other agents in the process of controlling an avatar

Page 30: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Combine

Game instance for a state model with a transition model including avatar-centric mechanics yields “playable” game experience

Page 31: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Definitions in Action: An Example

PlayerEnemy

Page 32: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Definitions in Action: An Example

PlayerEnemy

Health + Magic (Resources)

Page 33: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Definitions in Action: An Example

PlayerEnemy

Each “instance” has different values for resources

Page 34: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Definitions in Action: An Example

PlayerEnemy

Playability Requirement:

Over all instances, player can kill enemy w/o being killed

Page 35: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Definitions in Action: An Example

PlayerEnemy

Design Requirement:

All spells have a cost

Page 36: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Generation Asks

Given these requirements: What spells (or mechanics) should be in the

game?

Page 37: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Solution to Mechanic Generation

● State and Transition Model Representation● Process to search for Transition models

within state model● Process to Test Transition Model (provided

set of instances)

Page 38: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Constraint Solver is used to search for transition models that meet design criteria

Page 39: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Planner is used to validate transition models against playability criteria

Page 40: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Game Domains Representation

● Subset of PDDL ideas with extensions

● Simplified to turn-based domains

● Deterministic actions

Page 41: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

State Model

Defines a domain of game entities in terms of their allowed states

Entities Parameters Parameter Ranges

Page 42: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

State Model

Entity (e)Parameter (p)Has(e, p)AbsRange(p,e,r)RelRange(p,e,r)

Page 43: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Example

Entity(Player)Parameter(Health)Parameter(Magic)Has(Player, Health) Has(Player, Magic)AbsRange(Health, Player, [0,1000])AbsRange(Magic, Player, [0, 100])

Page 44: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Transition Model

● A set of mechanics define Transition Model

● Drawn from PDDL’s action schemast

Page 45: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Model

<mechanic id, set of preconditions, set of effects>

Mechanic similar to action in PDDL

Page 46: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Model: Pre and Effect

● Time-indexing● Coordinate Frames of Reference

Page 47: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Time Indexing

● Preconditions can reference state at times other than present

● Effects can reference states other than next

Delayed effects or Historical State Checks

Page 48: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Coord Frame of Reference

● Distinguish between○ Traditional world state terms○ Perceived avatar relative terms○ Preconditions and Effects relative to avatar

● Adjacency

AvatarObject

Page 49: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Preconditions and Effects

<frame, time, condition>

Page 50: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Condition

F(parameter(entity), value)

F is logical function

Page 51: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Example Mechanic: Spell

<DamageOverTime,{(Absolute, 0, GreaterThan(Health(Enemy), 0))},{Relative, 1, Update(Health(Enemy), -1)), (Relative, 2, Update(Health(Enemy), -1))})

Page 52: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Example Mechanic: Spell

● Check that enemy is alive● Reduce enemy health by 1 on the next two

turns

Page 53: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Recombination

● One mechanic references another mechanic having occurred

Page 54: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Performed

Double jump

(Absolute, -1, Equal(Performed(Jump), Player))

Page 55: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Generation

● Creates mechanics by choosing preconditions and effects

● Ensure conform to design requirements● Test mechanics adhere to playability

requirements● Repeat until hard and soft requirements met

Page 56: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Generation

● Expensive process● Small game domains● Many games use relatively small sets of

mechanics?

Page 57: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Playability Checking

● Planner can simulate game instances using player choices among generated mechanics

Page 58: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Playability Requirements

1. Goalsa. Target situation

2. Maintenance Goalsa. begin true, must hold throughoutb. Goals must uphold maintenance goals

3. Engine Constraintsa. Non-avatar rules

Page 59: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Example

Goal: Kill all enemiesMaintenance: Be aliveConstraint: Player cannot drop below 0 magic

Page 60: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Examples

Role PlayingPlatformer

Page 61: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Role Playing

● Goal: Kill all enemies● Maintenance: Be alive● Constraint: No negative magic

● All actions have cost

Page 62: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Instance

Player

Enemies

Magic Health

Page 63: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Role Playing

● Example Spell: Damage All

● They assigned human readable names

● Reduce enemy health by 1, reduce player mana by 2

Page 64: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Platformer

Page 65: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Platformer

● Jump● Double Jump● Forward

● Moves player position

Page 66: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Conclusions

● Key is representation● Focus higher level problems such as

generating mechanics, rather than genre specific

● More sophisticated playability requirements

Page 67: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Future Work

● Data?● Performance? ● Generated game mechanics with actual

users?

Page 68: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Thank you!

Questions?

Page 69: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Mechanic Adaptation

● Instead of from scratch, start w/ set of mechanics, produce minimally changed set

● Iterative design, Adjusted to meet new insights about game

Page 70: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

ASP

● Answer Set Programming● Used to implement the constraint solver and

planner

Page 71: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Multi-level

● Gradually introduce new mechanics over seq of levels

● Augmented with level index● Enforces progression

Page 72: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Multi-Agent

● Competing agents● Not true adversarial interaction

Page 73: Presentation AI Seminar - Washington State Universitycook/aiseminar/papers/JessAI...Computer Game Mechanics *** rules governing logical state changes in game Content non-procedural

Controls

● Map input buttons to generated mechanics● “Automated control generation”