This is a minimalist framework for writing / playing through (non-linear) stories.
If you like this, consider supporting further development!
Have a look at the example story to see the format.
A Story Adventure is primarily a set of Sections together with a State representing the current (initially the starting) state. The State can also hold variables that you can set initially (e.g. for consistent naming of entities) or change during the game.
Sections links to each other via Choices in the .next
array of each section. Sections without choices are terminal.
Sections can also contain Media, with a type (image/video) and the link to the src. This can also be embedded as a data link.
Embedding Media has the advantage of creating an all-in-one file, but the obvious disadvantage of creating large files with inefficient encoding of binary data.
Choices may contain a description which is then actually displayed as a choice when playing through the adventure. If you leave the description empty, it is just a "next" type button to break long sections into readable chunks/change grafics. You likely do not want to do this if there is more then one choice.
Using the editor you can write your own story adventures by providing text and media for each section and linking the sections by choices.
- Files never leave your computer, the editor is pure JS running in your browser
- Try at: https://echsecutor.github.io/story_adventure/editor
Using the viewer you can play thtough any story adventure.
- Files never leave your computer, the viewer is pure JS running in your browser
- Try at: https://echsecutor.github.io/story_adventure/viewer
We proudly acknowledge using the following open source components in this project:
- Bootstrap 5 for UI components
- Cytoscape.js for drawing the story graph in the editor -cytoscape-klay for the graph layout
- marked for Markdown rendering in the viewer
- DOMPurify for HTML sanitization in the viewer
- JSZip for zipping (bundle export)
- file-saver for large files directly from the browsers memory
- esm.sh for converting the old JS packages among the above into esm modules
See there for the corresponding licenses and meta-dependencies.
Copyright 2024 Sebastian Schmittner
All code published in this repository is free software. Everything written by me, i.e. excluding the dependencies mentioned in the Acknowledgment, can be redistributed and/or modified under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
For the included open source projects, different licenses might be applicable. See the respective projects pages listed above for details.