Discussion on tool to keep tracks of all variables

Hello, I’m looking for a tool or some code that could help me keep track of all my numbered variables.

To put it simply, I want to calculate precise averages of certain values based on player choices, and generate all possible combinations of choices along with their corresponding variable outcomes.

For example, if I pick Choice 1 in Scene 1, Choice 3 in Scene 2, and Choice 1 in Scene 3, I might end up with 150 cash, 76 loyalty, and 65 charisma.
If instead I pick Choice 1 in Scene 1, Choice 3 in Scene 2, and Choice 2 in Scene 3, the resulting values will be different.

Even with a set of only 3 choices for 3 scenes the total possibilites is already 3^3 (=27), then you take an average set of 3 questions per scenes and 40 scenes, it does : 3^40, which is an absurd amount of possible choices, and by no way manageable.

So, is there any way to efficiently track these values? I understand 3^40 is far too many combinations to compute exhaustively, but maybe the process could be broken down. For instance, if you process 10 scenes at a time (3^10 combinations) in one file, you could then calculate accurate averages and use those as a base for decisions in the next file, and so on.

Maybe I’m overcomplicating things and this approach isn’t necessary. If so, I’d love to hear how you keep track of your variables and ensure that choices and conditions don’t end up feeling unrealistically hard or easy.

Personally, I currently use Excel to note every choice, its outcome, and the variables it affects. I then calculate the minimum, maximum, mean, quartile, and median values at the end of each file to balance things out.

I’d love to hear your thoughts and suggestions.

3 Likes

I use this kind of thing to track stat levels over the course of the game:

Nowadays I also use variables to track how many times each stat is tested, adding +1 per time it’s tested, then using the above method and looking at line coverage in RandomTest.

7 Likes

This is..A good question. My first instinct is that you are, overcomplicating things. My next is how to do exactly the same because it’s useful. I have over 1,200 variables-and increasing as the need arrives-in my work. (Which is still on the low end of choice games.) Many of my choices are locked behind if you meet a specific number. I never really considered having a tool to help find every variables average; I just did it myself.

This is mostly how I know if I need to change the value of a variable. I just see how many times a choice is chosen in quick and random. If it doesn’t get hit enough, change around some things. Hit too much? Do the same.

3 Likes

Well, first of all, thank you guys for your answers.

While the solution given might not be ideal, it still provides some good insight. Still, I can’t help but think there must be a more mathematically elegant way to do it.

UPDATE

Sooo… I’ve been spending way too much time trying to build a tool, which is now working pretty well (even if the design clearly isn’t the best).

Using the randomtest function in game, I was able to extract all the necessary data, which can then be entered into an Excel sheet that calculates the weighted mean, median, quartiles, and range.

By following a few simple instructions in Excel and spending just a few minutes transferring the randomtest data, you can get a comprehensive overview of the results. (transfer needs to be done by hand rn, but I’m sure some python maniac could very well automatize that)

Some additional tools within it are still being developed by me (yes, again) — notably a crossboard function that will allow visualization of each path of choices and their corresponding variable values, but the main feature is already working as I write this.

Let me know if you’re interested! Should I post the Excel file somewhere, or just keep it to myself? :smiling_face_with_horns: :smiling_face_with_horns:

Also should I create another tread or am I getting ahead of myself

If you have any question feel free to ask

6 Likes

It’s clunky, but what I do put the variables in to see what they come out as and then run the game via either random test with the full text on, or play it myself.
For example if you want to know how much cash someone ends up with, you can put at the end of the game (or where ever you need to do a stat check so you’re not messing with players by not having it achievable or too easy/hard):

Cash: ${money}

If you want to flag what choices/branches people are taking you can do a similar thing. Like in scene one do they choose to go to work or stay home. Make a variable for it (like s1choice1) and then set it.

Anyways, looks like you’ve got another solution and I’d be happy to hear it if it’s less clunky than mine, but if you only need to look at particular stats or a few big choices, it works. (Wouldn’t want to use it to track hundreds of choices though.)

4 Likes

I love it when people smarter than me share their methods :sparkling_heart:. Now I can check how much the bond increases before I post the updates.

2 Likes

Well, what I did is kind of an improvement of the method you described.

It gives more accurate data while being just as easy to do.

Basically, at the end of the scene where you want to print your data, you just need to add something like:

*if cash >= 100 *set printcash 100

*if cash >= 200 *set printcash 200

You can also use:

*if cash = 65 *set printcash 65

*if cash = 66 *set printcash 66

etc.

You only have to do this once, then you can simply copy and paste (or duplicate) the function in your other scenes.

That’s the hardest part done.

After that, just run the Randomtest — it will show how many times players reached each value. From there, you can calculate percentages and any other data you need. (put 10000 try and you should get reliable data)

What’s great is that you only have to note how many times each value appears (which you can quickly find in the Randomtest using Ctrl+F to search for the label). This usually takes no more than five minutes.

Then, just enter those numbers in the Excel tool I made, it automatically calculates the weighted mean, percentage, median, quartiles, etc.

Basically, it gives you all the data you need to balance your game.

If you’d like, I can share the Excel file with you.

2 Likes