Centrifuge is a cross-platform visual programming tool that helps users author narrative sifting patterns for character-based simulated story worlds. Sifting patterns search the state of the simulation, looking for matching characters, events, and scenarios. Our goal with Centrifuge was to develop a tool that enables users to craft sifting patterns without learning a text-based programming syntax. Centrifuge is built on DataScript, an open-source in-memory database and datalog-based query language. Users drag-and-drop nodes that correspond to parts of DataScripts query syntax, and Centrifuge takes care of translating their pattern of nodes into a valid query.
The current version of Centrifuge is configured for use with the Talk of the Town simulationist story generator. Talk of the Town was the simulation back-end for the award-winning augmented reality live-acting game, Bad News. We chose this simulation because in Bad News, one player acts as the Wizard. Their job is to find interesting characters in the simulation by manually coding inside a Python interpreter. This manual story sifting is a tedious process and requires knowledge of python programming and the internal simulation structure. Here is an example video of gameplay.
- Install a release build or clone a development version from GitHub (see instructions below)
- Start the application and create a new editor tab.
- Drag node types from the tray on the right, and drop them onto the editor
- Click and drag from ports to create connections between nodes
- Delete node: Click the node to highlight, press delete or backspace
- Delete link: Hold shift, click the link, press delete or backspace
- Click Compile in the 'Output' tab to compile the diagrams into query code.
We use Yarn for package management. Please download it from npm with the following command.
npm i -g yarn
Then you can clone and run Centrifuge.
git clone https://github.com/ShiJbey/centrifuge.git
cd centrifuge
yarn
yarn start
The editor transforms patterns into valid Datascript queries. DataScript is an free & open-source alternative to Datomic. Therefore it tries to offer the same query language features. Below are the features of the query language that Centrifuge does not currently support.
- pull expressions*
- return maps
- Aggregates
- functions**
- get-else
- get-some
- ground
- missing?
- tuple
- untuple
- database scoping
* Datascript JS API doesn't support in-query pull expressions
** We have a prototype function node available, but there is not yet a framework for creating custom function nodes given a set configuration parameters.