I made a routes analyser - visualise your project with a graph!

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
User avatar
Amethysts
Regular
Posts: 41
Joined: Thu Aug 23, 2018 1:17 pm
Projects: Coalescence
Skype: amethysts-studio
itch: amethysts
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#16 Post by Amethysts »

For the last piece of code you shared:
You're right, the graph doesn't indicate where there is a lot of text, and where there is none or just a few...
It's actually a hard things to do ! Also, it could be very messy to display things like this... even from a design point of vue, it's not an easy question to determine how to do it.

To be fair, I'm trying to make a general tool, your project does not look like every other project (I mean it in a good way don't worry), sorry I think I will not help you any further :/

But thanks so much for testing it, and I hope it helps a bit more when I add the sub-label functionality! :)

User avatar
Donmai
Eileen-Class Veteran
Posts: 1958
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#17 Post by Donmai »

hell_oh_world wrote: Fri Mar 05, 2021 2:45 pmWrong section though
Well, considering that the name of this section is "Questions and Announcements", then here is the correct place.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Amethysts
Regular
Posts: 41
Joined: Thu Aug 23, 2018 1:17 pm
Projects: Coalescence
Skype: amethysts-studio
itch: amethysts
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#18 Post by Amethysts »

Ocelot wrote: Tue May 04, 2021 10:45 am One problem I found: it appears that it does not work with sublabels:
This is fixed on the last version ! :D

Also, I added a new feature to help handle data-driven games ;)
Here: https://github.com/EwenQuim/renpy-graph ... ke_jumpa-b

You can try the online version if your project is public on GitHub here: https://renpy.amethysts.studio
Or download it here otherwise: https://github.com/EwenQuim/renpy-graphviz#how-to-use

User avatar
Amethysts
Regular
Posts: 41
Joined: Thu Aug 23, 2018 1:17 pm
Projects: Coalescence
Skype: amethysts-studio
itch: amethysts
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#19 Post by Amethysts »

New release, sorry for the up but this is a real improvement.

Image

- SUPPORT FOR SCREENS
And you can deactivate it if it is not relevant to your project

- EVEN MORE INTELLIGENT ALGORITHM
Can detect almost every pattern (there is still work to do but honestly this feels almost natural, you can just use the program without touching anything)

- COLORS and SHAPES
You can customize as you wish

- CONFIGURATION FILE
You can control the program's behaviour even without the command line, by modifying the `renpy-graphviz.config` file


There is still more to come. The main goal is: you run the program, and it explains everything to you. If you enjoy the project, go check https://github.com/EwenQuim/renpy-graphviz and leave a star ! :D

User avatar
henne
Newbie
Posts: 17
Joined: Tue May 25, 2021 6:10 am
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#20 Post by henne »

That looks like fun :O

Is there some kind of maxium it can work with?

User avatar
papillon
Arbiter of the Internets
Posts: 4107
Joined: Tue Aug 26, 2003 4:37 am
Completed: lots; see website!
Projects: something mysterious involving yuri, usually
Organization: Hanako Games
Tumblr: hanakogames
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#21 Post by papillon »

Sounds like a neat idea - I don't know if it'll actually work on my spaghetti or not yet but I'm posting here partly to remind myself to examine more later :)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#22 Post by Imperf3kt »

I'd be interested to see how this handles something with next to no story but infinite possibilities. Must remember to give it a try tonight on my Blackjack game lol. In that I use labels and menu statements to control game flow.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Amethysts
Regular
Posts: 41
Joined: Thu Aug 23, 2018 1:17 pm
Projects: Coalescence
Skype: amethysts-studio
itch: amethysts
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#23 Post by Amethysts »

@henne There's almost no maximum. I tried it on VNs with 200k lines of code and it creates the graph in 2/3sec: for more than 200 labels, it struggles a little (mostly because of the .png generation: it will be huge). But for almost all VNs, it works under a second !

I tried to handle errors (that may happen) that happens if your VN isn't structured like my tool would like, but that's very rare and the program will give meaningful explanations to try and fix it without changing the behaviour in Ren'Py. Also, you can create fake labels in comments (see TAGS) if you want a bubble with some text in it without having to create a real `label` in Ren'Py. So don't worry about limitations haha. (but I'm still interested if you have ideas to make this tool better!)


@papillion and @Imperfekt uuh it works well with stories, and now with screen support, it can handle (some) data-driven games too.

The only thing that can kill my lil program ( :sad: ) are `if/else` statements controlled by variables. I try to handle this but my tool only perform static analysis, so that's super hard... Now my program will try draw the lines anyway, it will just not understand what is happening for real (but you can guess)

User avatar
Amethysts
Regular
Posts: 41
Joined: Thu Aug 23, 2018 1:17 pm
Projects: Coalescence
Skype: amethysts-studio
itch: amethysts
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#24 Post by Amethysts »

@Imperf3kt here it is with your BlackJack game (I decompiled it, sorry).

Image

Honestly I don't know a lot about BlackJack but it seems neat, doesn't it ?

I might work on this tool a bit more in 2022 for even more pattern recognition, but I'm waiting Ren'Py to migrate to Python3, so my tool might get even more super-powers!

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#25 Post by Imperf3kt »

It's like art lol
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Kia
Eileen-Class Veteran
Posts: 1039
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: I made a routes analyser - visualise your project with a graph!

#26 Post by Kia »

Sounds interesting. One thing you might want to be aware of, is the gameplay loops:

Code: Select all

label main_loop:
    show screen some_map
    pause
    jumps main_loop
They're often used for minigames and such, the code might have problem computing infinite loops like this.

Post Reply

Who is online

Users browsing this forum: Google [Bot]