I’ve been working the past few days to change the way actions are represented in Curveship. The previous model for actions is described well in sections 5.1.3 and 5.1.4 of my dissertation. I won’t go into it in any detail here, but it involved two sorts of abstractions (one higher-level and associated with intention and narrating, the other lower-level and used directly in the simulation) and was considerably more complex than what I have in the current system.
I will mention something about why actions are represented in the system at all – that is, with first-order representations, objects. This is a departure from the way IF systems have worked up to now. In other IF systems, when you “get lamp,” you change the state of the world. The lamp object has a different parent when you are done with this action. But there is no object representing the action itself, the adventurer getting the lamp. As you can tell from playing IF, this works fine if you want to stick to one character and narrate what is happening exactly once, as it happens.
Having a representation of action, on the other hand, allows for much more flexibility in narrating. One can narrate an action in flashback (because it’s still there, represented as an object) and can easily maintain lists of actions for each character, to represent what each specific character is aware of. In Curveship, these are kept in “concepts” which are theories about the world that are almost always incomplete and can even be wrong. Since all actions are reversible, the representation of actions also provides an infinite “undo” capability.
So, the action representation now simply provides actions of four types:
- Behave – Any action that doesn’t change the world, from speaking to jumping up and down.
- Configure – An action that causes an item to be moved to a new place, or to be in a new relation, in the item tree. (“get lamp” is an example.)
- Modify – An action that causes an item to change state, to have one of its features take on a new value. (“light lamp” is an example.)
- Sense – A perception of the world which does not change the world but may update a character’s concept.
For instance, this is the code that maps the command “get lamp” (or “get” followed by anything) into a particular “take” action, which is a configure action:
def take(agent, tokens, concept):
return Configure('take', agent,
template='[agent/s] [pick/v] [direct/o] up',
direct=tokens, new=('of', agent))
“take” is the verb and agent the agent; all Actions must have these two. The template is optional. It specifies the string-with-slots that is to be used in representing this action. All configure actions have a direct object, the item being configured, and need at least a “new” keyword specifying the link and parent that item will be in. Here, it’s “of” (indicating possession) and the agent (the one who is doing the taking.)