Skip to content

Throttle MJ consumption based on actual refinement and extraction output.#4

Merged
confusingbits merged 1 commit into
confusingbits:developmentfrom
jakkarth:development
Jul 28, 2014
Merged

Throttle MJ consumption based on actual refinement and extraction output.#4
confusingbits merged 1 commit into
confusingbits:developmentfrom
jakkarth:development

Conversation

@jakkarth

Copy link
Copy Markdown

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).

…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).
@jakkarth

Copy link
Copy Markdown
Author

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.

@confusingbits

Copy link
Copy Markdown
Owner

afaik, you need only reference unity engine and assembly csharp contained within the ksp install.

confusingbits pushed a commit that referenced this pull request Jul 28, 2014
- Throttle power consumption for resource extraction and refining based upon output
@confusingbits confusingbits merged commit 386a503 into confusingbits:development Jul 28, 2014
@confusingbits confusingbits changed the title When mining and refining resources, Megajoules should only be consumed w... Throttle MJ consumption based on actual refinement and extraction output. Jul 28, 2014
@confusingbits

Copy link
Copy Markdown
Owner

I fixed a small typo. It compiled just fine.

confusingbits added a commit that referenced this pull request Jul 28, 2014
@jakkarth

Copy link
Copy Markdown
Author

Awesome. Any idea when you might release a new build?

@confusingbits

Copy link
Copy Markdown
Owner

I'm thinking now that I have a stable build, I'll keep an additional compile of the development branch as well.

@confusingbits

Copy link
Copy Markdown
Owner

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.

@jakkarth

Copy link
Copy Markdown
Author

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!

DMagic1 pushed a commit to DMagic1/KSPInterstellar that referenced this pull request Sep 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants