Choose Your Adventure
It is data-driven so very easy to create any new adventure. I built it to "digitalize" a game book I was reading/playing, but as it has copyright I keep for myself the data file, and instead provide a sample adventure with all available features (to run it, specify
?adventure-file=demo at the querystring).
You can see an online working demo at https://kartones.net/demos/021/?adventure-file=demo.
demo). I won't dig into details of the file format as it is quite easy to read and understand so go and check the sample adventure file at data/demo.js.
What I will detail are the choices of "pages" or locations, and the actions with which you can build the adventures.
Each location has a numeric key identifier, and contains a
type and zero or more
text field allows any kind of HTML (no cleaning is done, so careful what you put inside), except for images which are represented by the special markup
[[image-url]]. It must be a single line without line breaks so using
<br/> is advised.
normal: A normal location/page/scenario. Should contain 1 or more actions, but currently there are no checks nor limits on their amount.
gameover: "Death" path. This ends the current game (except if you cheat), and doesn't allows definition of actions as it will provide just one to start a new adventure.
- 'ending': "Success" path. This ends the current game, and doesn't allows definition of actions as it will provide just one to start a new adventure.
Each action must define a
null for those where is not used) and a
goto: The most common action, specifies a location identifier to go to if the user chooses it. If no
textis specified it will place a default one (
location-input: This action displays a text input and a button. The user can input anything on it, but only the specified location identifier is correct and will trigger an action (going to that location). It is useful for riddles, secret paths or non-linear paths.
goback: This action will always send back the user to the previous location it came from if chosen. It is useful to create a destination location where multiple locations point to, without the need otherwise of creating a single "go back to XXX" action per source location.
Any other type of action will default to a "missing link" one, displaying the specified text but with a red message saying that there is no link. This is both to avoid errors and when playtesting paths to quickly see which ones are not yet build/written.
It is still a work in progress, as I haven't even finished converting a full book, so new rules and changes might still arise.
The initial plan is:
- Fully convert a "Warhammer 40,000 gamebook" (I'm using "Hive of the Dead") and implement its rules. I won't publish the "book data", just build the engine.
- Check another "Warhammer 40,000 gamebook" that I have to be sure rules are compatible and generic enough. Optionally convert it (depending on my available time to transcript ~200 pages).
- Check other classic Choose your own adventure books and implement their rules
- Fully convert one classic adventure book
- Check other similar systems and extend the engine?