judicator / KerbalismSystemHeat

Kerbalism support for SystemHeat mod
8 stars 4 forks source link

Unloaded reactor throttling doesn't work. #2

Closed gotmachine closed 3 years ago

gotmachine commented 3 years ago

Those lines : https://github.com/judicator/KerbalismSystemHeat/blob/64766ccc00a16b9ae13a218ede236a4d9788cf4c/src/Modules/SHFissionReactorKerbalismUpdater.cs#L142-L143

Won't work at all. You can't rely on Deferred in the middle of an update cycle. If I understand correctly, the intent is to support the auto mode and to prevent the uranium consumption to go below the min throttle.

To achieve that, I would suggest computing minThrottle, maybe it's already available, if not you can do minThrottle = minGeneration / maxGeneration.

Then having 2 separate recipes :

That way you're garanteed to consume uranium according to MinThrottle, and EC/uranium rates will scale properly according to the actual needs when in auto mode.

judicator commented 3 years ago

Thanks! I rewrote BackgroundProcessing code for fission reactor according to your recommendations.