Combinator tutorial

Post all other topics which do not belong to any other category.
Post Reply
User avatar
cpy
Filter Inserter
Filter Inserter
Posts: 839
Joined: Thu Jul 31, 2014 5:34 am
Contact:

Combinator tutorial

Post by cpy »

Ok i've seen new logic circuits, question is, what can we do with them? I have no idea how to use them. I used old logic network to limit stuff produced like stop inserters if there are more than 1000 items in logistic network or store 200 belts for me, but this, i haven't got a slightest idea, any wiki with some examples to get started?

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Combinator tutorial

Post by ratchetfreak »

most of the useful things will need to wait until v0.13. when we get more IO with the factory itself (in particular reading what's in the logistics, controlling trains, things like that)

What you can do now though is use small pumps to decide when to start cracking heavy into light vs. making lubricant.

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

Re: Combinator tutorial

Post by johanwanderer »

I think there have been a lot of simplification of the new feature. The new combinators basically are op-amps (https://en.wikipedia.org/wiki/Ideal_and_real_op-amps) or logic gates (https://en.wikipedia.org/wiki/Logic_gate), which allow you to build and program your own computer within Factorio, with all the implied complexities.

Other parts of the changes include the ability for entities to report status (liquid storage, etc.) or act on status (pump, etc.) which are useful even without the combinators. Basically, I think that the direction moving forward is you can connect any entity to a signal network, and they can all report their status to the network. Additionally, entities that can be controlled (turn on/off, etc.) can be controlled via the same network.

The combinators come into play when you decide to do more complex things. Say you have a number of mining outposts, each with different mining rate, and you want a steady stream of X ore per minute coming into your depot. Then you would wire up the depot and the outposts, and "write" a program (https://en.wikibooks.org/wiki/Discrete_ ... tics/Logic) via combinators so that at any given time, any of the miners can turn themselves off if the combined outputs exceed the processing power of the depot.

Or write an (albeit very slow) FPS game within Factorio. The scope of that is obviously beyond this topic :)

Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: Combinator tutorial

Post by Peter34 »

cpy wrote:Ok i've seen new logic circuits, question is, what can we do with them? I have no idea how to use them. I used old logic network to limit stuff produced like stop inserters if there are more than 1000 items in logistic network or store 200 belts for me, but this, i haven't got a slightest idea, any wiki with some examples to get started?
Well, the current version has sensors for Storage Tank contents, but not for Accumulator charge percentage (that will be added in either 12.1 or 13.0 - I'm hoping for 12.1).

This means that with the current version, you can create a system to automatically control what your Oil products are used to. For instance, I might want to set up a system to turn Heavy Oil into Lubricant but turn off if at any point my one single Lubricant Storage Tank contains more than 1000 units. Likewise, I might set up another system that cracks Heavy Oil into Light Oil only when my Heavy Oil Storage Tank contains more than 2000 units (actually 500 since I'll have 4 Tanks, and it measures on one Tank).

Similarly, I'll need to decide on threshold values to determine whether Light Oil should be cracked into Petrol Gas or made into Solid Fuel. I need a fair amount of Petrol Gas, but once I've got meself a comfortable buffer, I can start making Solid Fuel.



Likewise, once the new Accu-sensor comes out, electricity production can be handled better.

I might want to run 4 lines each of 2x14 Boilers and 2x10 Steam Engines.

One line I set to always-run. There's no Combinator system interacting with it. This is the way alpha 11/12 works. The Steam Engines will produce as much power as they're asked for, including asked by Accumulators who "want" to charge up to 100%.

Another line I'll set to only run when my Accu's are under 70% charge. Or ideally start running when they fall under 65%, then keep running until they hit 75%. But it may be complicated to do that, compared to just an on/off threshold value.

The third line will do the same, but with a 40% charge threshold. When my Accu's contain less than that, it runs. When they're above 40% of max, it stops.

Fourth line has a threshold of 10% charge.

In this way, during the night, my factory will (mostly) "eat" power from the Accumulators, and only run the Steam Engines when the Accu's start to run low, apart from one line (25% of all Steam Engines, all 80) which runs constantly as a kind of "guaranteed backup" in case there's a screw-up somewhere. Either a bug, or some mistake I've made.

Ideally, such a setup will have so many Solar Panels that the Steam Engines are only asked to run when there's extra drain from the Laser Turrets; the rest of the time, it's Solar only, Solar Panels charging up excess power in the Accu's during the day, to power the normal peaceful factory functioning during night time.

Contrast that with how vanilla Factorio (alpha 11/12) runs: Steam Engines run constantly unless the Accumulators are full, and there's no way to stop them doing that except by manual intervention, which you'd then have to do every evening.

User avatar
cpy
Filter Inserter
Filter Inserter
Posts: 839
Joined: Thu Jul 31, 2014 5:34 am
Contact:

Re: Combinator tutorial

Post by cpy »

So apparently combinators are out of my scope it seems, i never tried to code any program with any logic or redstone or anything that it is in games. But I may try to use that to see if i can synchronize some things.

As for boilers, it seems it would be better to turn off belt than to wire every inserter to network, i wonder if we'll get belt switch block or something like that.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Combinator tutorial

Post by orzelek »

For steam power it's easier to actually use pump as control device then playing with inserters.

And you can do a memory cell that can react to on/off and keep the memory of state - this can be used to store state and let stuff run easily between some other events.

I made thread with circuit + separate network accu control but no interest there.. so I'm guessing it's not needed :D
There was also another one operating based on checking for missing change of state for combinator that powers down.

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

Re: Combinator tutorial

Post by johanwanderer »

orzelek wrote:I made thread with circuit + separate network accu control but no interest there.. so I'm guessing it's not needed :D
There was also another one operating based on checking for missing change of state for combinator that powers down.
I think a lot of us look at things like that and say, "that's cool", then go right back to doing what we are used to. That's partially because we currently don't need to squeeze out every last ounce of performance / resources / clean air / etc. I'm guessing that will change when they add things like performance metrics into the game. Or if they make trees an end-game resource, and since pollution kill trees, starting to pollute too early would cause issues later.

As for me, I file things like that away in the back of my mind somewhere. Hopefully I can recall them when I need it most.

Post Reply

Return to “General discussion”