[MOD 0.16.x] Realistic Power

Topics and discussion about specific mods
Kenira
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Fri Nov 04, 2016 10:21 am
Contact:

[MOD 0.16.x] Realistic Power

Post by Kenira » Thu Dec 29, 2016 5:41 pm

Type: Mod
Name: RealisticPower
Description: Revamps energy production and consumption to be more realistic (harder) and splits accumulators into two types: very high capacity with low power, and low capacity with high power. To be used with DayNightExtender for longer (4h - 24h) day / night cycles.
License: MIT
Version: 1.0.9
Latest release: 2018-06-27
Tested-With-Factorio-Version: 0.16

Mod Portal Link

Long description
Supported Mods
Real life data for solar and accumulator changes and details
Known Issues
Changelog
Last edited by Kenira on Wed Apr 03, 2019 5:42 pm, edited 24 times in total.

User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 522
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by thereaverofdarkness » Mon Jan 30, 2017 7:34 am

I've been playing with your mod and I like it!

I'm trying to revive Molay's Harder Energy mod, updating it for 0.14 (and later 0.15) along with some tidbits from my own crappy Capacitors and Batteries mod, both are from way back in 0.12. I borrowed a lot of code from your mod, and the result (so far) is much larger than Molay's mod yet much smaller than yours.

I've attached my work so far, and I wanted to know what you think of it. Also I came to ask for permission since I'm borrowing your code! (since I don't know how to write code) :lol:

It's listed as version 0.1.0 even though it's actually 0.0.1 but I just did it that way so I don't have to change it. I don't intend to publish it until 0.1.0.
Attachments
HardEnergy_0.1.0.zip
(427.68 KiB) Downloaded 53 times

Kenira
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Fri Nov 04, 2016 10:21 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by Kenira » Mon Jan 30, 2017 10:36 pm

Thanks!

Sure, go ahead and use the code. I am not very well versed (read: not at all) in lua myself either, which is why that code for proportional capacitor drain you copied is also not written by me but some awesome person who saw it was on my to do list and happened to just have written a mod for that kind of thing themselves ;)

As for what i think about your work, the one issue i noticed so far is that you need to copy most of the control.lua (basically everything except for the bit at the top about configuring daynightextender), and the accumulator-drain item and entity files too for the drain to work properly. The accumulator-drain-1 and accumulator-drain-2 have different max drains (defined with the input_flow_limit) to allow different drains for capacitors vs batteries, if you want to set that up too. If not you can delete one of them. Which drain gets assigned to which accumulator type is defined in the control.lua, in the BuiltEntity function, which you'll have to set up for the names of your accumulators with the locals battery_accumulator and capacitor_accumulator near the top of the control.lua.

I hope that was clear enough, it's bed time for me now but if you have more questions i'd be glad to answer them tomorrow.

User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 522
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by thereaverofdarkness » Tue Jan 31, 2017 5:11 am

Kenira wrote:the one issue i noticed so far is that you need to copy most of the control.lua -snip- and the accumulator-drain item and entity files too for the drain to work properly.
I actually cut out the drain entirely. :P

I wanted the mod to be as lightweight as possible. I was considering adding capacitors from my mod but then I decided I actually like making the capacitor accumulators cost only copper and steel. That way if you don't have oil, you can make capacitor accus on nothing but red and green science. People with a hefty resource flow are more likely to want to install a huge array of battery accumulators, while low-profile bases may be satisfied with a lower capacity and just use steam engines to supplement power at night.

I'm going to need to add some new code to adjust KS Power in ways your mod isn't doing it, but I think I can find the code from...places.

I put you in as an author as well as Maglay even though his mod was really small, because he gave me the idea and because I'm using his coal and solid fuel values.

I do have a question though. Could you see fit to add capacitors from my mod into realistic power? Functionally capacitors are a different kind of diode and are made with different materials. It makes more sense for them to be produced differently. I used Gimp to change a photo of a real circuit capacitor into an item icon, and I also adjusted the accumulator color slightly to make the high power one look different.
Attachments
Capacitors_and_Batteries_0.9.2.zip
(428.02 KiB) Downloaded 52 times

Kenira
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Fri Nov 04, 2016 10:21 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by Kenira » Tue Jan 31, 2017 12:27 pm

I will probably keep the recipes for gameplay reasons. I am aware of how different capacitors actually are from batteries, but the capacitors in the game already need a lot fewer batteries, and you don't need many of them, only as buffers for lasers basically. It's a tiny fraction of the batteries you need for the battery capacitors so you won't really notice it, but i don't want to make them too trivial to make so that works out. Adding dedicated capacitor parts as an intermediate product to balance it with more basic materials could also work but so far i'd rather keep it simple.

I am also not going to include your capacitors. The values for both battery and capacitor accumulators in RealisticPower are based on their real life performance, which then also works nicely with 24h days.

User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 522
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by thereaverofdarkness » Tue Jan 31, 2017 4:39 pm

That makes sense. Also it does seem a bit redundant to gain capacitors and batteries both from the same tech research and from the same oil product (petroleum gas).


I've been playing a game with Realistic Power and Day Night Extender, and I've been noticing that the night is maximum darkness for only a short time. I've got it set to run a cycle in about 1 hour, and I timed roughly 30 minutes full day to 5 minutes full night, with ~12.5 minutes each twilight--this is based on power output from solar panels, but the lighting would seem to agree with the figures. Have you noticed this, or is it the same in your game(s)?

