## Basic Algorithm

To give some context, here is the simple naive algorithm, somewhat analogized to make it easier to understand and less technical:

- Take a character with attributes and secondary characteristics lowered to the bare "viable" minimum, give them back points for doing this.
- In a loop, spend points until we run out doing the following
- Taking the ratios of current traits into account, put all the traits that are valid for purchase into a hat.
- Choose one from the bag at random.
- Give +1 (or +0.25 for basic speed) to that trait, and subtract the point cost from our budget
- Return the character

## Weighing Results

A few things gave some results different advantages and disadvantages that made them easier to select.

- Some characteristics have a lower "allowed" minimum than others.
- For example, Strength can be as low as 10-3; that's 3 decrements; but Basic Speed can go as low as (HT+DX/4)-2.00; that's 8 decrements.
- Some characteristics are bounded by one or more dependent characteristics.
- HP should be between 0.7x and 1.3x of ST
- Will and Per have a lower bound of 70% of IQ
- Basic Move can be ⌊Basic Speed⌋±3
- Some characteristics have very different costs.
- This causes a problem because traits that have a lower cost, when the remaining point budget gets low enough, get "extra rolls" that the more expensive traits don't get. For example, If there are 10 points left to spend, there is a chance to acquire more increments of Basic Speed, but zero chance to acquire more increments of DX.
- This also means the range of possible values for cheaper attributes can be potentially higher than for more expensive values.

Probability of incrementing any particular characteristic. |

### Reducing Components

After doing some testing, it seemed that having attributes and secondary characteristics reduced as much as possible helped to keep secondary characteristics from hitting the allowed ceiling. By this, I mean that, one can think of a level of HT, for example as also including a free level of FP and Basic Speed. If I added these traits when buying a level of HT, that's like giving FP and Basic Speed a bunch of extra chances of being rolled, which meant that changing the weighted odds of getting higher HT could cause a "butterfly effect" that could cause FP and Basic Speed to increase by a lot, which took away opportunities to buy other things, causing a lot of other attributes and secondary characteristics to lose out, relatively speaking.

The one slightly complicated secondary attribute in the bunch because of all of this was Basic Move, which normally gets a free increment every time Basic Speed x 4 % 4 = 0. I had to hack the algorithm slightly because I couldn't subtract 1/4 of the cost of Basic Move from each level of Basic Speed; I just made it so that every time Basic Speed did hit an even number, it would give back 5 points and decrement Basic Move by 1.

### Isn't Weighing Results Cheating?

I got this question while thinking out loud about the problem. If you give favor to one result, is it still really fair or random? Well, obviously, yes, it's still random. The fact of the matter is that some traits have certain properties that give them more opportunities for rolls. By giving the attributes and secondary characteristics a higher probability of being rolled when the opportunity lines up, it makes up for the times when they have absolutely zero opportunity for incrementing.

## The "Bare Minimum Viable Character"

The bare minimum viable 0 point character has the following stats:

- All 4 Attributes are at 7; this gives 180 points worth of disadvantages.
- Secondary Characteristics
- HP, FP, Will, and Per are allowed to be 70% of their primary attribute; this means an effective 5 when the controlling attribute is at 7; two decrements each gives 30 points worth of disadvantages.
- Basic Speed has a minimum adjustment of -2.00; this is 8 decrements for 40 points.
- Basic Move is already at the floor; HT, DX, and Basic Speed are so low, Basic Move is already 1, so we make no changes for 0 points.

Summing all of this up, a zero point character has 250 points floating to reallocate. In any case, Let's take a look at the results in more detail.

## The Results

I generated 20,000 random characters with 0 points, assuming that a balanced generator would have all the attributes balanced around 10, and all the secondary characteristics balanced around 5.

### Attributes

Boxplot of 20,000 zero point characters |

- The values are discrete counts
- Events occur independently
- The event can't occur simultaneously
- The probability of a success is determined by a binomial distribution

Histogram of IQ Values |

The one typical property of a poisson distribution that is violated is that the rate is not necessarily constant. If, for example, Will and Per are too low, the occurrence of IQ increments drops to 0. If Basic Speed is low enough, the odds of DX or HT incrementing is 0, and this increases the odds of IQ incrementing. Also, I am not sure if this is absolutely required, but I think the counting process needs to occur over a continuous interval; the interval is a discrete set of loops where something increases or it doesn't. Correct me if I'm wrong here though.

### Perception

Perception Histogram |

Perception and Will have the interesting designation that they have no cap in proportion to any other attribute or characteristic, and their histograms are similar. Highly unlikely, but because they have no maximum capping, this means that a random character could potentially spend all the points on either or both without any other limits. This gives them a longer tail than any other characteristic in the generator. As a secondary attribute that starts relatively low, it also has a higher variance and standard distribution, which you can see by the way it takes much longer to reach the "peak" of the distribution than it did for IQ above.

### Hit Points

HP Histogram |

Hit points have a relative upper and lower bound compared to ST. HP must be in the range of ST ±30%. Fatigue has a similar but different shape because it is bound by HT, but decomposed HT! very cheap and also depends on Basic Speed, which depends on Basic Move. These interact subtly with the entire graph, but give an overall similar shape. If we don't look at the graph very carefully, it might seem like this is almost a normal or binomial distribution, but it does have a very heavy tail at the end again.

### Basic Speed

Basic Speed Histogram |

This is the last "interesting" graph in my opinion because of the high relative variance and the extremely low initial value, and the dependence on all of HT, DX, and Basic Move. It is deceptively similar to a bell curve at this point, but there is no mistaking that the right half of the graph is "heavier" than the left side of the graph.

## Other Thoughts and Conclusion

I got permission from the guy who wrote Libre Solo Role Playing to write an app that is similar to the GM emulator in the book. I think I'll use this as a stepping stone to produce the framework for an MVC website that I can eventually add the Pseudobot functionality to. I think I'll also be keeping this project mostly open source because Brian seemed a little more forgiving in what I can and can't do with the app than Steve Jackson Games. Basically, as long as I don't wholesale copy text from the book, and don't say that my implementation is literally equal to his book, I'm free to do whatever, so hooray.

## No comments:

## Post a Comment