Observability
This is a tool written in Go that allows you to visualize the routes of your Ren'Py story
Routes of the Question, the classic Ren'Py example
Doki Doki Litterature Club will no longer have secrets for you!
An extract from my personal VN, Coalescence. You can't imagine handling a heavy VN like this one without graphic tools... The labels are blurred due to the preview image
You can test this tool in the browser. If you want to get .png
files, please download the software version. Note that this website will not be maintained and it is not guaranteed to represent the library fully.
https://ewenquim.github.io/renpy-graphviz
The command line version is more powerful as you can add flags and a path, see the documentation by typing renpy-graphviz -h
.
./renpy-graphviz
or by clicking on the icon in your file manager
chmod +x renpy-graphviz*
.renpy-graphviz.png
should appear, enjoy!Use the boolean flags only in -flag=value
format, not in -flag value
format, e.g. use ./renpy-graphviz -open=false
.
go install pkg.amethysts.studio/renpy-graphviz@latest
If you are a Go user and want to integrate this in a Go lib/program, it is possible. The /parser
module is very powerful.
Since Ren'Py scripting isn't strict, therefore the script can't know what is going on in the .rpy
file in some cases. So, this program uses a tag system to enforce some behaviors. For example;
label chapter_1: #renpy-graphviz: TITLE
Before tags, you must write renpy-graphviz
in a comment to ensure there are no collisions with existing words in your VN. Here are the tags available:
Cancels any "guessed link".
Expected | with BREAK | script.rpy |
---|---|---|
|
Ignores the current line. If this is a jump to a label that isn't ignored, the label will still appear on the graph but not the arrow that should go towards it. Similarly, if this is a jump from a label that isn't ignored but the jump destination is, the arrow will not appear on the graph.
Expected | IGNORE | script.rpy |
---|---|---|
|
Avoids long arrows by creating another label with the same name. Beware, the label can't have any children and is marked by an asterisk to show it is a copy. Jumps will not be directed to this label if there is an original label displayed, if not, the jump is ignored.
Expected | SKIPLINK | script.rpy |
---|---|---|
|
Creates a node or an arrow in the graph without having to create a label
in your Ren'Py script. It is disconnected from the normal flow, label
and jump
in your script.
FAKES | script.rpy |
---|---|
|
Same as above but interacts with label
, call
and jump
in your normal flow in the Ren'Py script.
You need to specify an indentation level.
# renpy-graphviz: INGAME_JUMP(8, destination)
is the equivalent of:
jump destination
INGAMES | script.rpy |
---|---|
|
Sets styles.
TITLE / GAMEOVER | script.rpy |
---|---|
|
You can set yourself a custom color or shape for a label.
SHAPE and/or COLOR | script.rpy |
---|---|
|
Some examples of shapes and colors can be found here.
Shapes | Colors |
---|---|
Rectangle | Red |
Septagon | Blue |
Egg | Purple |
Diamond | White |
graph.go
file also supports line styling, font size and line thickness. Default values can also be changed inside the graph.go
file.
This requires your VN to be structured in a certain way, so this may not be perfect for you. Feel free to raise an issue here, or to change your VN structure, by adding tags manually.
Your contribution to the project is appreciated!
See the CONTRIBUTING.md file
This program is free and under the AGPLv3 license.
Beware, if you use this program, you must credit it somewhere on your game.
Used Renpy Graph Vizualiser from EwenQuim
Enjoy! ❤️