ckolderup/picaro — Issue #3: JSON spec
Author: ardubs
Created: 2012-01-24 05:02:03+00:00
State: open

Had some ideas to throw out for additional things that might be useful to include in our initial spec. Some of them may be v1.5 at best, but figure it's best to get them down. What's already there is pretty expressive, so I don't think we need all that much.

For v1.0 / ASAP:

- A starting room property. Not sure if you'd want to do this as a boolean property of a room or as a global flag that points to a certain room name, but we should probably have this in there somehow.

- Don't know where this should go, but we need a way to signal that a story is over. David suggested being able to spin this as positive or negative with green/red text, which I think is a great idea. So maybe there's a "spin" property within whatever form the endgame condition takes.

- Multiple object states. The need for this is visible in Joe's demo game when you try to elbow-drop the coffee table twice: there's no way for it to say something different the second time, when in the player's mind it's become splinters. My suggestion for this is (I believe) stolen wholesale from ZZT: you allow multiple instances of an item in the script, like so:

{"Name": "Coffee Table", "ElbowDrop": ["You elbow drop that mess. Wood flies everywhere.", "It's a pile of splinters now, you'll just hurt yourself."]}

...so if a given item has a verb property that's been assigned a list rather than a flat string, the interpreter knows to increment over to the next member of that list if/when the coffee table gets elbow-dropped. There may be a much more elegant way to do this, but that's one option.

More advanced:

- Counters. Consider a general-purpose way to increment and decrement variables within the story environment. Where we currently have "items" and "room" list properties, let's say we add one called "counters." It looks something like this:

"Counters" : [
{"Name": "applesCollected", "initialValue": 0, "endgame" = true, "endgameValue": 20, "endgameSpin"; "positive"}
]

and then up in "Items":

{
"Name": "ripening green apple",
"Take": "true"
"takeCounter": ["applesCollected", 1]
},
{
"Name": "mouldering emerald apple",
"Take": "true"
"takeCounter": "applesCollected"
},
... etc.

This gives you a counting concept that you can use, in this example, to end the game when the player collects 20 apples. There's a counter called applesCollected that the interpreter knows to increment by 1 when an apple is taken. Alternatively you could make a mafia game where the object is to shoot four snitches, and the same principle/affordances of this model would apply.