Imbalanced stat generation?

I’ve generated a LOT of hearthlings lately and I noticed the algorithm seems a bit imbalanced.

Specifically, it’s possible to generate a hearthling with 6/6/1 for stats, but it appears impossible generate one that is 1/6/6 or 6/1/6.

It also seems to be much easier to generate one that is 5/6/x or 6/5/x than it is to generate one that is x/5/6 or x/6/5

I’m guessing this is because the game is rolling the numbers in order vs. some kind of limiter, rather than randomizing which rolled number goes into which stat.

Hi @Hieronymous
Are you playing Rayya’s Children by any chance?
Rayya’s children always have at least 2 mind stat, which means it is not possible for them to have 1/6/6 as a stat distribution. However, 1/6/6 is possible in ascendancy, it’s just rarer.

Here’s a screenshot of ascendancy rolling 6/1/6, as proof it’s possible XD

Here’s the code to distribute the random stats if you would like to see it :slight_smile: :

     local num_points_to_allocate = rng:get_int(attr_distr.allocated_points.min, attr_distr.allocated_points.max)
     local point_limits = attr_distr.point_limits
     local points = {}
     local attr_name_list = {}
     for name, data in pairs(point_limits) do
        table.insert(attr_name_list, name)
        points[name] = data.min

     while num_points_to_allocate > 0 and #attr_name_list > 0 do
        local random_index = rng:get_int(1, #attr_name_list)
        local random_attr = attr_name_list[random_index]
        points[random_attr] = points[random_attr] + 1
        if points[random_attr] >= point_limits[random_attr].max then
           table.remove(attr_name_list, random_index)
        num_points_to_allocate = num_points_to_allocate - 1

     for name, value in pairs(points) do
        attributes_component:set_attribute(name, value)

I just ran some tests on it (I roll 50000 times in code and then check to see how many of those will have a stat of 1/6/6, etc) and it looks like on average you have a 0.18% chance of seeing any of the 6/1/6, 1/6/6, and 6/6/1 combinations.
And they each have about the same frequency.
As a reminder, rayya’s children will have their mind stat boosted by 1 always, so it actually is impossible for them to get 1/6/6

Hopefully this clears things up.



Thanks for the explanation – I was playing Rayya’s, yes. That actually means Rayya’s has a minor but non-trivial combat “ding”, since they can’t get a 1/6/6 Knight.

Yes, although mind will grant experience so it’s kind of a trade off. There’s also talks about giving mind another contribution to combat in the future.
I also feel Knights don’t need too much spirit these days for courage. They get a good boost from their buff as it is … Unless there are some encounters where they are running away? Those may need to be fixed


1 Like

I’ve had healed knights run away sometimes vs. the varanus at least, but they were low-level knights.