Ceptre: a Language for Modeling Generative Interactive Systems

Ceptre: a Language for Modeling Generative Interactive Systems

Ceptre: A Language for Modeling Generative Interactive Systems Chris Martens Carnegie Mellon University [email protected] Abstract fixed operational logic (e.g. tile grids and layers in Puzzle- Script, or text command-based navigation of a space in In- We present a rule specification language called Ceptre, form 7) atop which the designer may be inventive in terms of intended to enable rapid prototyping for experimental game mechanics, especially in domains that depend on rules and appearance, but all rules must be formed out of en- procedural generation and multi-agent simulation. tities that mean something in the given operational logic (or Ceptre can be viewed as an explication of a new use a much more complex language to subvert that default methodology for understanding games based on linear logic). We lack good specification tools for inventing new logic, a formal logic concerned with resource usage. We operational logics, or combining elements from several. In present a correspondence between gameplay and proof particular, many novel systems of play arise from the inves- search in linear logic, building on prior work on gen- tigation of interactive storytelling (Mateas and Stern 2003), erating narratives. In Ceptre, we introduce the ability to multi-agent social interaction (McCoy et al. 2010), and pro- add interactivity selectively into a generative model, en- cedurally generated behavior (Hartsook et al. 2011), and no abling inspection of intermediate states for debugging existing tools make it especially straightforward for a novice and exploration as well as a means of play. developer to codify and reason about those systems. We claim that this methodology can support game de- signers and researchers in designing, anaylzing, and de- Ceptre is a proposal for an operational-logic-agnostic bugging the core systems of their work in generative, specification language that may form the basis of an ac- multi-agent gameplay. To support this claim, we pro- cessible front-end tool. It is based on a tradition of logical vide two case studies implemented in Ceptre, one from frameworks (Harper, Honsell, and Plotkin 1993), which use interactive narrative and one from a strategy-like do- logical formulas to represent the rules of a system (a speci- main. fication). Then proof search may be used to simulate execu- tion, answer queries, and perform analysis of the specifica- Introduction tion. In Ceptre, we specify games, generative systems, and narratives with similar payoff. Our logic of choice for repre- Today, game designers and developers have a wealth of senting games is linear logic (Girard 1987), unique among tools available for creating executable prototypes. Freely- logics in its ability to model state change and actions without available engines such as Twine, Unity, PuzzleScript, and the need for a frame rule or other axiomatization of inertia Inform 7 provide carefully-crafted interfaces to creating dif- for predicates that do not change in an action. ferent subdomains of games. On the other hand, to invent in- Using linear logic to specify a space of play closely re- teresting, novel mechanics in any of these tools typically re- sembles planning approaches. Planning has been used ex- quires the use of ill-specified, general purpose languages: in tensively to study games, especially in the interactive story- Twine, manipulating state requires dipping into JavaScript; telling domain (Mateas and Stern 2003; Porteous, Cavazza, in Unity, specifying any interactive behavior requires learn- and Charles 2010; Medler and Magerko 2006) but also as ing a language such as C# or JavaScript; Inform 7 contains a general mechanic description language (Zook and Riedl its own general-purpose imperative, functional, and logic 2014). In contrast to this work, we position Ceptre as unique programming languages; and PuzzleScript simply prevents among game description languages in its combination of (a) the author from going outside the well-specified 2D tile grid direct correspondence to a pre-existing logic and proof the- mechanisms. ory, providing a portable and robust foundation for reason- The concept of operational logics (Mateas and Wardrip- ing about games, and (b) use as a native authoring language, Fruin 2009), the underlying substrate of meaningful state- rather than as a library or auxiliary tool. change operations atop which mechanics are built, was re- On the other hand, unlike prior executable description lan- cently proposed as a missing but critical component of game guages (e.g. (Dormans 2011; Osborn, Grow, and Mateas design and analysis. In most prototyping tools, there is a 2013)), we retain the planning-like ability to specify gener- Copyright c 2015, Association for the Advancement of Artificial alized rule schema that apply in a multi-agent setting, allow- Intelligence (www.aaai.org). All rights reserved. ing for causal analysis of event sequences. These statements can be made more meaningful after an introduction to the at character location : pred. language, so we postpone further discussion of related work likes character character : pred. anger character character : pred. to a later section. In the remainder of the paper, we illustrate has character object : pred. the semantics and utility of Ceptre through two case studies: depressed character : pred. a generative story world and a skeletal dungeon-crawling ad- dead character : pred. venture game. Next, we specify how the story state may evolve via rules of the form rulename : A -o B, where A and B each have Specifying Mechanics in Ceptre the form p1*:::*pn, where the pis are predicates drawn from the above set. Predicates may contain variables that range Ceptre affords a game designer with three central mecha- over the term type corresponding to that predicate index. The nisms for authorship: (1) a term language in which to de- meaning of A -o B, to a first approximation, is that when- scribe the game’s primitive constructs and predicates that ever the predicates in A are present, they may be replaced range over them; (2) a way to write local state transition rules with B. One example of a rule is: with replacement semantics; (3) a way to delineate and co- do/compliment ordinate separate components of the game with a system of : at C L * at C' L * likes C C' stages. We recapitulate an interactive storytelling example -o at C L * at C' L * likes C C' * likes C' C. used in prior work (Martens, Ferreira, and Bosser 2014) to The name of the rule is do/compliment—we’ll prefix demonstrate how Ceptre programs are structured and inter- our rule names with do/ in this example, by convention. preted. The rest of the rule can be parsed as follows: at C L is a predicate applied to two variables C and L which must have Bird’s-Eye View the types character and location, as specified in the type header. Variables are indicated by starting with a capital let- A Ceptre program is a collection of terms, predicates, and ter, and they are implicitly quantified at the beginning of the rules Σ, along with a specification of an initial state config- rule, i.e. the above rule is really a rule schema that may be uration ∆ . To a first approximation, the execution of this 0 instantiated at any C, C', and L. The logical operators in this program means repeatedly examining the current state con- rule are * and -o, pronounced tensor and lolli. The * op- figuration ∆ (starting with ∆ ), selecting a rule r that ap- i 0 erator conjoins predicates, and -o is the transition operator. plies to a subset S of ∆ , and generating a new ∆ which i i+1 Semantically, this rule gives meaning to a compliment action is ∆ with S replaced by the rule’s consequences S0. The i by saying that whenever a character likes another who shares rules in Σ are unordered, and several may apply, potentially their location, they may generate a resource representing af- giving rise to nondeterminism. fection in the other direction. ... r: S -o S’ Note that because of the replacement semantics of the ... Logic Program initial state rule, we need to reiterate everything on the right-hand side of the -o that we don’t want to disappear, such as the character locations and original likes fact. We use the syntactic sugar S -o S’ of prepending $ to anything intended not to be removed in S S’ ... order to reduce this redundancy: do/compliment 0 1 n : $at C L * $at C' L * $likes C C' -o likes C' C. In the interactive storytelling domain, we can make an A more complex rule describes a murder action, using analogy between program execution and a dramatic pro- the ! operator to indicate a permanent state: duction: the initial state will “set the scene” for the first do/murder act, and the engine itself works as a hybrid playwright and : anger C C' * anger C C' * anger C C' * anger C C' * $at C L * at C' L * $has C weapon stage manager, looking up rules to determine the next scene– -o !dead C'. several of which might apply–then issuing cues to the actors involved. The role of the program author in this analogy is (This rule consumes C'’s location, maintaining a global to describe the means by which one scene can transition to invariant that each character is mutually exclusively at a lo- another. How to do so is described next. cation or !dead.) Here we see a departure from planning formalisms: four instances of anger C C' mean something Predicates and Rules different from one. Here we are using an emotion not just as a precondition but as a resource, where if we have enough First, we need a specification of the primitives and what of it, we can exchange it for a drastic consequence.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us