边缘世界 RimWorld

边缘世界 RimWorld

Power Alerts
Oh God Spiders No 2019 年 4 月 3 日 下午 7:45
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.
< >
正在显示第 1 - 15 条,共 16 条留言
Oh God Spiders No 2019 年 4 月 3 日 下午 7:52 
Deleting my first comment; I need to think about this some more
Diddily  [开发者] 2019 年 4 月 3 日 下午 8:02 
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  [开发者] 2019 年 4 月 3 日 下午 8:05 
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  [开发者] 2019 年 4 月 3 日 下午 8:06 
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.
Oh God Spiders No 2019 年 4 月 3 日 下午 8:13 
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 }
最后由 Oh God Spiders No 编辑于; 2019 年 4 月 3 日 下午 8:15
Oh God Spiders No 2019 年 4 月 3 日 下午 8:18 
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  [开发者] 2019 年 4 月 3 日 下午 8:25 
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.
Oh God Spiders No 2019 年 4 月 3 日 下午 9:22 
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  [开发者] 2019 年 4 月 5 日 下午 7:26 
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.
Oh God Spiders No 2019 年 4 月 6 日 下午 3:09 
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  [开发者] 2019 年 4 月 6 日 下午 5:50 
Alright, the new alert should be live, thanks for the suggestion and let me know how it works for you!
Oh God Spiders No 2019 年 4 月 6 日 下午 9:06 
dude that's awesome! I'll let you know as soon as I get a chance
Oh God Spiders No 2019 年 4 月 8 日 上午 9:50 
Works like a charm! This mod is seriously useful, thanks again for putting it together.
Diddily  [开发者] 2019 年 4 月 8 日 下午 12:45 
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.
Oh God Spiders No 2019 年 4 月 8 日 下午 3:40 
Nice, can't wait! I haven't noticed any particular problems with that but I'm sure there's always room for improvement.
< >
正在显示第 1 - 15 条,共 16 条留言
每页显示数: 1530 50