BattletechModders / MechEngineer

Mod for BattleTech that introduces many CBT mechanics to the MechLab
GNU Lesser General Public License v2.1
11 stars 21 forks source link

Calculation of HeatSinkCapacity in Mechlab #177

Closed LadyAlekto closed 4 years ago

LadyAlekto commented 4 years ago

You asked for a note on it

Issue, Mechlab calculates with capacity 0 and applies all operations on that, instead of total capacity

It should apply modifiers to total capacity, like in battle, not on capacity0

Copy of the note about this: HeatSinkCapacity since it calculates from 0 not from total (eg in_mutliply_float heatsinkcapacity 1.2 results in zero, not total*1,2 )

A good breakdown would be

Base Capacity+Multipliers Total Weapon heat reduction (either a total, or a breakdown of by category/weapontype) And show the final total "alpha strike heat" of Heatgenerated/Heatreduction (this does vanilla correct already)-Capacity

CptMoore commented 4 years ago

HeatSinking capacities are defined at various places

  1. as a statCollection HeatSinkCapacity initialized with 0
  2. as a method "GetHeatSinkDissipation" that goes through inventory and adds up heatSinkDef.DissipationCapacity
  3. as a computed property "HeatSinkCapacity" that adds the result of the method GetHeatSinkDissipation and the current value of the statCollection HeatSinkCapacity
  4. another computed property "AdjustedHeatsinkCapacity" that multiplies the property "HeatSinkCapacity" with some map and global multipliers

that last final heat sink capacity is used throughout the game.

As HeatSinkCapacity statCollection is never really set except for some pilot ability, it doesn't influence the mech stats in the mechlab.

I don't understand why GetHeatSinkDissipation exists if we could just fill up statCollection HeatSinkCapacity. I would, as part of this ticket, rewrite/patch vanilla code to get rid of the GetHeatSinkDissipation method and use exclusively the statCollection.

CptMoore commented 4 years ago

done, also gave quite a performance improvement as Engine doesn't have to be calculated every time GetHeatSinkDissipation was called