RimWorld

RimWorld

Power Alerts
Excess Power Alert
Ideas for an alert that would trigger if the player has a bunch of extra chemfuel or wood generators burning for no good reason.
< >
Showing 1-15 of 16 comments
Deleting my first comment; I need to think about this some more
Diddily  [developer] 3 Apr, 2019 @ 8:02pm 
My first thought is to at least average the power of a solar panel across 24 hours (assuming it's not obstructed at all) and use that instead of the actual power output for determining if a generator is running in excess (as long as there is no solar eclipse). Wind is a bit harder, I'd probably make it a configurable value to assume as it's output.
Diddily  [developer] 3 Apr, 2019 @ 8:05pm 
My goal would be to trigger the alert if Static Power + (Average Power Per Solar * Num Solar) + (Average Power Per Wind * Num Wind) - Power Consumed > Power From Fueled Generator
Diddily  [developer] 3 Apr, 2019 @ 8:06pm 
I could also make it trigger if it's been in excess for some amount of time, like the opposite of the timer for when batteries/fuel will run out.
What about something like this?

If the excess is high we want to know about it; but excess coming from wind and solar should each be weighted less since they fluctuate. var weighted_contribution_of_stable_sources = num_thermo_plants + num_water_mills + (solar_constant * num_solar_panels) + (wind_constant * num_wind_turbines) if ( weighted_conribution_of_stable_sources > reasonable_buffer_high && num_chem_or_wood_generators > 0 ) { alert_on = True } if (weighted_conribution_of_stable_sources < reasonable_buffer_low) { alert_on = False } if (num_chem_or_wood_generators == 0){ alert_on = False }
Last edited by Oh God Spiders No; 3 Apr, 2019 @ 8:15pm
Sounds like we're basically coming at this the same way, which is weighing solar and wind contributions less than the static sources.

I think the best way to avoid annoying fluttering alerts might be to have a high and low buffer, and trigger the alert when it goes above, and don't turn it off until it goes below.

Also, always turn off the alert if the player has turned off or disconnected all of his fueled sources.
Diddily  [developer] 3 Apr, 2019 @ 8:25pm 
Latching the alert (turning it on until a lower threshold is hit) is a good idea here, I think we can make it work. I'll also make the contribution of the fluctuating power sources mod configurable so it can be tweaked to the users liking.

The alert would only fire on refuelable generators that are turned on, with fuel and a connected power consumer. I also have to look into how batteries charge, if the excess makes them charge faster then I'd want to avoid triggering the alert until the batteries are full/near full.
That sounds awesome.

I'd say you should probably ignore batteries. They charge at 50% efficiency, so using generators to charge them is almost always a bad idea.
Diddily  [developer] 5 Apr, 2019 @ 7:26pm 
Quick update, got a first pass of this up working, still needs bug testing/fixing.

I found a function that calculates the average sun glow for a day, so I'm using that to average the power expect from solar generators so it'll be more consistent. I also found out through testing that wind (excluding any weather) typically blows at 55% on average, so I'm using that for wind turbines.

Also might add an obstructed generator warning (for roofed solar, blocked wind and too close water) since that sounds helpful.
That's awesome. Btw I actually got a chance to play with the mod for the first time last night and it was even better than I thought it would be. You did a great job! Tiny startup impact, too!
Diddily  [developer] 6 Apr, 2019 @ 5:50pm 
Alright, the new alert should be live, thanks for the suggestion and let me know how it works for you!
dude that's awesome! I'll let you know as soon as I get a chance
Works like a charm! This mod is seriously useful, thanks again for putting it together.
Diddily  [developer] 8 Apr, 2019 @ 12:45pm 
Glad you like it, thanks for the suggestion, it was a good one. I'm going to make one more minor tweak in the near future to smooth out the power draw of the sunlamp over a day so the alert doesn't fire every night when the lights go off.
Nice, can't wait! I haven't noticed any particular problems with that but I'm sure there's always room for improvement.
< >
Showing 1-15 of 16 comments
Per page: 1530 50