Attribute adjustments (e.g. stat bonuses) horribly broken

Issue #23 open
repo owner created an issue

From mirror of old bug tracker.

When you anger Essiah by requesting aid too often, your charisma and fatigue points are given a sacred penalty. If you continue to do so, your charisma and fatigue penalties roll around such that you instead receive huge bonuses to one, the other, or both. They roll around at different rates, so if you continue for long enough you can achieve charisma bonuses of over +120 and fatigue bonuses of over +80.

Flagged as medium priority, considering that it basically allows you to cheat with wizard mode off, but does not prevent the game from being played.

Comments (3)

  1. RMTEW FULL NAME reporter

    The primary problem for this defect is that 'bonus' is an int8 and the bonus aggregation algorithm allows the aggregate bonus to be so negative, that it goes positive (and a high positive value at that).

    bonus = 0
    for stat_bonus in stat_bonuses:
        if bonus < 0:
            bonus += stat_bonus
            bonus = max(bonus, stat_bonus)

    The secondary problem is that this algorithm is arbitrary. The order of aggregated bonuses affects the final aggregated value, but ordering should have no effect. If the first value is negative, then the aggregate bonus can go further and further negative, and positive values that follow it push it up to and over 0. If the first value is positive, then the aggregate bonus is the highest of all the aggregated bonuses.

    It's a head scratcher. The algorithm needs rework, and type value limits need to be enforced to avoid overflow.

  2. Log in to comment