InfinityPipeFilter.percentage has value type double. It's just the gui that imposes limits on the value range.Raiguard wrote: Wed Sep 23, 2020 8:20 pm The only way I can foresee going about this is to add 10,000 different pump prototypes that each have a different pumping rate. You simply cannot change a pump's flow rate at runtime, so barring an addition to the base game, it'll have to do.
Rate-limited Pumps Mod?
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Rate-limited Pumps Mod?
- Attachments
-
- 1.png (14.32 KiB) Viewed 3930 times
-
- 1337.png (15.62 KiB) Viewed 3930 times
-
- 5999.png (21.35 KiB) Viewed 3930 times
-
- 6of9.png (15.9 KiB) Viewed 3930 times
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Rate-limited Pumps Mod?
Yeah, I realized this after posting as well. Regardless, I'm working with the devs and it's fairly likely that a solution will be made using the infinity pipe. Stay tuned.eradicator wrote: Wed Sep 23, 2020 9:28 pm InfinityPipeFilter.percentage has value type double. It's just the gui that imposes limits on the value range.
Don't forget, you're here forever.
Re: Rate-limited Pumps Mod?
Factorio 1.1 will let you set infinity pipes to constantly add or remove a certain amount of liquid to/from themselves. This lets you test input or output rates, but does not let you rate-limit in the middle of a system. I will see about making it so pumps can have their speed changed at runtime for that usecase.
Don't forget, you're here forever.
Re: Rate-limited Pumps Mod?
Raiguard wrote: Wed Sep 23, 2020 8:20 pm The only way I can foresee going about this is to add 10,000 different pump prototypes that each have a different pumping rate. You simply cannot change a pump's flow rate at runtime, so barring an addition to the base game, it'll have to do.
Instead of having 10k prototypes, add one for each power of two and do a binary numbers addition of them. then it's just log2(n) pump entities required for precision down to 1/tick. For flow up to 12k/second or 720k/tick that's just 20 static entities needed.Raiguard wrote: Sat Sep 26, 2020 12:29 am Factorio 1.1 will let you set infinity pipes to constantly add or remove a certain amount of liquid to/from themselves. This lets you test input or output rates, but does not let you rate-limit in the middle of a system. I will see about making it so pumps can have their speed changed at runtime for that usecase.
If it's possible to make multi-entity pumps just like the miniloader is composed of several hidden inserters then you could also make it a single dynamic entity to the player.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Rate-limited Pumps Mod?
That was actually my first thought. But unlike inserters you can't have more than one (working) fluid box per tile as far as i understand. So you'd need a complicated mess of parallel pumps with manifold-mod style pipes and the whole thing would need to be 5x5+ to get anywhere. And the tooltip wouldn't work either ofc.Qon wrote: Sat Sep 26, 2020 9:08 am Instead of having 10k prototypes, add one for each power of two and do a binary numbers addition of them. then it's just log2(n) pump entities required for precision down to 1/tick. For flow up to 12k/second or 720k/tick that's just 20 static entities needed.
And well, infinipipes already have that precision anway.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Rate-limited Pumps Mod?
That's a smart idea, though I'm not too sure if it would be able to work completely properly. I haven't really messed with fluids all that much.Qon wrote: Sat Sep 26, 2020 9:08 am Instead of having 10k prototypes, add one for each power of two and do a binary numbers addition of them. then it's just log2(n) pump entities required for precision down to 1/tick. For flow up to 12k/second or 720k/tick that's just 20 static entities needed.
If it's possible to make multi-entity pumps just like the miniloader is composed of several hidden inserters then you could also make it a single dynamic entity to the player.
Another idea someone had was to make a few different speed pumps, then use control behavior to enable/disable them at certain intervals to simulate a certain amount of throughput. But that would incur a running performance cost that I would like to avoid if I can.
Hopefully, pumps will just straight-up gain the ability to change their pumping speed. We'll see.
Don't forget, you're here forever.
Re: Rate-limited Pumps Mod?
Awwwweradicator wrote: Sat Sep 26, 2020 3:03 pm But unlike inserters you can't have more than one (working) fluid box per tile as far as i understand.
Yes, but I suggested this for flow rate limiting, not fluid creation limiting. If you want reduced flow in a system of fluids that are created in a non-cheated way or want to appy the rate limiting anywhere after the creation then this is needed.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Re: Rate-limited Pumps Mod?
The offshore pump doesn't support any fuel. It's impossible to make them depended from electric energy or fuel generator.Raiguard wrote: Sat Sep 26, 2020 5:11 pm Hopefully, pumps will just straight-up gain the ability to change their pumping speed. We'll see.
But you can make an assembling machine, that looks like the offshore pump and makes the water from nothing. For example 1 fluid of water per second.
Re: Rate-limited Pumps Mod?
Workaround #2:
Just like every other machine in Factorio, the speed of a pump is proportional to the amount of power it is supplied with. Vanilla pumps have a pretty crap power usage value of 29kW which translates to 483.333333333 J/tick. Such a value is a pain to work with so instead I made my own pump.
My modified pump doesn't have any power drain and has a power usage of 720kW which translates to 12000 J/tick. So supplying this pump with 1 J/tick slows down its pump rate to 1 fluid/s, so it becomes extremely easy to set the exact pump rate by configuring the Electric Energy Interface that's supplying it with power.
The cool thing about Electric Energy Interfaces is that they can be configured at runtime via Lua API.
Just like every other machine in Factorio, the speed of a pump is proportional to the amount of power it is supplied with. Vanilla pumps have a pretty crap power usage value of 29kW which translates to 483.333333333 J/tick. Such a value is a pain to work with so instead I made my own pump.
My modified pump doesn't have any power drain and has a power usage of 720kW which translates to 12000 J/tick. So supplying this pump with 1 J/tick slows down its pump rate to 1 fluid/s, so it becomes extremely easy to set the exact pump rate by configuring the Electric Energy Interface that's supplying it with power.
The cool thing about Electric Energy Interfaces is that they can be configured at runtime via Lua API.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Rate-limited Pumps Mod?
Has the rather large drawback of being unusable inside an existing factory though. Or with typical "creative" style wide-area power poles. But it's a very nice approach.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Rate-limited Pumps Mod?
Also works with burner energy source.eradicator wrote: Sun Sep 27, 2020 3:51 am Has the rather large drawback of being unusable inside an existing factory though. Or with typical "creative" style wide-area power poles. But it's a very nice approach.
To control the amount of energy fed per tick in that case requires using fuels with specific fuel values (1 J fuel = 1 J/tick). The maximum item stack size is 4294967295, which should last pretty much forever.
EDIT: Or with a fluid energy source:
Fluid energy sources are particularly interesting because fluids can have different temperature, and the temperature controls their energy content. So with the right setup of heat capacity, and fluid consumption rate one can precisely control the energy available to the pump. In the above screenshot I setup things such that 1ºC = 1J = 1 fluid/s.
EDIT2: This would've been a lot easier if there was an energy_source type which allows directly setting the J/tick power supply, configurable from Lua API.
Re: Rate-limited Pumps Mod?
Holy crap, you're a genius. The fluid energy source method works perfectly, and I have implemented it into Editor Extensions:
(note: you can set any integer value between 0 - 30,000, not just the slider increments)
Now I need to add the circuit and logistic connections to this GUI so you can continue using them if you want...
Don't forget, you're here forever.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Rate-limited Pumps Mod?
Any particular reason why the upper limit is so low?Raiguard wrote: Tue Sep 29, 2020 1:00 am (note: you can set any integer value between 0 - 30,000, not just the slider increments)
I.e. the Electric Energy Interface also has a GUI slider with a much lower range than the actually allowed values - allowing advanced usage without making the gui clunky to use.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Rate-limited Pumps Mod?
Vanilla pumps are only capable of 12,000 per second, and you can only achieve that with storage tanks. With a regular vanilla pipe, the max limit is 6000 / second. I feel like 30,000 is a good high number, but it would be fairly trivial to increase it if needed.eradicator wrote: Tue Sep 29, 2020 1:27 amAny particular reason why the upper limit is so low?Raiguard wrote: Tue Sep 29, 2020 1:00 am (note: you can set any integer value between 0 - 30,000, not just the slider increments)
I.e. the Electric Energy Interface also has a GUI slider with a much lower range than the actually allowed values - allowing advanced usage without making the gui clunky to use.
Edit: should mention that the upper limit is based on the prototype, so adjusting the upper limit requires tweaking the pump's prototype properties.
Don't forget, you're here forever.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Rate-limited Pumps Mod?
Well, mods do crazy things sometimes. And for testing crazy builds (or crazy mods ;) higher numbers might come in handy. Huge tanks are not uncommon either, and 30 seems like a strangely odd number. And above all: This is factorio. So increasing the manual input limit to 100k or 1M without changing the slider limits might come in handy.Raiguard wrote: Tue Sep 29, 2020 1:32 am Vanilla pumps are only capable of 12,000 per second, and you can only achieve that with storage tanks. With a regular vanilla pipe, the max limit is 6000 / second. I feel like 30,000 is a good high number, but it would be fairly trivial to increase it if needed.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Rate-limited Pumps Mod?
Fair enough. I increased the non-slider maximum to 600,000 / s. Unfortunately I can't make it a nice, round number like 1M because the number has to be divisible by 60 in order to avoid rounding errors.eradicator wrote: Tue Sep 29, 2020 1:38 am Well, mods do crazy things sometimes. And for testing crazy builds (or crazy mods higher numbers might come in handy. Huge tanks are not uncommon either, and 30 seems like a strangely odd number. And above all: This is factorio. So increasing the manual input limit to 100k or 1M without changing the slider limits might come in handy.
Don't forget, you're here forever.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Rate-limited Pumps Mod?
That sounds like a good factorian compromise :). Thanks.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Rate-limited Pumps Mod?
There's one minor flaw with the super pump that I've found: in order to make the throughput capabilities so ridiculous, I had to give the pump's fluidbox a ridiculous height (1500, vs. a regular pipe's 1). Because of this, if the output backs up, the pipe will amass a ridiculous amount of buffer. And if a new output is connected (i.e. a storage tank), the pump will practically teleport its buffer into that tank because it will run at max speed for a few ticks.
I'm not sure that there's anything I can do about it, but if anyone has any ideas, I'm all ears!
I'm not sure that there's anything I can do about it, but if anyone has any ideas, I'm all ears!
Don't forget, you're here forever.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Rate-limited Pumps Mod?
You mean other than listening to on_built and active=false'ing the pump unless both sides are connected?Raiguard wrote: Tue Sep 29, 2020 2:19 am I'm not sure that there's anything I can do about it, but if anyone has any ideas, I'm all ears!
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Rate-limited Pumps Mod?
Well, this thread is full of good insight! I'll try that. Thanks!eradicator wrote: Tue Sep 29, 2020 2:35 am You mean other than listening to on_built and active=false'ing the pump unless both sides are connected?
Don't forget, you're here forever.