Story Format

This article is a proposal for a file format for interactive story content in PARPG. It follows on from [Proposal:Story Engine] which describes the overall framework.

= WORK IN PROGRESS =

Quick overview
An event has a set of preconditions (things that must have happened beforehand) and a set of postconditions (things that should be done afterwards). Each event can have a title, a set of people involved and a description. The description is used to inform the player (in words) about what is happening; it could be the dialogue the player says, it could be a description of what is happening ("The box hums." or "Die traitor!"). The description is what appears in any dialogue tree that is shown by the game.

For example: Save princess quest --- "John": 'I will save you princess! ' . Beforehand: - "princess kidnapped" and "health" of "john" greater than 5. Afterwards: - combat between "John" and (guard). - add journal entry for 'I said I '' d rescue the princess.'. - begin "princess rescue plot arc" with "princess guard" as (guard).

Each story event in the file is separated from the others by a blank line, which it might helpful to think of as marking a paragraph. Story events can be grouped into story arcs (and story arcs can contain other story arcs). Individual events in a story arc can share a cast of characters, and props (the explanation of why you'd want to do this will have to wait for later), and some pre- and post-conditions. When a story arc has pre-conditions, those pre-conditions must be met for every event in the arc. For example, if "princess is alive" is a precondition for the whole arc, then every event in the arc depends on the princess being alive - if she dies the whole arc becomes unavailable.

The most useful pre-conditions are in the form of pre-defined sentences supplied by the game not the story engine. For example, the game might say that it can answer a question like "%% is alive" where the story writer is invited to supply a name for %%; you might write: "John" is alive. These can be pairwise relations, so another possible sentence would be "%% has met %%"; the story writer might write: "John" has met "Alice".

Post-conditions take the form of instructions, and the most useful are again are supplied by the game as pre-defined sentences. A possible sentence might be "Add to the journal: %%" and the story writer would write: Add to the journal: 'Got a quest to rescue the Martian king'.

Story events
The layout of a story event is as follows (parts in bold are keywords): Event title --- Actors to targets: 'Description of event that takes place ' . Beforehand: - A thing that must be true beforehand. - Another thing that must also be true beforehand. Afterwards: - Something that must be done if this event occurs. - Another thing that must be done if this event occurs.

In choosing names and descriptions, the writer has complete freedom. Names are enclosed in double quotes, and descriptions are enclosed in double quotes. So for example if your character is called John, in the story file you will always write "John".

The rest of the format offers less freedom. Titles can contain any word or phrase which is not reserved, which means that its already being used for something in the format, and the parser isn't smart enough to work out that it's reading a title. Since only story authors see the titles (and not players) this shouldn't be a real problem. A list of reserved word and phrases is:


 * a, afterwards, an, and, as, beforehand, begin, cast, either, forget, happens once only, has happened, here, insert, not, or, props, remember, to, with, xor

If you want to include quotes and apostrophes, you'll need to double them up (so "John '' s car" rather than "John's car") - this is again because the parser isn't smart enough to know the difference between nested quotes, or between apostrophes and quotes.

Plot Arcs
The layout of an arc description is: Arc title ========= Cast: characters. Props: objects. Beforehand: - A thing that must be true beforehand. - Another thing that must also be true beforehand. Afterwards: - Something that must be done if this event occurs. - Another thing that must be done if this event occurs.