Jump to content

[1.0.5] RadiatorToggle v1.1: Save electricity when not in use


Snark

Recommended Posts

NOTE:  Obsolete mod as of KSP v1.1!
This mod is no longer needed as of KSP v1.1.  The game has been updated so that the behavior that this mod used to do is now stock!  Therefore, if you're running v1.1 or later, you don't need this.

If you're still running v1.0.5, then this mod is still useful.
 

What it does (KSP v1.0.5)
Adds a right-click menu item to toggle static radiator panels on/off, so you save electricity when you don't need the cooling. You can also add them to action groups to toggle on/off.

It also tweaks the electricity consumption of the larger static panels so that their electrical consumption is proportional to their cooling power: all panels are now equally expensive (in electricity) per unit of cooling power. This raises the electrical consumption of the larger static panels (which were buggily cheap in stock), but at least you can turn them off now!

Download from SpaceDock
License: MIT
Source code


JfGTNAO.png
 



Why?
With KSP 1.0.5, radiators just got better (they can actively refrigerate components colder than themselves), but at a cost (they now consume electricity while operating).

However, what if you don't have anything that needs cooling? The thirsty radiators are sitting there draining your electricity.

With the folding panels, this isn't a problem: when you retract them, they stop cooling (and therefore stop draining electricity). However, the static panels are always on, and always draining, and there's no way to turn them off.

This mod gives you a way to turn them off when you don't need them.

Link to comment
Share on other sites

They [I]were[/I] passive, but now they can draw more heat than the hottest part actually contains which allows them to cool more effectively.

Unfortunately they now draw E/C constantly just like the folding variants when deployed.

I'm pretty sure they should automatically shut down when there's nothing to cool, but aren't.
Link to comment
Share on other sites

Thanks, I'm glad folks find it useful! :) Added a source code link.


Okay, so now that I've got everyone's attention, maybe I can ask a dev-related question because I'm new to modding KSP and there was one thing I wanted this to do that I couldn't figure out. Would love to hear if anyone has a suggestion. :)

This may seem like a minor nit, but I would love to make it so that instead of just labeling the button in the right-click menu as "Toggle Radiator", it would instead say "Activate Radiator" or "Deactivate Radiator" based on its current state.

There must be a way to do that, but darned if I could figure it out. The only way I could see to do it in the [URL="https://github.com/KSPSnark/RadiatorToggle/blob/master/src/ModuleRadiatorToggle.cs#L58"]relevant source code[/URL] was do annotate the action method with

[KSPEvent(active = true, guiActive = true, guiActiveEditor = false, guiName = "Toggle Radiator", name = "toggleRadiatorFlight")]

...which is a static declarative thing. I considered maybe trying to find the actual KSPEvent instance by rummaging around on the class via reflection, but A) I don't know if that's intended to be writable at run time, and B) it's a global instance to the class whereas I need something that would be specific to the part instance.

Anyone have any suggestions? (feel free to private-message me the answer, I understand that this forum here is not supposed to be about coding minutiae)
Link to comment
Share on other sites

[quote name='Snark']This may seem like a minor nit, but I would love to make it so that instead of just labeling the button in the right-click menu as "Toggle Radiator", it would instead say "Activate Radiator" or "Deactivate Radiator" based on its current state.

There must be a way to do that, but darned if I could figure it out.[/QUOTE]

Okay, I figured it out. :)

v1.1 is posted, the right-click menu action will now say "Activate" or "Deactivate" as appropriate instead of just "Toggle". A purely cosmetic fix, so unless you care about it, no need to go back and update if you've already installed.
Link to comment
Share on other sites

[quote name='smjjames']Not to malign ya or something, but this could definetly be worth getting assimilated into the stockbugfixes package.[/QUOTE]

Yah, that would make a certain amount of sense. :)

I myself prefer to take my mods and fixes [I]a la carte[/I], mainly because years of software engineering have ground the principle of "code is bad and less is always better" deeply into my mental DNA. I run the bare minimum of mods, and only small ones that address a particular, specific point that is causing me a problem. That's why I don't run large catch-all mods like the stock bug fixes one. No aspersions on it, I'm sure it's great, I just like having less stuff running so that I have a good idea of exactly what to expect and which mod is causing which behavior.

So I wrote a targeted, specific mod to address a targeted, specific problem that's giving me grief, and I like it that way.

That said: By all means, if the maintainers of the stock bug fixes mod would like to incorporate [URL="https://github.com/KSPSnark/RadiatorToggle"]this code[/URL], I'll happily hold their hat and cheer them on. :) The only thing I'd ask is that if they do that, please let me know so I can update my mod with a note that says "if you're already running the stock bug fixes mod version N or later <link>, you don't need this."
Link to comment
Share on other sites

