Plotly is a rewrite of a “gamebook” style adventure game engine I wrote a long time ago. It saw action in an iPhone app called Plot Theft Awesome 5, a light hearted GTAV cash in. This is a complete rewrite that makes it accessible to PCs, Macs, Mobile (iOS and Android) and web scenarios.
Basics
At its most basic, a game is just a list of Pages each containing Texts to describe the story and Options to enable you to navigate the story. A very basic game can be described as such.
GAME::The Demo|The aim of this game is to get out of the room.|Shaun Pryszlak|1.0|false
PAGE::0
TEXT::You are in a room and you wish to get out of it. There is a door and a chair.
TEXT::You want to get out of there as soon as possible.
OPTION::Try door|1
OPTION::Sit down|2
PAGE::1|WON
TEXT::You open the door and leave the room.
PAGE::2|LOST
TEXT::You sit down in the chair and fall asleep.
Simple as that. The first option takes you out the room and triggers the Win condition and the second leaves you in the room and triggers the Lose condition. The uppercase bits and the :: are important. All tabs, leading spaces, blank lines and comments (starting with an #) are ignored.
For more advanced stories there are Variable, Expression and Condition commands. A Variable contains a value and is either a number, a string or a true/false flag. An expression is something like “x|x+1” which when evaluated adds 1 to x. Finally Conditions are things that evaluate to true or false, “x=2” for example. You can add a Condition to a Text block or option so it is only visible if a certain condition is met. For more details of what an Expression can evaluate see here.
TEXT::You are in a room with a big treasure chest.
TEXT::The key looks like it might unlock the chest
CONDITION::hasKey=True
OPTION::Open door|1
OPTION::Unlock chest|2
CONDITION::hasKey=True
There are also Links, Pre and Post expressions.
For more details see the Plotly Commands page.
Finally there is a file called Character.txt that contains a few variables that can be used to describe yourself. If desired, these can be referenced in the games to make you the star of them. Make it a bit more immersive.
Formatting
You can also do some fancy things with the text. Typically all the Text blocks form one long paragraph which is all one colour and style. You can add special codes to add colour, paragraphs, bold, italic, etc.
- *BOLD_ON* makes the following text bold.
- *ITALIC_ON* makes the following text italic.
- *NL* splits any following text into another paragraph.
- *variable name* displays the value of the variable. Mainly just for numbers and strings.
- *RED* makes the following text red. Similar format for *GREEN*, *BLUE*, *CYAN*, *YELLOW*, *MAGENTA and *GRAY*. The game itself is either black on white or white on black.
See the example game for exact usage.
The idea is that the game can be run on any platform and the output will be adapted to match the device. Currently we only have the command line version which can do colours but not bold or italic. A mobile version would probably be based on HTML and therefore display all the styles. As a games writer you don’t really have to worry about what device does what.
