Hello. I created an account and introduced myself on this forum almost 2 years ago, but have not posted anything since. I did lurk a bit though (as I have, mostly, lurked on the usenet groups before that, on and off since 1995).
Gamebooks and tools to make them are sometimes discussed on this forum (I refuse to talk about them as CYOA after reading some actual CYOA books) so I thought someone might be interested in this open source tool I created last year to help me create such books:
github.com/lifelike/gamebookformat
It is a python script that reads a gamebook file with some simple markup. Output can be a gamebook as LaTeX, RTF, plain text, HTML for instance. Or you can generate playable HTML with JavaScript that lets you play/read in a browser, keeping track of stats and inventory, allowing you to disable choices not available (eg not being able to open a door without the right key or whatever). I have read many gamebooks, studied even more, trying to include enough features to implement most of them. The main thing lacking is a combat system (not that all gamebooks need one, right?).
Paragraphs are given symbolic names, and the paragraphs are shuffled and numbered automatically. The numbers used are saved to a separate file so the same paragraphs can be given the same numbers again when you re-run the script (trust me, that makes incremental development/playtesting a lot easier).
Why yet another format, you ask (or should ask)? Well, I started because I wanted to make paragraph-driven boardgames, so I needed nice printable output, plus some features that makes it easier for me to integrate with a printed board. I also wanted something that would play well printed on paper and played on a computer/tablet/smartphone. While the format supports adding some logic to the books, I have tried very hard to make the results always playable also in a printed version (or if you want to read the PDF on a screen; it has clickable links to take you between paragraphs, but of course no other logic). For instance I have avoided any feature, like optionally displaying text, that simply can not work in a printed book. That was the main problem I had with existing solutions I could find, that in the rare cases they supported static printable output it seemed more like an afterthought and relied on carefully using a subset of the tool. Or the tools only could create a static book, no playable digital version at all. There were probably some tools I did not see, but anyway NIH is always a strong reason as well I guess.
It is easy to add templates for more output formats, or add new tags to existing formats, for instance if a book needs some special âmacrosâ or formatting and/or scripting. I made a quick attempt at creating some Twine output, but there were some of my tags that were not trivial to translate to that format, so I put that project on hold for now (it felt a bit redundant too because I already export directly to HTML+JS, but since I have not spent much time making nice CSS for my HTML Twine would have been a nice shortcut to get much prettier results).
Here is an example file:
bgg.gamebook
And this is what the output looks like:
PDF
HTML
PNG (flowchart)
JSON (section-number map)
Not going to bother anyone much about this. Itâs mainly for my own use, for games/gamebooks I want to make. But if it happens to be useful to someone I would be happy to discuss it and accept patches and/or discuss future updates.