The simplest model I've come up with for a story generator is, literally, a set of cards. The cards are divided into five kinds, and correspond to the idea of "plot atoms", or small sets of plot atoms, in my first slide presentation:
- Event Cards: provide reasons for stories to occur (think of them as "world states")
- Hook Cards: provide game events that draw the player into a story (e.g. an NPC with a "?" floating over her head is the crudest kind of hook)
- Challenges: things the character must accomplish to complete the story; some are labelled as potentially final.
- Positive Outcomes "rewards" are the things the player is offered as an incentive.
- Negative Outcomes "punishments" consequences of failing (or refusing) to engage in a story.
The mechanic is simply:
- pick an event,
- a hook,
- then draw challenges until you get a final challenge (and, say, flip a coin and get "tails").
- draw a positive outcome for success
- and a negative outcome for failure
This works surprisingly well for a human GM devising a storyline or two for an ongoing role-playing game. Some combinations are ridiculous but could be rejected using fairly simple filters (e.g. a given event could specify classes of hook, and so on).
The question is how to turn this into computer game mechanics that could be executed by a machine.
E.g. when you get a quest in World of Warcraft it's something like:
Wolves have been attacking our livestock, and sometimes even children. I'd like you to patrol our fields, kill five wolves, bring me their pelts, and I'll give you a mallet of mayhem as a reward.
This is about as simple as most "quests" get, we could classify this as:
- Event: faction suffering attacks in location from target belonging to other faction
- Hook: player hired by patron from faction
- Challenge: Collect n tokens (tokens are received when you kill target)
- Success: Receive Item (also typically experience and standing with faction)
- Failure: No penalty
Complexity immediately arises when you start thinking of this as a simple "fill in the blanks" problem. The event concept can provide a reason (and even a description of that reason), but let's suppose you're wandering around a village and bump into the local burgher or squire (or whatever the village leader is called), how might all this work?
First, let's assume that there are two factions in the world wolves and villagers. The wolves and the villagers pretty much hate each other.
The villagers control the village, while the wolves control the forest and den. The fields that surround the village, and the woods that skirt the forest are contested. The connections are:
den ↔ forest ↔ woods ↔ fields ↔ village
And finally, let us establish that the pack leader has a magnificent pelt, the adult wolves have a pelt, and the pups have a small pelt.
There are specified members of the factions, e.g. the wolves faction has a pack leader who is unique, and non-unique adult wolf and pup members, and the villagers have, say, a unique burgher, priest, innkeeper, and smith and non-unique peasant and child members.
The story engine needs to be able to ask the world questions such as:
- Q: where is the player? A: village
- Q: who controls the village? A: villagers
- Q: who among the villagers faction can be a patron? A: burgher, priest, innkeeper, smith
- Q: what enemies do the villagers have? A: wolves
- Q: where are wolves found, and how far away are they? A: fields (1), woods (2), forest(3), den (4).
- Q: who are the wolves and how important are they? A: adults (1), pups (2), pack leader (3, unique)
- Q: what things do the villagers have or make that they can offer as rewards, and how valuable are they? A: innkeeper makes beer (1), smith makes mallet (2) and sword (4), burgher has money (1)
It follows that the simplest story engine must be able to request these kinds of information from the game universe. In concrete terms, the Universe must implement an interface and expose it to the story engine.
Now, once the player engages with the story, the engine needs to keep track of progress and cause things to happen in the game world (more interface requirements).
This is a very simple case the player merely needs:
- to encounter sufficient targets to complete the quest (either the game world must promise this will happen, or the story engine must have a way of telling the game world to spawn the target(s).
- to determine where the player is (e.g. current location) so as to provide hints (optional!)
- to determine the player's current state (e.g. number of wolf pelts collected) so as to provide hints (optional!)
- to find out when the player has handed over the requisite items to the specified NPC. (I.e. the world must trigger events within the engine.)
- to give the player the reward. (The engine must be able to tell the engine to give the player a specified item.)
Note that a lot of this complexity emerges purely because the story engine does not of itself know anything about the game world. It follows that even a simple "quest engine" is necessarily quite a bit more complicated than the static quest system as seen in most RPGs.
Despite this simplicity, these missions almost never have a time limit, success has no impact lasting or otherwise on the world (even if you kill 50 wolves the attacks do not abate), there's no time limit, and no-one thinks worse of you if you fail or worse renege on your commitment.
Also consider the usual experience a player has completing such a quest. If the player kills the pack leader during the initial quest, the pack leader might drop an ordinary pelt or no pelt at all. The player then returns and receives a follow-up quest to kill the pack leader. A better system might reward the player's initiative in the first place ("wow, you killed the pack leader instead of the mallet of mayhem, you might prefer the sword of slicing").
Even worse, of course, is that the pack leader respawns. The system could simply change the name of each pack leader, or spawn unique pack leaders on demand. Or, once you've killed a given "unique" NPC that NPC no longer looks like the unique NPC any more (it just becomes an unusually tough regular NPC). None of these issues is as prevalent or important in a single player game, but still.
It is possible for very good hand-made quests to address all of these issues. Best of breed CRPGs, such as Fallout 3 and Skyrim do a good job for a few key quests, but by and large this lack of real dynamic storytelling in CRPGs means that they frequently fail to rise to the level of bad cartoons, let alone literature.
Now consider how much more sophisticated the stories could be if we can just get something simple working. One obvious idea is for events to be "won" or "lost" or for them to evolve into other kinds of events.
E.g. if the players kill a lot of wolves, it might benefit the rabbit faction which in turn leads to a plague event which in turn causes a famine event in the village.design markdown 11/11/2014 13:45:35