In the past I’ve written a tiny bit about my RPG Parser software that I use to store game data and insert it into templates and pages. I’ve recently rewritten it while I was working on playtesting character sheets for the compendium classes in Binding World.
The new RPG Parser code works in two parts: Data and Pages.
The Data Parser
Data takes all of the individual JS and Markdown files – each representing something in the game like a move, class, or tag – and puts them into a single gameData object that is saved as JSON.
Here’s the early stages of the file structure of the game data:
The file and folder structure is what determines where the data goes in the gameData object that the parser creates. All the information in game_data/classes/bloodbinder/index.js will be put into gameData.classes.bloodbinder. The .moves folder will ignore the folder they are in and go directly into gameData.moves
Here’s the contents of the bloodbinder/index.js file:
The starting_moves and advanced_moves lists are all references to moves. The move data isn’t stored directly in the classes, but they are replaced with the full move data during the parsing stage so I can reference classes.bloodbinder.starting_moves.name to get the name of the first starting move.
The Pages Parser
The Pages parser takes XML documents that reference the game data with tags, inserts the real values, and exports them into multiple formats for InDesign, websites, GitHub, etc. The Parser uses the Mustache templating engine. I have a script for each output and am starting with the InDesign one. Here’s a sample page I’m working with:
This file is put through the Pages InDesign parser and gives me this:
Next I’ll be working on some basic InDesign printable sheets for the compendium classes of Binding World using these two parsers. Hopefully I’ll be able to do some playtesting with them soon. More upgrades will come to the software along the way.