grandivory/mods-optimizer

Improve order dependency for target stats

Opened this issue · 0 comments

I'm writing this in order to track it somewhere for my own benefit. I'm hoping to make this change in the codebase myself in the near future.

A good QOL improvement for the system would be to automatically swap interdependent targets dynamically.

At the moment, if I have targeted Wat to be 1 speed greater than Thrawn, and then I move Thrawn lower in the modding priority list than Wat, then the mod optimization will break with an error to the user.

I would like to add a pre-processing step that searches for interdependant targets like these, and inverts them when the order is changed.

Current behaviour:

  1. Set target on Wat to be 1 speed lower than Thrawn.
  2. Move Thrawn below Wat in priority
  3. Optimize Mods and observe error message.

Desired behaviour 1:

  1. Set target on Wat to be 1 lower than Thrawn.
  2. Move Thrawn below Wat in priority
  3. Optimize mods checks the dependencies, and sees that Thrawn is below Wat. Remove target stat from Wat and add inverted stat to Thrawn (in this case, Thrawn speed should be one higher than Wat.)
  4. Mods Optimize
  5. After optimization, viewing Wat should see that target stat is gone. Viewing Thrawn should see new target stat there.

Desired behavior 2:

  1. Set target on Wat to be 1 lower than Thrawn.
  2. Remove Thrawn from the priority list altogether.
  3. Optimize Mods should throw an error message concerning missing linked priority BEFORE commencing remodding so that calculated target stats are not needlessly calculated.