CSci 658: Software Language Engineering
Adventure Game SCV Analysis

H. Conrad Cunningham

25 April 2018

Scope

We limit the scope of our adventure game DSL and semantic model as follows:

Issue: So far, we have not handled actions and their consequences sufficiently precisely to specify the commonalities.

My example: Wizard’s Adventure Game from Land of Lisp that I reimplemented in Elixir.

Terminology from OO Analysis

This is modified some from in-class analysis.

Toward Commonalities

  1. A world has a finite but unbounded collection of distinct locations (0 or more).

    Note: I added “distinct” and “unbounded” parts after class.

    Issues:
  2. FOR DISCUSSION: The collection of locations in a world cannot change after configuration.

    Issues:
  3. Each location has a unique name separate from its description.

    Issues:
  4. FOR DISCUSSION: A location’s name cannot change after configuration.

    Issues:
  5. Each location has a description.

    Issues:
  6. FOR DISCUSSION: A location’s description cannot change after configuration.

    Issues:
  7. A world has a possible directed connection between any pair of locations in the world. The actual connections present are a subset of this set.

    Issues:

    Note: We are thinking about the world being modeled by some kind of graph structure. These issues and those for locations explore the nature of that graph.

  8. FOR DISCUSSION: The collection of connections in a world cannot change after configuration.

    Issues:
  9. A connection does not have a separate name.

    Issues:

    Assumption: Given the above assumes a simple digraph model, a connection can be identified by the pair of nodes it connects and its direction. Its description can also provide additional differentiation.

  10. Each connection has a description.

    Issues:
  11. FOR DISCUSSION: A connection’s description cannot change after configuration.

    Issues:
  12. FOR DISCUSSION: A world has a finite but unbounded collection of distinct items.

    Issues:
  13. FOR DISCUSSON: The collection of items cannot change after configuration.

    Note: I am unsure about the choice here.

    Issues:
  14. FOR DISCUSSION: Each item instance is atomic.

    Note: I am unsure about the choice here, but probably okay.

    Issues:
  15. FOR DISCUSSION: Each item has a unique name. The name cannot change after configuration. (Break into 2 statements?)

    Note: I am unsure about the choice here. Perhaps we just want a type name like “bucket” rather than “bucket1” and “bucket2”. Or maybe we need both kinds of names.

    Issues:
  16. FOR DISCUSSION: Each item has a description. The description cannot change after configuration. (Break into 2 statements?)

    Note: I am unsure about the choice here. We may not need this for the game.

    Issues:
  17. FOR DISCUSSION: Each item has a position at any point in time. The position may change during the game. (Break into 2 statements?)

    Issues:
  18. FOR DISCUSSION: A position is any location (name) or a player inventory.

    Issues:
  19. FOR DISCUSSION: The world has a finite but unbounded collection of distinct state variables, each of which has a unique name, a set of possibly participating items, and a set of possible states.

    The parts about possible participants and possible states may not be quite what is needed.

    In the Wizard’s game, these are states like the the chain and bucket being welded together or the bucket being filled (with water).

    Do we have multiple state variables with the same name but different participants?

  20. FOR DISCUSSION: There is one human player and no similar automated players.

    Issues:
  21. FOR DISCUSSION: Each player has a unique current location in the world.

    Issues:
  22. FOR DISCUSSION: Each player has an inventory of items being held.

    Issues:
  23. FOR DISCUSSION: The world has a finite but unbounded collection of actions. Each action has a unique name, a subject, an object, a transformation of the world, and a result.

    This is too vague and imprecise. Not quite right!

    What about builtins like look, walk, inventory?

    Are these in scope of configuration?

Toward Variabilities

  1. What locations in collection. Each location’s name and description.

  2. What connections in collection. Each connection’s source and target locations. Each’s description.

  3. What items in collection. Each item’s name, description, and current position.

  4. What items are in the player’s inventory.

  5. What state variable in collection. Each’s name, list of possible participants, and possible states. Each also have a current list of participants and current state.

  6. What are the actions?

Toward a Possible Semantic Model (Python)

Underlying model is a digraph with “labels” (data) on each node and each edge. Here I use something like a node adjacency list structure.

Toward a Possible External DSL

Here is a rough grammar for a possible external, text-based DSL:

LDESCRIPTUIN and CDESCRIPTION are probably quoted strings.

LNAME, INAME, VNAME, and SNAME are probably identifier-style strings that are not keywords. They can probably have separate namespaces for each kind.

The keywords are location, connection, item, in, and inventory. Open and closed parentheses and commas are also terminal symbols.

We are not handling ACTIONS here. State variables are probably not correct.

Toward a Possible Internal DSL (Python)

For discussion.