0

I'm working on a RPG where a character has numerical stats and skill levels and those numbers get used in various ways while performing actions in the game.

Are there tools, standards, or processes I can use to take the existing blocks of code, which involves a lot of conditional logic and arithmetic, to produce simplified human-readable explanations of the effects of those numbers?

For example, consider this fictional function:

bool player::can_lift_item(itype item) {
    if(!this.has_arms) {
        return false;
    }
    return (this.strength > item.weight/50);
}

This is a very simple example, and the code is pretty easy to follow. Many real examples are much more complex. What I'd like to get out of this is something like "increasing strength by 1 increases the weight of items the player can lift by 50". I'm not naive enough to think that the wording would be that easy to read, but anything even remotely close to that would be better than nothing at all. I'm especially interested in being able to get any sort of aggregated information on everywhere player.strength is used and what effects it has in all of those places.

Sparr
  • 7,489
  • 31
  • 48

0 Answers0