# Keeping Track of Stats

**URL:** <https://forum.choiceofgames.com/t/keeping-track-of-stats/127252>\
**Category:** Game Development\
**Created:** [October 31, 2022, 5:02pm UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252 "2022-10-31T17:02:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrankTheTank](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/frankthetank/32/89025_2.png) [@FrankTheTank](https://forum.choiceofgames.com/u/FrankTheTank)\
**Post date:** [October 31, 2022, 5:02pm UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252/1 "2022-10-31T17:02:19Z")

</div>

Howdy, all.

I’m Frank, and for the last few weeks I have slowly but surely been fumbling my way through learning ChoiceScript. My main problem so far is that I don’t really know what numbers to set my stat checks at. I know the general effects of Fairmath and integers, and am so far just using integers because to be honest, Fairmath scares me, but also because from advice I have gathered around the forums, integers are better for skills and Fairmath is better for personality, relationships, etc.

Even with integers, though, and a regular increase or decrease (i.e., every increase/decrease is 5, 10) I wonder if there is a way to keep track of how many increases and decreases I do, or if that is even necessary. I’m simply worried about having stat checks that are actually possible, and if the solution to this is play testing near every branch, which seems ridiculous, but, well…

Anyways, sorry for the slightly rambling post. Any help would be greatly appreciated, honestly both about my question and stats in general. Stats in CoG games and I have a bad relationship, and they intimidate me as both a player and an author.

Thanks!

---

<div class="post-metadata">

**Author:** ![Loudbeat](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/loudbeat/32/115975_2.png) [@Loudbeat](https://forum.choiceofgames.com/u/Loudbeat)\
**Post date:** [October 31, 2022, 5:35pm UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252/2 "2022-10-31T17:35:35Z")

</div>

My approach to that problem is

1. Make a mind map following all the branches and stat changes (though that doesn’t calculate the stats for each iteration possible, it helps me show what paths the variable will affect)  
And 2. use this tool to run the game thousands of times and get all the possible outputs of the variables I want to check, then copy the data to a spreadsheet and get the max and min values for each variable.

> [@Generate Statistics About Your Stats](https://forum.choiceofgames.com/t/generate-statistics-about-your-stats/76175):
>
> To help me balance my stats in my work-in-progress, I modified randomtest to take snapshots of my stats and put them in a .csv file, which Excel and other spreadsheet programs can open. I put the changed code [on Github for anyone who wants to give it a try](https://github.com/sgranade/choicescript). You should be able to use it just like you would ChoiceScript from the main repository. To try this out, in your startup.txt file, put a special comment that sets up what variables to save: \*comment savestatsetup [stat1] [stat2] [stat3] Re…

It’s kind of a brute-force way to do it but it works well enough. Especially when the project starts to grow and the number of ways one stat can change also grows exponentially, making it too inconvenient to follow and calculate it by hand, the computer can do it 50 thousand times in a couple of minutes, plus, you can run from iteration 0 to 50k in parallel to another from 50k to 100 and so on, so you can test maybe 500k or 1 million iterations in just a while if you are really afraid you’re not getting the endpoints of your stats, it all depends on the complexity and ramification of your game.

---

<div class="post-metadata">

**Author:** ![HarrisPS](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/harrisps/32/240120_2.png) [@HarrisPS](https://forum.choiceofgames.com/u/HarrisPS)\
**Post date:** [October 31, 2022, 8:32pm UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252/3 "2022-10-31T20:32:12Z")

</div>

I use [something like this method from Emily Short](https://emshort.blog/2017/05/09/loose-tight-flat-and-bumpy-stats-in-choicescript-games/) to adjust my difficulty balance while writing. I usually check between chapters to get a sense of where I’m unbalanced or whether it’s become too difficult to succeed at a stat test.

---

<div class="post-metadata">

**Author:** ![Hazel](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/hazel/32/77796_2.png) [@Hazel](https://forum.choiceofgames.com/u/Hazel)\
**Post date:** [November 2, 2022, 4:09pm UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252/4 "2022-11-02T16:09:20Z")

</div>

This is part of the reason why I develop dually, switching between CSIDE and [Notepad++](https://notepad-plus-plus.org/). N++ has a very robust search feature that allows me to search for a keyword or short phrase through an entire text file, or several files open at once. This lets me check up on how often I reference or modify certain variables. It’s most helpful if you maintain a fairly strict naming convention and always use the same style when modifying, e.g. always use one space before the operator and one after. That makes it more searchable.

It doesn’t absolve you of the need to plan ahead and outline well, but it’s a handy technique to use in a pinch.

---

<div class="post-metadata">

**Author:** ![FrankTheTank](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/frankthetank/32/89025_2.png) [@FrankTheTank](https://forum.choiceofgames.com/u/FrankTheTank)\
**Post date:** [November 5, 2022, 11:45pm UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252/5 "2022-11-05T23:45:42Z")

</div>

Thanks for the suggestions, friends. I’ll see how everything works out.

---

<div class="post-metadata">

**Author:** ![Dvalor53](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dvalor53/32/245903_2.png) [@Dvalor53](https://forum.choiceofgames.com/u/Dvalor53)\
**Post date:** [November 6, 2022, 2:47am UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252/6 "2022-11-06T02:47:01Z")

</div>

So there are a few suggestions I could make but I have a few questions. Why are you concerned over how often you increase or decrease statistics? Is it to make checks that are fair? If that is the case, I would recommend a few things to potentially make things easier.

If you know roughly how many skill lifts you wish to have, then you can figure out how many you plan on spreading. For an example I will stick with 18 lifts of 5. This allows you to start with any score at 10 at the beginning of game. With this you know that you will never break a 100 score even if they focus everything into one skill.

From here you can make a variable that you lift whenever you lift skill. For the example I’ll call it LiftTrack.

With these set up whenever a stat is lifted you just add code for \*set LiftTrack +1 to track the amount of lifts you have.

You can now use this lift tracker variable to judge how difficult the check should be. Using a range from 1-5 you can now set how hard a check should be. You can set variables in your start up to allow you to shift what these difficulties are throughout the whole of your story.

In the start up you can do this:

```nohighlight
*create Easy 1
*create Normal 2
*create Challenging 3
*create Difficult 4
*create Evil 5
*create LiftTrack 0

```

So that when there is a check you have code that looks like this

```nohighlight
*if Deduction >= (LiftTrack * Difficult)
	Stuff Happens
*if not(Deduction >= (LiftTrack * Difficult))
	Failure

```

So lets say that there has been 3 lifts total. That means that formula looks like this once the numbers are plugged in: Deduction \>= (3 \* 4).  
Turns into Deduction \>= (12).  
Meaning they would want a 12 or higher to succeed at the check, but might have a skill as high as a 25 (Base 10 and three lifts of 5 each)  
And an evil check would math out to: Deduction \>= (3 \* 5).  
Deduction \>= (15).  
Making it very hard to pass if the skill never started with that base 10.

The real magic to this approach is when you are testing, if you feel that all of the normal checks are too easy or hard in general, you can just change the variable _Normal_ in the start up and it’ll fix all checks marked as _Normal_. The same goes with _Evil_ or _Difficult_, you can lower them to more feasible numbers.

This method though encourages players to focus really heavy in one skill if you use a lot of 4 or 5 ratings for difficulty. You may want to keep those super high checks be very sparse or never have them happen. Instead define _Evil_ as never higher than 3.75 or something.

Please let me know if I confused you at all in this.

---

<div class="post-metadata">

**Author:** ![FrankTheTank](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/frankthetank/32/89025_2.png) [@FrankTheTank](https://forum.choiceofgames.com/u/FrankTheTank)\
**Post date:** [November 7, 2022, 4:33pm UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252/7 "2022-11-07T16:33:14Z")

</div>

Uhh…you did confuse me, but that’s alright. I’m pretty awful at conceptualizing math in such a way as to actually use it (and also math in general). What I can say is that my problem at the start was more making stat checks that were literally possible, i.e. I can’t make a stat check of 50 if it isn’t actually possible, even if you max out a certain stat, to get there. But you reminded me that I actually have to make them fair, which is a whole 'nother level that I don’t even know how to get to.

For your method, though, I think I do vaguely understand the idea. I do want to stick with increases of 5 for normal raises, and 10 if there’s something bigger, maybe 15 if it was really something big though I don’t know when that would happen. With your method, I’m not sure it would work to change the value of the increase, as from my basic understanding it would have to be the same increase every time? Let me know if that is entirely wrong. But I do think your method is not a bad idea. I think part of making my stat checks fair will depend on if I want there to be rewards for focusing on one stat or maybe spreading them out more. From my experience as a player, focusing on one stat can be good but there end up being situations where none of the options work, so you need at least some other stat to be good enough, I suppose.

I don’t know if any of that makes sense, but I appreciate the help!

---

<div class="post-metadata">

**Author:** ![Dvalor53](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dvalor53/32/245903_2.png) [@Dvalor53](https://forum.choiceofgames.com/u/Dvalor53)\
**Post date:** [November 7, 2022, 7:32pm UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252/8 "2022-11-07T19:32:14Z")

</div>

The good news is that method I’m trying to explain tackles what you are trying to do. It tracks the likelihood of passing a check for you. Assuming all of the same values are as I started in the code above. I’ll run over some of the numbers at different stages of the game.

`Skill >= (LiftTrack * Difficult)`

This first example will be the base value. Maybe a few base 10 stats, but no extra lifts of 5. LiftTrack = 0. Lets say it is an Evil Check

```nohighlight
Skill >= (LiftTrack * Evil)
Skill >= (0 * 5)
Skill >= (0)

```

So at the very beginning of the game, this will _always_ pass. This will happen to all checks before the first lift. So I’ll move on to later game.

Lets say there has been 2 lifts. So LiftTrack = 2. I’ll show math for an Easy, Challenge, and Evil checks.  
Easy Check

```nohighlight
Skill >= (LiftTrack * Easy)
Skill >= (2 * 1)
Skill >= (2)

```

With two lifts that means that just having a 2 will pass. If you lift by five, so long as you have any kind of investment it passes.

Challenging Check

```nohighlight
Skill >= (LiftTrack * Challenging)
Skill >= (2 * 3)
Skill >= (6)

```

So at the same point in the game, you need a 6 for a _Challenging_ check. This means the user needed to have invested 2 times in the check to have a 10 (ignoring if you give a free 10 value).

Evil Check

```nohighlight
Skill >= (LiftTrack * Evil)
Skill >= (2 * 5)
Skill >= (10)

```

So this early on you would need a 10, two lifts to pass. Making a _Challenging_ check the same as _Evil_.

Moving on to much later, in the game.

LiftTrack = 8  
Easy Check

```nohighlight
Skill >= (LiftTrack * Easy)
Skill >= (8 * 1)
Skill >= (8)

```

So an _Easy_ check requires 8 or higher. That means 2 out of the 8 lifts needed to be on that skill to pass.

LiftTrack = 8  
Challenging Check

```nohighlight
Skill >= (LiftTrack * Challenging)
Skill >= (8 * 3)
Skill >= (24)

```

At the same point in the story a _Challenging_ check would need a 24. That means they would have lifted this skill 5 out of the 8 lifts to pass.

LiftTrack = 8  
Evil Check

```nohighlight
Skill >= (LiftTrack * Evil)
Skill >= (8 * 5)
Skill >= (40)

```

At the same point in the story, you would need a 40. That means that every lift would have been in that skill to pass.

Now to jump to late game.

LiftTrack = 14  
Easy Check

```nohighlight
Skill >= (LiftTrack * Easy)
Skill >= (14 * 1)
Skill >= (14)

```

So a 14 means 3 out of the 14 lifts needed to pass.

LiftTrack = 14  
Challenging Check

```nohighlight
Skill >= (LiftTrack * Challenging)
Skill >= (14 * 3)
Skill >= (42)

```

With a 42 requirement that means that they would need to put 9 out of the 14 lifts into that skill.

Now _Evil_ as it currently stands it’ll always require that all lifts are in that skill.

So in summery in the early game there will be very little variation in the requirements for every level of challenge, but as the game goes you’ll see the challenge actually start to pop up.

Sorry it was all just a bunch of math for this post. I was on lunch when I wrote this.

---

<div class="post-metadata">

**Author:** ![Dvalor53](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dvalor53/32/245903_2.png) [@Dvalor53](https://forum.choiceofgames.com/u/Dvalor53)\
**Post date:** [November 8, 2022, 12:36am UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252/9 "2022-11-08T00:36:57Z")

</div>

Hopefully this spreadsheet will help. The left two columns are the difficulty values. The top row of numbers are how many total lifts there are. The values in the middle are how many of those lifts will be needed to pass the check.

 ![image](https://global.discourse-cdn.com/choiceofgames/original/3X/5/f/5f525f50483b9b773e0c015d8815d5c61e34d617.png)

Of course if you give free lifts that are not tracked you can make things a little easier on the player too.

Personally I would never use _Evil_ from this example. _Difficult_ is enough of a challenge in my opinion. You would mostly want to stick with _Easy_ and _Normal_ with an occasional _Challenge_. Hopefully this method will take the stress of balance away from you. You should hopefully just go in with the mindset of _"I want this check to be_ Challenging _and the next check to be_ Easy."

If you redefine the stats as such, this might make a more manageable growth expectation.

```nohighlight
Easy = 1
Normal = 2
Challenging = 2.5
Difficult = 3
Evil = 3.5

```

 ![image](https://global.discourse-cdn.com/choiceofgames/original/3X/3/1/313f791977f716fa165a0be5aa7ba8b07a555c89.png)

---

<div class="post-metadata">

**Author:** ![FrankTheTank](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/frankthetank/32/89025_2.png) [@FrankTheTank](https://forum.choiceofgames.com/u/FrankTheTank)\
**Post date:** [November 9, 2022, 4:29pm UTC](https://forum.choiceofgames.com/t/keeping-track-of-stats/127252/10 "2022-11-09T16:29:53Z")

</div>

Man, I appreciate the effort! I think I’m generally getting the idea. At the very least, I understand that it rewards players for investment in a certain skill, with different levels of investment needed for different difficulties of stat checks, which is something I can use. I’ll do some experimenting with the code, as I have learned all code up to this point by flailing around with it, and see what I can do. Thank you!
