[Tool] A stat analysis tree

TL;DR Load a scene file on this little test site I made to generate a choice tree of it that shows all possible values for its stats down all possible branches.

Tracking all the possible values of a game’s stats is the hardest part of writing a game for me, so I made this tool (still incomplete and in prototype phase) to help me.

First, it condenses the choice-tree like so:

This is just the choicescript example game (slightly modified). The block with the … in it means it’s condensed some stuff down, only considering the part where the reader must choose between leadership and strength to be relevant.

If a node has a thick red border, if you hover over it, you will see, for example:

This shows what different values leadership and strength can be at this point in the story (and the path to get there (the numbers are the line numbers in your choicescript code)).

(Note: not all aspects of choicescript are supported yet, like *elif and *else, for example.)

That’s all that’s ready to show right now, but just this is going to be a game-changer for me in my story-writing! I hope it helps you too, and let me know what you think, cuz I plan to continue programming other tools based off what I have so far.

To make it, I initially made a text-based tool that lets you do stuff like manually open and close branches, etc, and I plan on extending this in different ways too. Because it’s text-based, though, I haven’t figured out how to put it online yet.

For more about it, see my discussion about the programming behind this, other potential tools, etc, here.

It makes something like this:

Check the first tool out here: Link to first tool again



This is very interesting! I tried this for a number of scenes in various games, and got an Internal Server Error for all of them. Do you plan on releasing the source code?

1 Like

Yes, I definitely do plan on releasing the source code, just that currently it’s still a bit too hacky.

It needs better error handling too, not just that generic Internal Server Error message, but it happens because only fairly basic choicescript is currently supported.

One thing that happens is if you submit a scene that’s not startup.txt, and it sees a variable, it thinks it hasn’t seen it before. I will obviously have to figure out how to handle this!

1 Like

This looks very cool. A while ago i started playing around with building a tool to test CS games, which would include the ability to ability to play all paths and record the stats. Life has happened and i paused working on it.

But i did get pretty far, it currently has the ability to ingest all the .txt files (except stats) and pull out all the variables. This includes temp ones and handling all the different formats of code, including multi replace.

My next step had been to work on the process that could interpret all the variable assignments and conditional go tos (to enable it to unpick the paths).

I wrote mine in python and i havw a public repo, but havent uploaded the latest version of it. Let me know if youd like to take a look at it, and maybe even collaborate?

1 Like

I’d love to collaborate! I just made this repo for this tool here. Does your tool actually parse the choicescript code? Mine uses choicescript-graphviz which is still incomplete.

This looks really good! Really appreciate that you made it public.

I guess in future I will be able to say bye-bye to my excels. :smiley:

I haven’t looked at my code in 4 months - and am a little busy with interviews right now. So I can’t promise that I would return to this at all.

But here is my code as it is: GitHub - SinNation/CStest: Choicescript testing tool in python
I’m not sure if you can view my branches, there is an updated version in a branch.
You can just download the file and run it - providing you have python. I do have an exe as well, but it is more out of date.

But yeah, it uses Python to parse the choicescript and apply a series of tests to it. Currently it doesn’t do anything about ‘playing’ the game - that was my next step and likely required a dive into graph theory, which I didn’t have the effort for at the time.

1 Like

Sorry for the late reply, but I finally had a chance to look at your code. Cool that it handles all the different forms the variables can take. Mine doesn’t yet, just the basic *set command. For actually “playing” the game, mine does what I think you’re talking about. It just follows each branch (e.g. all the *choice’s and *if’s) and keeps track of what the variables can be.

@autumnchen Is it all right if I look at the code you uploaded to help with debugging? I might be able to fix at least some of the reasons it was giving that Internal Server Error. (I’ve already added better error messages for some things.)

Sure, you can look at the code I uploaded.