Skip to content

Allow floating point values in rank thresholds #4165

@aco4

Description

@aco4

https://github.com/Warzone2100/warzone2100/blob/master/data/mp/stats/brain.json

This file determines the experience a droid needs to obtain a certain rank. For example, a command droid requires 12 experience to obtain Green:

"CommandBrain01": {
    "name": "Command Turret",
    "ranks": [ "Rookie", "Green", "Trained", "Regular", "Professional", "Veteran", "Elite", "Special", "Hero" ],
    "thresholds": [ 0, 12, 24, 36, 48, 60, 72, 84, 96 ],
},
"ZNULLBRAIN": {
    "name": "Z NULL BRAIN",
    "ranks": [ "Rookie", "Green", "Trained", "Regular", "Professional", "Veteran", "Elite", "Special", "Hero" ],
    "thresholds": [ 0, 2, 4, 6, 8, 10, 12, 14, 16 ],
}

Floating point values currently seem to be rounded down. For example, a threshold of 12.5 seems to be treated as 12. I would like to be able to determine rank thresholds with floating point values.

Describe why do you think it is needed
Experience is already stored as a floating point value, and it would be nice to have finer control over these thresholds. No old behavior would be broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions