Page 12 of 13

Re: [0.11.x] Uranium Power

Posted: Tue Mar 03, 2015 4:38 pm
by mrtux
Fatmice wrote:I had considered adding an electric liquid heater. Maybe that is something useful?
Wouldn't that be just an electric boiler?

I like the idea, but thinking about it my lava example was a bit faulty there: While lava has a temperature, it also has a "temperature identity", meaning that there is lava-2000 an lava-1800, due to the fact that factorio so far does not allow limiting liquid types or temperatures. So while you can cool down lava-2000 to 15 degrees, it will still be lava-2000 – not what we really need.

NB: I am well aware that there are more pressing matters in Factorio and there is only so much time (being a software developer myself). Please consider those remarks only as suggestions or wishes for a future path rather than a request. After all, most of us are spending their leisure time. :)

Re: [0.11.x] Uranium Power

Posted: Wed Mar 04, 2015 3:11 am
by Fatmice
mrtux wrote:
Wouldn't that be just an electric boiler?

I like the idea, but thinking about it my lava example was a bit faulty there: While lava has a temperature, it also has a "temperature identity", meaning that there is lava-2000 an lava-1800, due to the fact that factorio so far does not allow limiting liquid types or temperatures. So while you can cool down lava-2000 to 15 degrees, it will still be lava-2000 – not what we really need.
Well it more general than a boiler. It would be a multi-structured object that allow heating of any fluid to specified temperature withing the range specified by their prototypes. That's why it is call a heater and not a boiler as sometimes you might not want to boil the liquid.
mrtux wrote: NB: I am well aware that there are more pressing matters in Factorio and there is only so much time (being a software developer myself). Please consider those remarks only as suggestions or wishes for a future path rather than a request. After all, most of us are spending their leisure time. :)
Of course, I have ideas that I usually keep in the back of my mind. There is too much and too little time.

Re: [0.11.x] Uranium Power

Posted: Wed Mar 04, 2015 1:55 pm
by mrtux
Fatmice wrote:
mrtux wrote: Well it more general than a boiler. It would be a multi-structured object that allow heating of any fluid to specified temperature withing the range specified by their prototypes. That's why it is call a heater and not a boiler as sometimes you might not want to boil the liquid.
I see. Yes, that would be interesting – especially if the temperature is regulated in-game, i.e. I would not just set it via some GUI. It would be cool if some kind of regulating circuit would lead to a specific temperature, so one would have to build a small factory resulting in a liquid with the desired temperature. (No spontaneous idea how this can be achieved, just the feeling that this would be a much nicer factorio experience than just entering a number.)

Re: [0.11.x] Uranium Power

Posted: Thu Mar 05, 2015 12:24 am
by n9103
If you got it to be a constant output, then it would be a matter of how many in a row would you pipe through.
Variable output has no easy solution in Vanilla.

Re: [0.11.x] Uranium Power

Posted: Thu Mar 05, 2015 3:20 am
by Fatmice
mrtux wrote: I see. Yes, that would be interesting – especially if the temperature is regulated in-game, i.e. I would not just set it via some GUI. It would be cool if some kind of regulating circuit would lead to a specific temperature, so one would have to build a small factory resulting in a liquid with the desired temperature. (No spontaneous idea how this can be achieved, just the feeling that this would be a much nicer factorio experience than just entering a number.)
Well I was thinking GUI as it would be the simplest and cleanest. However, now that I've thought about it, it is not hard to make hysterisis tanks to modify a fluid with a certain temperature. The hard part is to figureout how many such tanks would be needed if each tank can only impart a set amount of change. What you're asking is essetially a steady-state system.
n9103 wrote:If you got it to be a constant output, then it would be a matter of how many in a row would you pipe through.
Variable output has no easy solution in Vanilla.
Variable output is not hard either. It is actually quite easy to implement with just two tanks and a chest containing signal.

Re: [0.11.x] Uranium Power

Posted: Thu Mar 05, 2015 3:01 pm
by n9103
Unless I missed something in the last few patches, there's no way to get a signal based on fluid amounts or temperature in Vanilla.
Plenty of modded ways, sure (I favor Smart Circuits personally), but there's a solution to every problem once you start including mods.

Re: [0.11.x] Uranium Power