Yea, other parts only pull power as needed and the pannels as I understand it only cool as needed allowing parts that need internal high heat to reach that temp. So they should cut power usage as they cut cooling. I'd list this mod as a bug fix.
Link to comment
Share on other sites

[quote name='Vorg']Yea, other parts only pull power as needed and the pannels as I understand it only cool as needed allowing parts that need internal high heat to reach that temp. So they should cut power usage as they cut cooling.[/QUOTE]

I agree with the idea in principle, and actually I initially planned to do this.

However, when I started diving into the details more, it's not quite a no-brainer. The tricky thing is the definition of "as needed." Who's to say exactly what's "necessary," here? Suppose there's a part somewhere that generates heat, and the hotter it gets, the less efficient it is, so you want to keep it reasonably cool. But the exact efficiency curve as a function of temperature can depend on the part. So yes, you can spend electricity in your radiator to cool it down... but who's to decide where the exact cut-off should be?

The more I cool it down, the more electricity I have to spend. There's a tradeoff. And what the "right" tradeoff is depends on the player: my ship design (e.g. do I have lots of electrical power generation to spare, or is it a precious resource that I have to dole out stingily?), my desired behavior (how much inefficiency of the hot part am I willing to tolerate?) and so forth. How much electricity am I willing to spend to accomplish a given amount of improved part efficiency? There's no way for the mod to know that.

So I figured to [URL="https://en.wikipedia.org/wiki/KISS_principle"]KISS[/URL] it and just make it a simple on/off switch that the player can toggle. This leaves the decision up to the player, makes the experience more consistent (it's essentially what the folding radiator panels are doing already) and gives the player something to do.

There's also a philosophical issue at play here: I know that KSP play-style philosophy varies a lot-- some folks like lots of automation (KER, MechJeb), some folks like very minimal automation and doing everything themselves. I'm very much in the latter camp. So I prefer to write a mod that doesn't actually do anything [I][U]for[/U][/I] you, it just gives you a choice about what you [I][U]can[/U][/I] do and lets the player take more action. "Turn things on and off to manage ship behavior" is the sort of thing that I know seems like boring, tedious make-work to some people... but for me it's actually a big part of the fun of KSP and I [I][U]want[/U][/I] to have this mechanic. I enjoy keeping an eye on my temperature and electricity and making control decisions about how to do it.

So anyway, that's why. At some point I may circle back to add a configurable option to make the radiators draw an amount of electricity that's proportional to the heat transfer involved, which would be a useful enhancement. However, I'm new to modding in the past couple of weeks, and there are so many exciting new things I want to do! :) So it may be a little while before I circle back here to add new features, I have another couple of mods I'd like to do first.

I'll be sure to post an update here if/when I add the feature.
Link to comment
Share on other sites

  • 2 months later...

Hi all...

As you may have heard, this mod's previous hosting site has gone permanently off the air.  :(

This makes me very sad, because I've absolutely adored it.

I loved it as a user:  I could browse mods, find the ones I want, etc.  And I loved it as a modder:  I can see the traffic history, I can see how many people are actually downloading my mod, which is a huge thrill.  It gives me an endorphin rush to see that this little thing I made has been downloaded thousands of times.  It gives me motivation to keep on modding.  It's why I've chosen that site as the download location for all my mods.

And now it's gone, and I don't have that any more.  It's a tragic loss.

Link to comment
Share on other sites

Good news!  The site's replacement, SpaceDock, is now up and running.  (Mostly.  They're still working the kinks out, and it will take a while until all the mod authors have re-uploaded their mods, but it's "up enough" to be able to put mods there.)

I've updated the download link in the OP to point at SpaceDock.

Thanks to the hardworking devs and admins who have gotten SpaceDock up and running so quickly!

Link to comment
Share on other sites

4 minutes ago, Beetlecat said:

Still waiting for my user account from Spacedock, but thank you for migrating.

I'm guessing you already know this, but just in case:  you don't need an account to download mods.  You only need an account to post a mod, or to be able to follow mods & get email notifications when they update.

Edited by Snark
Link to comment
Share on other sites

2 minutes ago, Snark said:

I'm guessing you already know this, but just in case:  you don't need an account to download mods.  You only need an account to post a mod, or to be able to follow mods & get email notifications when they update.

Oh, of course -- just stream of consciousness in my forum posts sometimes. :)

Link to comment
Share on other sites

  • 2 weeks later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...