Kenira
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Fri Nov 04, 2016 10:21 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by Kenira » Tue Jan 31, 2017 5:10 pm

DayNightExtender does not change the ratio of day vs night time as it is in the base game, it just draws everything out. In vanilla complete night time is also a lot less than day time. Inlcuding twilight, in a 24h day the effective night time is only 7.2h.

User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 522
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by thereaverofdarkness » Wed Feb 01, 2017 3:16 am

Well that's strange.

I need a way to change it into having half day and half night. Ideally I'd like shorter twilights, more like 45% day, 45% night, 5% sunrise, and 5% sunset. Do you know any way to do this by tweaking Day Night Extender? I'll ask in the Day Night Extender post as well. If you have any thoughts about it, you may respond to my post over there if it fits better there.

viewtopic.php?f=92&t=28822&p=240440#p240440

Kenira
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Fri Nov 04, 2016 10:21 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by Kenira » Thu Feb 09, 2017 3:40 pm

New version 0.0.4 with support for Yuoki mods is out.

Support for Angel's and Bob's mods is still planned, those are the last ones on my to do list for now. If you would like to see any other mods supported, please let me know and i'll consider adding them too.

User avatar
withers
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Apr 08, 2016 4:54 pm
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by withers » Thu Feb 09, 2017 5:53 pm

When you add support for Bobs, maybe it would be more realistic to add bobs silicon wafers to the recipe for solar panels. This would push solar panels back a lot and force exclusive coal use longer and make the game even more harder. I'm considering tweaking my next game to do just that in my home brew mod and also,adding your mod to my list.

Kenira
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Fri Nov 04, 2016 10:21 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by Kenira » Thu Feb 09, 2017 7:40 pm

withers wrote:When you add support for Bobs, maybe it would be more realistic to add bobs silicon wafers to the recipe for solar panels. This would push solar panels back a lot and force exclusive coal use longer and make the game even more harder. I'm considering tweaking my next game to do just that in my home brew mod and also,adding your mod to my list.
That's an interesting idea, makes me want to play Bob's again. And i can always make that feature toggleable so i think i'll add it. Thanks for the suggestion :)

Kenira
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Fri Nov 04, 2016 10:21 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by Kenira » Mon Mar 06, 2017 9:07 pm

Big update up. Added support for Bob's, Angel's and Flow Control and also overhauled most of the code, hopefully without introducing a lot of bugs. Can't really playtest all mods.
By default solar panels now all require wafers with Bob's mods but it can be toggled.

SunTroll
Inserter
Inserter
Posts: 28
Joined: Sat Feb 04, 2017 5:11 pm
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by SunTroll » Thu Mar 30, 2017 5:58 pm

When I try to run this mod with angelsbioprocessing_0.3.1 I get the following error:
failed to load mod "RealisticsPower 0.0.6"
_RealisticsPower_/data-final-fixes.lua:14:
_RealisticsPower_/functions.lua:24 bad argument #1 to 'match' (string expected got, got nil)

Kenira
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Fri Nov 04, 2016 10:21 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by Kenira » Thu Mar 30, 2017 6:56 pm

Fixed in the new version that i was working on anyway, and i hope by (again) overhauling the code to not be as hilariously bad and inefficient any more i didn't break a thousand other things.

SunTroll
Inserter
Inserter
Posts: 28
Joined: Sat Feb 04, 2017 5:11 pm
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by SunTroll » Thu Mar 30, 2017 7:26 pm

Fastest update I have ever seen.

User avatar
ZombieMooose
Fast Inserter
Fast Inserter
Posts: 233
Joined: Mon Feb 09, 2015 7:23 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by ZombieMooose » Thu Mar 30, 2017 9:18 pm

I have a suggestion. There used to be a mod (I don't remember the name of it) where different power poles transfered different amounts of electricity, e.g. wooden power poles the least, substations the most, etc

I don't know if this is within the scope of this mod, but it sure seems "realistic".

Kenira
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Fri Nov 04, 2016 10:21 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by Kenira » Thu Mar 30, 2017 9:22 pm

It does and i like the idea, but it would impact the performance too much so i won't be adding it.

User avatar
ZombieMooose
Fast Inserter
Fast Inserter
Posts: 233
Joined: Mon Feb 09, 2015 7:23 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by ZombieMooose » Sat Apr 01, 2017 5:02 am

Kenira wrote:It does and i like the idea, but it would impact the performance too much so i won't be adding it.
Fair enough. Maybe in 0.15 where optimization should be enough the performance won't be that bad?

Anyway cheers and thanks for the cool mod.

Kenira
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Fri Nov 04, 2016 10:21 am
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by Kenira » Sat Apr 01, 2017 11:20 am

The performance boost in 0.15 won't have any effect on this afaik. They'd have to redesign how power grids work in order for this idea to not have a noticeable performance impact because as it is you'd just have to micromanage the power with scripts which is very inefficient. And i don't see the devs changing how power works just so some modders can implement some ideas better, so no, it probably won't ever happen, sadly.

Glad you like the mod!

SunTroll
Inserter
Inserter
Posts: 28
Joined: Sat Feb 04, 2017 5:11 pm
Contact:

Re: [MOD 0.14.x] Realistic Power

Post by SunTroll » Mon Jun 26, 2017 2:19 pm

Are you planning to update this mod for 0.15? (Are you waiting before all nuclear mods update?)

Post Reply

Return to “Mods”

Who is online

Users browsing this forum: Cardoyle, robot256