Posted: Thu Mar 05, 2015 3:15 pm
by mrtux
That's right, but nobody suggested a solution using vanilla (although I'd prefer it).

As I wrote earlier: liquid handling, as it is now, is very basic. I remember reading something about upgrades to the liquid system, but I believe this was limited to smart containers and pumps or valves in the sense that those could be switched on or off based on storage tank content.


Anyway (and this was my concern from the beginning) Factorio is about achieving complex behaviour with very basic elements. So the question is: What would be the one or two additional features that would be needed in order to change and regulate a fluid's temperature.

One quick idea:
With some way of measuring current throughput (which I would like to have anyways) or temperature and acting on this measurement, a boiler could be fed by a smart inserver or a heater could be turned on/off by a power switch.

Re: [0.11.x] Uranium Power

Posted: Thu Mar 05, 2015 3:53 pm
by n9103
All you would need is a way to read the fluid amount/level (and temperature in this case).
Just the Smart Tank from Smart Circuits would do the trick, when coupled to a pump or inserter circuit.
Throughput doesn't really matter, since having too little throughput would trigger the low level, and too much, the high level.
Being able to read the temperature as well means you can trigger your pump array (since this requires more flow rate than a single pump, a good thing in this case) to be more or less active to maintain a flow rate that goes slow enough to achieve the desired temperature, but no slower.

In order to be unique from Smart Circuits, perhaps a combined sensor/pump unit?

Re: [0.11.x] Uranium Power

Posted: Fri Mar 06, 2015 12:48 am
by Fatmice
n9103 wrote:Unless I missed something in the last few patches, there's no way to get a signal based on fluid amounts or temperature in Vanilla.
Plenty of modded ways, sure (I favor Smart Circuits personally), but there's a solution to every problem once you start including mods.
Well, not everything can be solved with modding. For example, catching when assembler finished producing is not possible with lua. I've tried and failed and the devs sent their condolences. They said such thing will cost too much computational resource and won't add such interface for lua. It is very straight forward to control fluid if you can catch assembler state. While you can't count fluid, you can infer fluid amount in a steady-state system. I agree though that there is no easy solution with vanilla objects.
mrtux wrote:That's right, but nobody suggested a solution using vanilla (although I'd prefer it).

As I wrote earlier: liquid handling, as it is now, is very basic. I remember reading something about upgrades to the liquid system, but I believe this was limited to smart containers and pumps or valves in the sense that those could be switched on or off based on storage tank content.

Anyway (and this was my concern from the beginning) Factorio is about achieving complex behaviour with very basic elements. So the question is: What would be the one or two additional features that would be needed in order to change and regulate a fluid's temperature.

One quick idea:
With some way of measuring current throughput (which I would like to have anyways) or temperature and acting on this measurement, a boiler could be fed by a smart inserver or a heater could be turned on/off by a power switch.
From what the devs said, fluid control will work from a vanilla perspective when they add in liquid logic and electrical logic. However, it is currently possible to control fluid throughput and therefore temperature of a liquid using vanilla object. Such solutions permit very coarse control though.
n9103 wrote:All you would need is a way to read the fluid amount/level (and temperature in this case).
Just the Smart Tank from Smart Circuits would do the trick, when coupled to a pump or inserter circuit.
Throughput doesn't really matter, since having too little throughput would trigger the low level, and too much, the high level.
Being able to read the temperature as well means you can trigger your pump array (since this requires more flow rate than a single pump, a good thing in this case) to be more or less active to maintain a flow rate that goes slow enough to achieve the desired temperature, but no slower.

In order to be unique from Smart Circuits, perhaps a combined sensor/pump unit?
Hm, a combined unit can be done. I can make one programmable with a chest for signal. :)

0.11.17 tested and looks to work with current version of mod 0.5.3

Re: [0.11.x] Uranium Power

Posted: Fri Mar 06, 2015 1:41 am
by Zeeth_Kyrah
n9103 wrote:In order to be unique from Smart Circuits, perhaps a combined sensor/pump unit?
How would that work? I suppose it would have a GUI that lets you adjust settings, but if the pump only responds to a certain level of temperature, how would it know unless it were already passing fluid through?

Re: [0.11.x] Uranium Power

