5
Attack: Enemy subtracts
your attack from
their health
Slide 6
Slide 6 text
6
Yellow Team Go!
BUFF
ATTACK
Slide 7
Slide 7 text
7
Buff other:
Spend your turn to increase
someone else’s attack
Slide 8
Slide 8 text
8
Blue Team Go!
BUFF
(self or other)
ATTACK
Slide 9
Slide 9 text
9
Slide 10
Slide 10 text
10
Slide 11
Slide 11 text
11
Slide 12
Slide 12 text
12
PROBLEM
Slide 13
Slide 13 text
13
Formal Language
for Game Sketching
Executable
Rules First
Platform-agnostic
General
Slide 14
Slide 14 text
14
Formal Language
for Game Sketching
Executable
Rules First
Platform-agnostic
General
Slide 15
Slide 15 text
15
Formal Language
for Game Sketching
Executable
Rules First
Platform-agnostic
General
Slide 16
Slide 16 text
16
Formal Language
for Game Sketching
Executable
Rules First
Platform-agnostic
General
Slide 17
Slide 17 text
17
Interactive Worlds
(Definition)
An interactive world is
an initial configuration
(e.g. your cards at the start of the game)
!
together with rules for evolving configurations,
(e.g.: buffing increases your attack)
!
some of which are mediated by human interaction, randomness,
or other processes.
Slide 18
Slide 18 text
18
Slide 19
Slide 19 text
19
A formal language
for describing interactive worlds
makes it easier to sketch and invent
novel game & story designs.
Thesis Statement
(Take 1)
Slide 20
Slide 20 text
20
Thesis Statement
(Take 1)
A formal language
for describing interactive worlds
makes it easier to sketch and invent
novel game & story designs.
Slide 21
Slide 21 text
21
Authoring Potential Narratives
[Diagram credit: Sam Kabo Ashwell]
Slide 22
Slide 22 text
22
Authoring Potential Narratives
Slide 23
Slide 23 text
23
Authoring Potential Narratives
choose character stats branch on character stats
Slide 24
Slide 24 text
24
A formal language for describing interactive worlds
enables rapid prototyping of experimental game designs
and deeper understanding of narrative structure.
Thesis Statement
(Take 2)
Slide 25
Slide 25 text
25
Thesis Statement
(Take 2)
A formal language for describing interactive worlds
enables rapid prototyping of experimental game designs
and deeper understanding of narrative structure.
Slide 26
Slide 26 text
26
THESIS STATEMENT
Using linear logic to model interactive worlds enables rapid
prototyping of experimental game designs and deeper understanding
of narrative structure.
Slide 27
Slide 27 text
Programming language (Ceptre)
Causal analysis for games & narratives
Case studies
Meta-reasoning methodology
27
Contributions
Slide 28
Slide 28 text
28
Programming language (Ceptre)
Causal analysis for games & narratives
Case studies
Meta-reasoning methodology
Contributions
Slide 29
Slide 29 text
29
APPROACH
Linear Logic Programming
Slide 30
Slide 30 text
30
Logic
Facts about the world are propositions:
!
The player is in the foyer
Juliet loves Romeo
Roger has 2 health points
Slide 31
Slide 31 text
31
Facts about the world are propositions:
!
!
!
Logic
Slide 32
Slide 32 text
32
Action and Change
Slide 33
Slide 33 text
33
Action and Change
[Girard 1987, Girard/LaFont 87, Chang et al. 2003]
Slide 34
Slide 34 text
34
Slide 35
Slide 35 text
35
Slide 36
Slide 36 text
36
Movement rule, take 2
Slide 37
Slide 37 text
37
Slide 38
Slide 38 text
38
Slide 39
Slide 39 text
39
Movement rule, take 3
Slide 40
Slide 40 text
40
Movement rule, take 3’
Slide 41
Slide 41 text
41
Program Rules
move : in player Room * adjacent Room Room’
—o
in player Room’.
!
adjacent/foyer-kitchen : adjacent foyer kitchen.
Slide 42
Slide 42 text
42
Author-defined terms and predicates,
quantified Variables,
tensor (*), bang (!), and lolli (—o)
are all we need
to specify action & change on a logical level.
Linear Logic
Slide 43
Slide 43 text
43
A * $B —o C
!
==
!
A * B —o C * B
Derived Syntax
Slide 44
Slide 44 text
44
Programming language (Ceptre)
Causal analysis for games & narratives
Case studies
Meta-reasoning methodology
Contributions
Slide 45
Slide 45 text
45
Linear Logic Programming
Configuration (linear context)
term/predicate declarations,
permanent facts, and rules
[Harland et al. 2000; Lopez et al. 2005]
e.g.
Signature (permanent rules)
59
0: (quiesce)
1: (buff chris 1)
2: (buff andre 1)
[…]
7: (target chris yellow blue frank 1 3)
8: (target chris yellow blue gwenn 1 3)
!
?-
Slide 60
Slide 60 text
60
Ceptre
Persistent backward-chaining
Linear forward-chaining
Terms, predicates
Stages and quiescence rules
(Sensing and acting predicates)
http://www.github.com/chrisamaphone/interactive-lp
Chapter 4 - AIIDE 2015
Slide 61
Slide 61 text
61
Ceptre
Compilable to Celf
via interleaved (linear) backward and forward chaining
http://www.github.com/chrisamaphone/interactive-lp
Chapter 4 - AIIDE 2015
Slide 62
Slide 62 text
Programming language (Ceptre)
Causal analysis for games & narratives
Case studies
Meta-reasoning methodology
62
Contributions
Slide 63
Slide 63 text
63
63
Proof Construction
Slide 64
Slide 64 text
64
64
Slide 65
Slide 65 text
65
65
Slide 66
Slide 66 text
66
66
Slide 67
Slide 67 text
67
67
Slide 68
Slide 68 text
68
68
Slide 69
Slide 69 text
69
Concurrent Structure
let b = r1 a1 let c = r2 a2
a1 a2
=
b c
let b = r1 a1
let c = r2 a2
Slide 70
Slide 70 text
70
Concurrent Structure
r1
c
r2
b
a1 a2
Slide 71
Slide 71 text
71
Causal Structure
attack
buff
die
buff
Slide 72
Slide 72 text
72
TAKEAWAY:
Concurrent structure in proofs
yields causal structure among actions
[Bosser et al. 2010, 2011;
Watkins et al. 2002]
Slide 73
Slide 73 text
Programming language (Ceptre)
Causal analysis for games & narratives
Case studies
Meta-reasoning methodology
73
Contributions
Slide 74
Slide 74 text
74
Case Study:
Shakespearean Tragedy
Story World
do/becomeSuicidal
: at C L *
depressed C * depressed C * depressed C * depressed C
-o at C L * suicidal C * wants C weapon.
Slide 75
Slide 75 text
75
Causal Structure
do/murder
romeo capulet town
do/insult/private
tybalt town montague
do/becomeSuicidal
montague town
do/m
juliet tow
do/suicide
romeo town
x147
do/mourn
montague town romeo
x154 x153
x152
x151
x155
x182
x188
x187 x186
x185
x184
x198
x197 x196
x200
x199
84
Interactive World
Case Studies
Chapter 5
Interactive storytelling (BuffyWorld)
Action/reaction model
!
!
!
!
Slide 85
Slide 85 text
85
Interactive World
Case Studies
Chapter 5
Interactive storytelling (BuffyWorld)
Action/reaction model
!
Board/card games: die rolls and distribution
!
!
Slide 86
Slide 86 text
86
Interactive storytelling (BuffyWorld)
Action/reaction model
!
Board/card games: die rolls and distribution
!
Novel designs: generative simulation games
(RPG and GardenSim worlds)
Interactive World
Case Studies
Chapter 5
Slide 87
Slide 87 text
87
Limitations?
Negation
Comprehension
Rule ordering
etc.
Slide 88
Slide 88 text
88
Limitations?
Programming Tricks
(see Chapter 4)
Negation
Comprehension
Rule ordering
etc.
Slide 89
Slide 89 text
89
Fun with Ceptre
Debugging automatic/generative stages
Experimenting with player control schemes
Slide 90
Slide 90 text
90
Fun with Ceptre
“Fuzz testing” player input
Augmenting rules w/AI strategies
Slide 91
Slide 91 text
buff :
turn Player
* $on_team Player T
* $on_Team Player’ T
* attack Player’ Att
-o attack Player’ (s Att).
91
Augmenting rules with strategies:
Buffing Only Friends
Slide 92
Slide 92 text
attack :
turn Player
* $on_team Player Team
* opp Team Team’
* $on_team Enemy Team’
* $attack Player Att * health Enemy H
-o subtract Enemy H Att.
92
Augmenting rules with strategies:
Attacking Only Enemies
Slide 93
Slide 93 text
93
Fun with Ceptre
Evaluating for Balance
Slide 94
Slide 94 text
94
(Actual) Limitations
buff :
turn Player
* attack Player A
-o attack Player (A+1).
Invariants:
each player should only
ever have 1 turn active
!
a character should either
be dead or have a team
!
a character with a team
should always have an
attack value
!
…
Slide 95
Slide 95 text
95
Contributions
Programming language (Ceptre)
Causal analysis for games & narratives
Case studies
Meta-reasoning methodology
Slide 96
Slide 96 text
96
(Chapter 6)
Reasoning Framework
Slide 97
Slide 97 text
97
Program Invariants
INV holds of all initial configurations;
!
and for all rules and all contexts ,
!
whenever INV holds of sdfa
!
!
INV holds of j
Invariant INV holds for a specification iff:
Slide 98
Slide 98 text
98
Propositional Ceptre (similar to Horn clauses):
!
!
!
where can be atoms a or !a.
Program Invariants
Slide 99
Slide 99 text
99
Generative invariants (Simmons ’12)
Program Invariants
=
=
Slide 100
Slide 100 text
100
Decidability Result
Via vector addition systems, the problem can be reduced to
Presburger arithmetic (known decidable.)
Upshot:
Whether or not a given (propositional Ceptre)
program satisfies a flat invariant is decidable.
Slide 101
Slide 101 text
101
DISCUSSION
Slide 102
Slide 102 text
102
To PL theory:
Better understanding of forward-chaining logic programming
Theoretical result about checking properties of evolving systems
Large base of application examples
!
To game & narrative design:
Better understanding of structure for potential narratives
Unification of rule languages for narratives and systems
Sandbox for prototyping, analyzing, and iterating upon designs
Thesis Contributions
Slide 103
Slide 103 text
103
Future Work
Narrative representation:
modal and higher-order logics
(character-based reasoning about other characters’ beliefs;
theory of mind)
!
Automated reasoning tools
!
Accessible game design framework
Slide 104
Slide 104 text
104
Thesis Statement, reprise
Ceptre (Ch 4)
Reasoning Tools (Ch 6)
Using linear logic to model interactive worlds enables rapid
prototyping of experimental game designs and deeper understanding
of narrative structure.
Slide 105
Slide 105 text
105
Thesis Statement, reprise
Using linear logic to model interactive worlds enables rapid
prototyping of experimental game designs and deeper understanding
of narrative structure.
Case Studies (Ch 5)
Slide 106
Slide 106 text
106
Thesis Statement, reprise
Chapters 2 & 3
Using linear logic to model interactive worlds enables rapid
prototyping of experimental game designs and deeper understanding
of narrative structure.
Slide 107
Slide 107 text
Thanks!
Using linear logic to model interactive worlds enables rapid
prototyping of experimental game designs and deeper understanding
of narrative structure.
Thesis Statement, reprise
http://www.cs.cmu.edu/~cmartens/thesis.pdf
attack :
turn Player
* $on_team Player Team
* opp Team Team’
* $on_team Enemy Team’
* $attack W Att * health Enemy H
* nat_minus H Att H’
-o health Enemy H’.
!
die : health P z -o dead P.
117
Backward-Chaining Subtraction
Slide 118
Slide 118 text
118
} Prove with goal-directed
rules
} Find in linear context
attack :
turn Player
* $on_team Player Team
* $on_team Enemy Team’
* $attack W Att
* health Enemy H
* opp Team Team’
* nat_minus H Att H’
-o health Enemy H’.
Slide 119
Slide 119 text
119
attack :
turn Player
* $attack W Att * health Enemy H
-o subtract Enemy H Att.
Attacking
Slide 120
Slide 120 text
120
subtract/s :
subtract P (s Health) (s Att)
-o subtract P Health Att.
!
subtract/done :
subtract P H z -o health P H.
!
subtract/die :
subtract P z Att -o dead P.
Forward-Chaining Subtraction
Slide 121
Slide 121 text
121
nat_minus nat nat nat : bwd.
minus/z- : nat_minus z N z.
minus/-z : nat_minus N z N.
minus/s : nat_minus (s N) (s M) P
<- nat_minus N M P.
Backward-Chaining Subtraction
Slide 122
Slide 122 text
opp team team : bwd.
opp blue yellow.
opp yellow blue.
122
Persistent Predicates
Slide 123
Slide 123 text
123
Types and Predicates
team : type.
blue : team.
yellow : team.
!
player : type.
!
on_team player team : pred.
health player nat : pred.
attack player nat : pred.
Slide 124
Slide 124 text
124
Types and Predicates
nat : type.
z : nat.
s nat : nat.
(Operators on numbers can be defined in the language via backward
chaining, or by accessing built-in functions.)
Slide 125
Slide 125 text
125
Slide 126
Slide 126 text
126
PROBLEM 2: Feature Creep
Slide 127
Slide 127 text
127
Interactive Fiction (IF)
Slide 128
Slide 128 text
128
Interactive Fiction (IF)
Slide 129
Slide 129 text
129
Twine
Graph
+
hidden state
Slide 130
Slide 130 text
130
Forward Chaining
Slide 131
Slide 131 text
131
A formal language
for describing stories and games
makes it easier to sketch and invent
novel designs.
Thesis Statement
(Take 1)
Slide 132
Slide 132 text
132
Thesis Statement
(Take 1)
A formal language
for describing stories and games
makes it easier to sketch and invent
novel designs.