Mehni / kNumbers

Quick comparison of colonist stats
MIT License
34 stars 28 forks source link

Consider Normalizing Stats with Environmental Impacts #28

Closed maarxx closed 3 years ago

maarxx commented 3 years ago

Consider Normalizing Stats with Environmental Impacts

I don't ... I don't even know if this is practically possible, but I'll put it here anyway.

The most clear example is Move speed. If I crack open Numbers and sort by Move speed, the column value is affected by transient environmental impacts, such as if the pawn's current tile is in darkness, or (if the pawn is outside) the weather.

For all of my conceivable use cases, this actually makes it relatively useless. I'm probably sorting this column to choose a pawn to accomplish a specific task, which will have its own environmental conditions, but those will be the same for all pawns, and completely unrelated to the pawn's current environmental conditions.

I think the same can be said for other stats, but I'm not sure.

These environmental impacts should be defactored from the stats shown in the Numbers table, or at the very least, it should be a global mod option to do so.

Mehni commented 3 years ago

I did some testing.

While transient environmental impacts such as rain and terrain has a direct influence on how long it takes a pawn to traverse a tile, the actual Move speed stat is only affected by darkness. In the StatDef that's done by adding a StatPart_Glow to the statparts.

One simple solution is to duplicate the relevant statdefs, make sure they're not visible or used elsewhere except for Numbers and we're done. StatPart_Glow is only used on 3 Defs that I've found. MoveSpeed, WorkSpeedGlobal and SurgerySuccessChanceFactor. Seems straightforward enough, I'll see what I can do.

maarxx commented 3 years ago

Another way would be to calculate the StartPart_Glow multiplier for the pawn, invert it, and multiply their stat by the inverse right before you display it in Numbers.

EDIT: Or would this cause curve post-processing problems?

Mehni commented 3 years ago

Last I checked, RimWorld is in Immediate Mode when rendering the UI. It'll be more performant to duplicate the StatDef.