MCPcopy Index your code
hub / github.com/EwenQuim/renpy-graphviz

github.com/EwenQuim/renpy-graphviz @v2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.0 ↗ · + Follow
35 symbols 92 edges 18 files 15 documented · 43%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Ren'Py graph vizualiser

Go Reference Go Report Card GitHub Workflow Status

This is a tool written in Go that allows you to visualise the routes of your 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 personnal VN, Coalescence. You can't imagine handling a heavy VN like this one without graphic tools... (the labels aren't blurred on the real image)

How to use

  • Download latest version
  • Move the program in your game folder
  • Run it from the command line
  • you might have to give yourself the permissions: don't worry my program isn't a virus ! Run chmod +x renpy-graphviz*
  • renpy-graphviz.png just appeared, enjoy !

Advanced usage

Tags

I made a tag system to enforce some behaviours. For example

label chapter_1: #renpy-graphviz: TITLE

Before tags, you must write renpy-graphviz to ensure there are no collision with existing words in your VN.

Here are the tags available

  • TITLE: style for chapters
  • BREAK: breaks the current flow, for parallel labels for example
  • IGNORE: ignores the current label. Jumps to this label still exist
  • GAMEOVER: style for endings
  • SKIPLINK: avoid long arrows by creating a "shortcut" - read the doc below before using

Case, spaces and separators are handled very loosely, don't worry about it.

TITLE & GAMEOVER

Set some styles

Example of GAMEOVER & TITLE tags

BREAK

Cancels any "guessed link".

label one:
  "blah blah"

label two:
    "bla bla"

# renpy-graphviz: BREAK
label three:
    "the end"

without tag with tag

IGNORE

Ignore 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.

SKIPLINK

Avoids long arrows by creating another label with the same name. Beware, the label can't have any children and is marked by an asterix to show it is a copy.

label one:
    if condition:
        jump six # renpy-graphviz: SKIPLINK
    else:
        pass

label two:
label three:
label four:
label five:
label six:
without tag with tag

Limitations

This require your VN to be structured in a certain way, so it's possible that it isn't perfect for you. Feel free to raise an issue here, or to change your VN structure.

The program works only for scripts that do not stack call statement, i.e. the program expects a break statement before any other label/call if you used call to get there.

Works:

label start:
  eileen "hello"
  call second
  eileen "I'm back"

# renpy-graphviz: BREAK <- recommended here but not mandatory, see Tags section
label second:
  eileen "inside a CALL statement"
  break <- works !!!

Does NOT work:

label start:
  eileen "hello"
  call second
  eileen "I'm back"

# renpy-graphviz: BREAK <- recommended here but not mandatory, see Tags section
label second:
  eileen "inside a CALL statement"
  call / jump third_label <- Isn't taken into account !!!!

label third_label

LICENSE

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!

Core symbols most depended-on inside this repo

GetRenpyContent
called by 4
parser/filehandling.go
initializeDetectors
called by 4
parser/regexes.go
Graph
called by 4
parser/parser.go
String
called by 4
parser/graph.go
update
called by 3
parser/parser.go
AddNode
called by 3
parser/graph.go
AddEdge
called by 3
parser/graph.go
handleTags
called by 2
parser/tags.go

Shape

Function 19
Method 9
Struct 6
TypeAlias 1

Languages

Go100%

Modules by API surface

parser/graph.go9 symbols
parser/regexes.go3 symbols
parser/parser_test.go3 symbols
parser/parser.go3 symbols
parser/utils_test.go2 symbols
parser/tags.go2 symbols
parser/graph_test.go2 symbols
parser/filehandling.go2 symbols
readDotFileToDrawGraph.go1 symbols
parser/utils.go1 symbols
parser/tags_test.go1 symbols
parser/regexes_test.go1 symbols

For agents

$ claude mcp add renpy-graphviz \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page