Throttle MJ consumption based on actual refinement and extraction output.#4
Conversation
…d when there are input materials available AND there's storage onboard for the output materials. This patch prevents a deadlock refueling condition. For example, on mun, a 1.25m generator + sethanes fission reactor cannot supply enough power to both mine alumina and electrolyse it into aluminum and oxidizer. If both options are enabled on the ISRU, the mining will take precidence and starve the electrolysis process of megajoules even when the alumina storage on the ship is full. With this patch applied, the mining function will stop consuming megajoules when there is no more room to store the alumina, so there will be power for the electrolysis to consume the alumina. This allows the ship to be refueled without requiring the player to constantly turn on and off the alumina mining option (although it will still be slower than if sufficient power generation were available).
|
Based on the development branch, as requested. Also note that I have not tested this fix at all. It may not even compile. I have no idea how to actually compile a KSP mod, and as I'm running on Linux I do not believe there's a Unity3D editor available for me to try. |
|
afaik, you need only reference unity engine and assembly csharp contained within the ksp install. |
- Throttle power consumption for resource extraction and refining based upon output
|
I fixed a small typo. It compiled just fine. |
|
Awesome. Any idea when you might release a new build? |
|
I'm thinking now that I have a stable build, I'll keep an additional compile of the development branch as well. |
|
I've posted a build up with the latest change. I'll try to do this as much as is reasonably possible for me to do so. |
|
I've got it running, but it seems my changes didn't solve the problem. Can you take a quick look at my conditionals and the code that returns the unused megajoules? I've probably got a sign wrong or a <= where I needed >= or something. If you don't have the time, I'll try to take a closer look later this afternoon. Thanks! |
When mining and refining resources, Megajoules should only be consumed when there are input materials available AND there's storage onboard for the output materials.
This patch prevents a deadlock refueling condition. For example, on mun, a 1.25m generator + sethanes fission reactor cannot supply enough power to both mine alumina and electrolyse it into aluminum and oxidizer. If both options are enabled on the ISRU, the mining will take precidence and starve the electrolysis process of megajoules even when the alumina storage on the ship is full. With this patch applied, the mining function will stop consuming megajoules when there is no more room to store the alumina, so there will be power for the electrolysis to consume the alumina. This allows the ship to be refueled without requiring the player to constantly turn on and off the alumina mining option (although it will still be slower than if sufficient power generation were available).