Page 1 of 1

Poles with limited power distribution

Posted: Sat Aug 31, 2019 7:17 pm
by EffectiveLimit
So I want to give poles a realistic-ish trait of having a limit to how much power they can give. For example, one small pole can give no more than 300 kW (numbers irrelevant, i will balance them), so it will distribute these 300 kW equally to all entities connected to it regardless of how much you actually produce in general. But I can't find a good way to do it, "electric-pole" prototype doesn't use limits, other prototypes also work a bit different and I'm new to modding. Is there a way to do so?

Re: Poles with limited power distribution

Posted: Sat Aug 31, 2019 7:45 pm
by Ranakastrasz
https://mods.factorio.com/mod/flownetwork
This mod apperently does it somehow. No clue beyond that. It probably uses power interfaces and excessive scripting.

Re: Poles with limited power distribution

Posted: Sat Aug 31, 2019 7:51 pm
by eradicator
EffectiveLimit wrote:
Sat Aug 31, 2019 7:17 pm
Is there a way to do so?
No.

Re: Poles with limited power distribution

Posted: Sat Aug 31, 2019 7:57 pm
by eradicator
Ranakastrasz wrote:
Sat Aug 31, 2019 7:45 pm
https://mods.factorio.com/mod/flownetwork
This mod apperently does it somehow. No clue beyond that. It probably uses power interfaces and excessive scripting.
Lulz, a 0.13 mod, where did you dig *that* up :D. (Hey, that means the portal exists longer than i thought.)
Quick look at code...looks like it calculates all energy transfer itself and uses red-circut wire to remember the connections (because it has to delete the real ones to prevent them from interfering). Probably extremely slow, bugprone and user un-friendly.

Re: Poles with limited power distribution

Posted: Sat Aug 31, 2019 8:12 pm
by EffectiveLimit
eradicator wrote:
Sat Aug 31, 2019 7:57 pm
Ranakastrasz wrote:
Sat Aug 31, 2019 7:45 pm
https://mods.factorio.com/mod/flownetwork
This mod apperently does it somehow. No clue beyond that. It probably uses power interfaces and excessive scripting.
Lulz, a 0.13 mod, where did you dig *that* up :D. (Hey, that means the portal exists longer than i thought.)
Quick look at code...looks like it calculates all energy transfer itself and uses red-circut wire to remember the connections (because it has to delete the real ones to prevent them from interfering). Probably extremely slow, bugprone and user un-friendly.
Well, it seems that it worked back then. And it does exactly what I want. But yeah, I can't figure out what happens in control.lua at all.

Re: Poles with limited power distribution

Posted: Sat Aug 31, 2019 10:18 pm
by Ranakastrasz
I had seen it, or something like it before. And I went and searched for "Factotio Power Network Mod" and a bunch of synonyms til I found it. There might be another, but I couldn't find one.

Re: Poles with limited power distribution

Posted: Sat Aug 31, 2019 10:31 pm
by mat1k
It could possibly be done BUT the performance cost of the scripting required would make it unviable. A better option would be to go to the interface requests forum and ask for a throughput_limit = χ kw

It would be a lot easier to implement on the c++ side than with the limited abilities of lua.

Re: Poles with limited power distribution

Posted: Sun Sep 01, 2019 9:14 am
by eradicator
EffectiveLimit wrote:
Sat Aug 31, 2019 8:12 pm
Well, it seems that it worked back then. And it does exactly what I want. But yeah, I can't figure out what happens in control.lua at all.
Lots of things "work" in theory, but are too slow to be fun. This one will definetly not be fast enough for you to enjoy the game unless you're fine with <60UPS before launching your first rocket.
mat1k wrote:
Sat Aug 31, 2019 10:31 pm
A better option would be to go to the interface requests forum and ask for a throughput_limit = χ kw
That would be closed without even a comment. The whole electric network code is based on the assumption that there is no limit. Look at the "make fluid behave like electricity" threads where people argue to remove the flow limit to get more UPS.