Posted: Fri Mar 06, 2015 2:50 am
by n9103
Perhaps I've been spoiled by Smart Circuits, but I thought that pumps were always controllable based on signals when connected with red/green wire, and not just in that mod.
I never found a real use for controlling them based on signal until I started using SC, and it's fluid sensor. Without that, it's limited to either acting as a one-way valve, or some forms of backup power.

Re: [0.11.x] Uranium Power

Posted: Fri Mar 06, 2015 3:28 am
by Fatmice
Zeeth_Kyrah wrote:
n9103 wrote:In order to be unique from Smart Circuits, perhaps a combined sensor/pump unit?
How would that work? I suppose it would have a GUI that lets you adjust settings, but if the pump only responds to a certain level of temperature, how would it know unless it were already passing fluid through?
Of course the sensor will need to be before the pump. The building would need to have several disconnected fluidboxes. Maybe something like this,

Code: Select all

         |
         V
=>Storage tank /=space=/ buffer-pipe|pump=>
         ^                          |control-chest
         |
I would then use Lua to sense temperature of storage tank. When the temperature condition is met, Lua will fill buffer-pipe entirely, set pump to be active and then toggle pump state in such frequency as to get desired throughput stated in control-chest. All other times, pump will be inactive. A word about fluid temperature, there would need to be allowance for temperature deviation, say +/- 0.1 of a degree from set temperature would be acceptable to meet temperature condition.

As for how to get desired liquid temperature, I imagine it is a little mini-game with a sequence of pipes and liquid heater:

Code: Select all

liquid at fixed throughput=>sequence of (liquid heater)(+pipe)(-pipe)=>liquid-with-set-temp
So liquid is provided at a fixed throughput. Liquid will pass through a series liquid heater and pipes that either add or subtract a percentage of energy from the liquid. This will give a temperature profile that sinusoidally approaches the temperature that you want.

Re: [0.11.x] Uranium Power

Posted: Wed Mar 18, 2015 6:19 am
by sapog
Image
what???

Re: [0.11.x] Uranium Power

Posted: Wed Mar 18, 2015 7:08 am
by sapog
changes in version 11.14 wrote:Scripting
Added write access to ammo amount left of item stack.
[] operator of LuaInventory returns LuaItemStack object instead of the simplified table.
LuaInventory::getitemstack was removed as the [] operator can be used instead.
Added read property LuaItemStack::prototype.
Added LuaItemStack::drainammo/addammo.
lua as chinese language for me...

Re: [0.11.x] Uranium Power

Posted: Wed Mar 18, 2015 7:27 am
by sapog
ok, i get it.
replace this

Code: Select all

                     local thing = chest.getitemstack(i)
with this

Code: Select all

                     local thing = chest[i]

Re: [0.11.x] Uranium Power

Posted: Wed Mar 18, 2015 8:24 pm
by Fatmice
Hi, what version are you running? I do not recall using .getitemstack in my code.

Re: [0.11.x] Uranium Power

Posted: Thu Mar 19, 2015 1:08 am
by sapog
Liquius wrote:Here's a download link to the latest version
0.5.1(2015.01.23)
.....
Here's a link to github
https://github.com/Liquius/UraniumPower/
from first post.
now i see newer version on the 17 page...

Re: [0.11.x] Uranium Power

Posted: Thu Mar 19, 2015 1:46 am
by Fatmice
There's been a changed in developer. I'm the maintainer now.

The 0.5.1 version given in the link does not use getitemstack. The one that does use that was from a code merge and is only available from the github, so you must have downloaded that. It tried to decay fuel using a now deprecated member function. Fuel decay will be implemented in 0.7.0, which is further down the line.

I'm actively working on 0.6.0 release. Introducing new features required that I go back to make even more tweaks to how the reactor was getting its energy and so there were a lot of headache as to how to balance the thing in the background while maintaining the same performance. There were also problems with multiplayer desync issues caused by the old heat exchanger made by Liquius that I've yet to resolved. Anyways, here's a sneak peak at one of the new building.

Re: [0.11.x] Uranium Power

Posted: Thu Mar 19, 2015 2:38 am
by Zeeth_Kyrah
That looks awesome so far! Looking forward to the update.

Re: [0.11.x] Uranium Power

Posted: Fri Mar 20, 2015 2:31 am
by sapog
imagine this: huge number highly mutated alien filth around nuclear waste storage, it would be a fun