Slide 1

Slide 1 text

1

Slide 2

Slide 2 text

2

Slide 3

Slide 3 text

3 Attack (Starts at 1) Health (Starts at 3)

Slide 4

Slide 4 text

4 Buff: Add 1 to attack

Slide 5

Slide 5 text

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)

Slide 46

Slide 46 text

46 Multiset Rewriting [Cervesato & Scevdrov 2009] (synonym: forward chaining)

Slide 47

Slide 47 text

47 EXAMPLE WORLD: Defense Defense

Slide 48

Slide 48 text

48 Buffing buff : turn Player * attack Player Att -o attack Player (Att + 1).

Slide 49

Slide 49 text

49 Buffing Others buff : turn Player * attack Player’ Att -o attack Player’ (Att + 1).

Slide 50

Slide 50 text

attack : turn Player * $attack Player A * health Enemy H -o health Enemy (H - A). ! die : health P 0 -o dead P. 50 Attacking

Slide 51

Slide 51 text

51 Configurations (Contexts) { turn player1, turn player4, […], on_team player1 blue, on_team player2 yellow, health player1 3, attack player2 2, […] } Multisets of ground propositions

Slide 52

Slide 52 text

52 Running a program context init = {…} #trace init. 0

Slide 53

Slide 53 text

53 Running a program Quiescence: no more rules in can fire 0 … n

Slide 54

Slide 54 text

54 Prior linear logic programming languages: Celf, LolliMon, Lygon Ceptre: Adding Interactivity and Stages

Slide 55

Slide 55 text

55 stage yellow_team = { attack : … buff : … } ! stage blue_team = { attack : … buff : … }

Slide 56

Slide 56 text

56 stage play = { attack : … buff : … } ! stage generate_turns = { … }

Slide 57

Slide 57 text

57 stage play = { attack : … buff : … } ! qui * stage play * team_turn T * opp T T’ -o stage generate_turns * team_turn T. ! stage generate_turns = { … } ! qui * stage generate_turns -o stage play.

Slide 58

Slide 58 text

58 stage play = { attack : … buff : … } #interactive play. ! ! ! stage generate_turns = { … }

Slide 59

Slide 59 text

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

Slide 76

Slide 76 text

76 init emmaSpendsYearsInCovent leonFallsInLove emmaReadsRomanticNovels emmaReadsRomanticNovels emmaMarriesCharles emmaInvitedToBall emmaDiscoversLeonsLove emmaPushesLeonAway emmaContractsDebts emmaDoesNotGoToBall rodolpheDecidesToSeduceEmma emmaAcceptsRodolpheAdvances emmaContractsDebts rodolpheRelationshipFalters charlesDecidesToOperateHypolyte hypolyteIsAmputated emmaPurchasesGift emmaOffersGift emmaPurchasesProstheticLeg rodolpheBreaksUp emmaJumpsThroughWindow OR Causal Structure

Slide 77

Slide 77 text

77 Narrative Generation Chapter 3/INT 2014/LPNMR 2013

Slide 78

Slide 78 text

78

Slide 79

Slide 79 text

79 Tamara

Slide 80

Slide 80 text

80 Tamara

Slide 81

Slide 81 text

81 ! b9_aelis_monologue : aelis b9 diningroom -o aelis c12 atrium. ! b10_dante_despiga : dante b10 atrium * despiga b10 atrium -o dante c12 atrium * despiga c12 atrium. ! b11_dannunzio_luisa : dannunzio b11 dannunzioroom * luisa b11 dannunzioroom -o dannunzio c12 atrium * luisa c12 above-atrium.

Slide 82

Slide 82 text

82 x12 a1_dannunzio_exits x17 x16 a1_grp2_aelis b4_carlotta_kisses_finzi x20 x19 x18 b2_despiga_monologue a1_grp1_luisa x22 x21 b9_aelis_monologue a1_grp2_emilia x23 b10_dante_despiga x25 x24 b3_luisa_monologue a1_grp1_dannunzio x2 x26 x27 c12_finzi_exit x28 b11_dannunzio_luisa x30 a1_emilia_exits x32 x31 b6_dannunzio_monologue x33 x34 x36 x35 x37 x39 x38 b7_emilia_monologue x41 x40 x42 b8_emilia_carlotta x44 x43 b5_finzi_monologue x46 x45 x47 x53 x51

Slide 83

Slide 83 text

83 a1_emilia_exits a1_dannunzio_exits x14 a1_grp1_dannunzio x16 a1_grp2_emilia b2_despiga_monologue a1_grp2_aelis a1_grp1_luisa x23 b10_dante_despiga x25 x24 b3_luisa_monologue x28 x27 b6_dannunzio_monologue x30 x29 c12_finzi_exit x31 b11_dannunzio_luisa x32 b4_carlotta_kisses_finzi x35 x34 b9_aelis_monologue x36 x38 x37 b7_emilia_monologue x39 x41 x40 c_final x43 x42 b8_emilia_carlotta b5_finzi_monologue x44 x45 x47 x46 c12_gunshot x53 x52 x51 x50 x49 x48 c12_emilia_carlotta_aelis_luisa_leave_atrium c12_take_presents_to_leda x56 x55 x54 c13_finzi_luisa_confrontation x60 x59 x58 x57 c13_emilia_aelis_carlotta_luisa_sidehall x62 x61 x66 x65 x64 x63 x70 x69 x68 x67 c14_emilia_enter_leda x74 x73 x72 x71 c14_all_exit_leda x78 x77 x76 x75

Slide 84

Slide 84 text

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

Slide 108

Slide 108 text

108 Bonus Slides

Slide 109

Slide 109 text

109 Backward chaining (goal directed) ! vs ! Forward chaining (context-directed)

Slide 110

Slide 110 text

110 Backward Chaining

Slide 111

Slide 111 text

111 Backward Chaining

Slide 112

Slide 112 text

112 Backward Chaining

Slide 113

Slide 113 text

113 Forward Chaining

Slide 114

Slide 114 text

114 Forward Chaining

Slide 115

Slide 115 text

115 Forward Chaining

Slide 116

Slide 116 text

116 Forward Chaining

Slide 117

Slide 117 text

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.