Factorio

Factorio

View Stats:
Chibi Life Aug 22, 2021 @ 6:23pm
Circuit Networks
I'm a programmer so the whole circuit network thing is easy as pie for me to understand, however I'm struggling to come up with ideas to put this to use. The same thing with my programming, if there's an easier way to do something I'll choose that over the complex way unless the complex way will yield higher organization and easier to manage and safer code down the line.

Every time I think I want to use a circuit network I work around needing to use it altogether. There are only a few situations where I felt I need to use it which is to shut off boilers when there's accumulator charge. Occasionally I'll set up bullet chests with alarms and alerts to tell me to refill them if running an ammo belt isn't an option.

I've used it to help stop trains from getting deadlocked since inactivity and waiting can sometimes prove to be inefficient. I also used it to get around a stack filter inserter's limitation on whitelist items but that was only in sandbox mode messing around.

Lastly, I've used it to shut off sections of belts so that items will overflow instead of continuing down the line if something more crucial is needed and a specific quantity of it isn't being met.

I saw some threads about cool ideas for circuit networks but they were dated 2 years ago and the game changed a lot since then. Anyone here have any practical use for circuit networks they'd like to share?

I know I can do it to help with fluid control light/heavy oils to help the refineries from getting deadlocked, but I just build more chemical plants and pump out solid fuels completely replacing the need for coal everywhere in my factory except where coal is an actual ingredient in something.

Or perhaps you can recommend some circuit network mods that give insane control, but even then I'd have to find a use for that too lol.
< >
Showing 1-15 of 20 comments
Fel Aug 22, 2021 @ 6:35pm 
There are plenty of situations where circuit network helps to fine-tune things, the most obvious places are usually around oil and nuclear stuff.

For oil, a very simple circuit network is often used to only crack surplus of heavy or light oil (or make solid fuel in case of light oil as well depending on what you need the most at the time).

The kovarex enrichment process can be a fun place to use circuit network (although it's not strictly required with some clever use of belts and splitters).
Nuclear reactors can end up wasting a whole lot of fuel without circuit network (unlike other machines it consumes fuel even if there is nowhere consuming the heat produced).

When using solar panels as the main energy source, it can be helpful to shut down the steam-based power producers unless the accumulators are running low (usually during the night), turning steam power into a backup power source.

One of the ways to feed labs with all of the science packs (called sushi belt) is significantly easier to do with circuit network.

You can do a train network where stations only call for a train when they need items to be delivered with simple circuit network or a much more complex one where trains can be re-used for different items depending on the demand with quite a bit of circuit network logic.

Depending on what you need, you can set custom alerts to fit your needs pretty easily.
Z0MBE Aug 22, 2021 @ 6:36pm 
Try using this latch with things it's an amazing tool. - decider is a big number, arithmetic is a number to subtract from big number - so it fills until big number is reached and then subtracts that number and resets.
It's helped me understand things more.

Also other advice, when you make something = 1 you can make a switch that adds that same signal say 3 times, it will make sure signal never = 1 thereby turning it off until you need it to be on.

You have to copy paste this code into the import blueprint
0eNqNU9FugzAM/Bc/TjA1qC0tD3vbV0wVCuB2liBBiamGKv59DkxrNVHYC5KT8/l8R25Q1B22jgxDdgMqrfGQfdzA08XoOpxx3yJkQIwNRGB0EyrtiD8bZCrj0jYFGc3WwRABmQq/IFNDtMpRYUkVunmCZDhFgIaJCSdFY9HnpmsKdDJhiSeC1npptSZMD3qS9HUXQQ9ZvBVtIHuys3Ve4Ke+knQI7Icnl7tq7PXh9EzOc76yimfEOm5rzQgTu2cdLFXJZhPqptVuVJbBm7TZjttuhvVKjjs5uROPiPh9Ym17EdcZzs/ONjkZ4YDsrGuPwzTVYPkrXIWPw+rRPJIqESS5siOeyuEkvUkAXxyiWYErgQ8h3D9xJCu/xkwih9VE7lT/C2XRPo+BI3/IRh2PEkWLksyoC14WolkI/Jn5s36qp/bPZKXmzJeHMYrJHt5uBFd0ftwiOahtuj2m+1Rt9rv9MHwD8SJUHw==
Last edited by Z0MBE; Aug 22, 2021 @ 6:39pm
Z0MBE Aug 22, 2021 @ 6:40pm 
If you use nuclear I would highly recommend using this mod called "reactor interface" it's also a good way to begin to learn how to use conditions. They're extremely op if used right.
Hurkyl Aug 22, 2021 @ 7:20pm 
I sometimes set up an alarm to let me know if the belt feeding my boilers isn't full, so I know I have to take a look at fuel production.

One thing I've been considering but haven't actually tried implementing is a mall design
with a line of chests on the edge where you can conveniently pick up what you want, and all of the assemblers just dump everything onto a belt to take them to those chests. The circuit network would be important in tracking what assemblers need to actually feed stuff.

I've also thought about using the circuit network to configure some lights to be status indicators for a section of the factory.

I've seen one neat design using circuits to design a safe railroad crossing: when the player uses a gate, it turns nearby train signals red, and conversely, when there's a nearby train it locks the gates to keep you out.

knighttemplar1960 Aug 23, 2021 @ 5:12am 
I use the circuit network for all kinds of things. When I make my permanent defense set up after I have the main factory set up i use the circuit net work to make pop up kill boxes for the bugs.

The gates are down until one ammo magazine is used up
https://steamcommunity.com/sharedfiles/filedetails/?id=2526366398
Then they pop up and the bugs are stuck in the partitions while the automated defense throw the kitchen sink at them. When they pop up that starts a timer that keeps the gates up for 12 seconds. If the ammo still isn't topped back up the timer starts again and the gates stay up for 12 more seconds.
https://steamcommunity.com/sharedfiles/filedetails/?id=2526366524

I use the circuit net work to set up train stops in my outposts and I have supply trains that have crude oil, ammo, spare bots, repair packs, extra walls and gates and when the outpost runs low on any of those items it turns the train stop on and a supply train is dispatched specifically to refill that particular item but the train tops everything off while its there.

I do the same thing with artillery shells at outposts. I have the storage chests that hold artillery shells set up so that when I have room for 400 artillery shells it turns on the train stop and a 2 engine 4 wagon artillery train is dispatched to fill the storage back up.

I use the circuit network to help with things that can be recycled when they are upgraded. So the chest that holds yellow belts (same for splitters and undergrounds) is limited to 1,000 which keeps the other 38 squares empty so that when I upgrade to red belts I can just dump the old yellow belts back into the chest and they get used to make new red belts. I do the same with red belts going to blue.

I use the network to make pipes and fill the chest up to 3,000 and my pipe to ground maker feeds off of that chest but its set up so that the pipe to ground assembly machine can't take any pipes out of the chest if it holds less than 2,000.

And I of course use the circuit network to control fluids in my refinery and I use it to read power in accumulators so that those get used before my back up steam generators kick in.
Diesel Aug 23, 2021 @ 6:56am 
Honestly I use it everywhere, it let's you fine-tune your factory and makes literally everything automatic.

The less complex the solution the better it is, same as in real life
Drizzt Aug 23, 2021 @ 7:48am 
I have only used circuits a little - but i set up a load balancer for train stations

i.e. i have 2 stations for copper ore and i want the trains to first deliver to the station with less in the buffer chests

so i hook up a few deciders and combinators between the 2 sets of chests and the 2 entrance signals so that the station with less ore has a green signal if not occupied and the other station stays red even if no train is unloading (and will flip to green as soon as the other station has the same or more ore)

this stops the scenario where the first train will always pick the same station (shortest route), and will then wait there if the buffer is full, even of the other station is empty

it is only a first attempt but it works pretty well - can probably work better by setting up the schedule to use the circuit conditions
Premu Aug 23, 2021 @ 9:19am 
Interesting - as I work in SW development, too, and for me the circuit logic and my programing mindset did lead to some "conflicts". For example, if you assign a variable the value 1 in one task and in parallel assign it the value 2 in another task, the result is illdefined. It's certainly not assured to be 3 as it happens in the circuit logic. Still, I managed to work with it after using some overly complicated designs in my first attempts.

Things I have done with it in my current game are:

- An optimized Kovarex enrichment - it will keep exactly the needed amount of U-235 in the centrifuge and not a single one more. So you can use the gained U-235 as soon as possible, for example to kickstart the next Kovarex enrichment in the line!

- To enable my different supply stations - for the walls to bring the necessary ammo once it's below a thresold, or to my construction sites using building trains

- To control the station usage of factories with several pick-up stations. I use the same names with a dynamic train limit set based on the amount of ingrediants in the buffer chests. I make sure that no station receives a second train until all other pick up stations are also either occupied or lack the ressources to fill a train anyway. Otherwise trains might queue up at the closest station and not use the full production capacity.

- To control a "recycling train". All kind of "junk" ends up in my main base which includes my wall and ammo production. In order to reuse it I set up a recycling train with a single car which accepts practically anything and will only drive towards stations where the loaded goods will be accepted and unloaded, so that they are not wasted. If there is no "junk" left, the train will just wait at the base station.

- Once my rocket silos are ready (I'll build six of them to achieve 2700 SPM) I'll use a circuit network to load the rockets with the satellite in a synchronized way, so that I'll need a continues flow of raw materials for those expensive rockets instead of having spikes.
Gamer Aug 23, 2021 @ 3:48pm 
Try this: Train unload balancer in to box and from box to belt, also oil unload balancer. This one is good: 1 silo 2 separate input and 2 separete otput for science pack (2 player bases or modluar base..).
Estelyen Aug 23, 2021 @ 8:36pm 
If you like circuits, I would recommend you to eventually start a new game with the Space Exploration mod. The circuits are kind of an optional thing that help you with fine-tuning in vanilla Factorio, but in Space Exploration, they are an absolute necessity for correctly managing your interplanetary logistics.

I was sort of bummed out by that at first, but then I sat down and designed what I thought to be the perfect circuit network for my cargo rocket silos. Very soon, I learned that perfection does not exist for this logistical mammoth of a mod but it continues to let me strive for it. There is always something about my circuit setup that can be improved or adjusted to make it work better and I f**n love it by now ;)
RiO Aug 23, 2021 @ 11:29pm 
Originally posted by Premu:
Interesting - as I work in SW development, too, and for me the circuit logic and my programing mindset did lead to some "conflicts". For example, if you assign a variable the value 1 in one task and in parallel assign it the value 2 in another task, the result is illdefined. It's certainly not assured to be 3 as it happens in the circuit logic.
Then you're not actually assigning the values in parallel, i.e. on the same game tick.
Each combinator a signal travels through for processing takes one game tick to process and output an updated signal. Keep that in mind.

Originally posted by Estelyen:
If you like circuits, I would recommend you to eventually start a new game with the Space Exploration mod. The circuits are kind of an optional thing that help you with fine-tuning in vanilla Factorio, but in Space Exploration, they are an absolute necessity for correctly managing your interplanetary logistics.
Complex circuits aren't necessary for Space Exploration's interplanetary shipping either. You can just set up cargo rockets for many-to-many single resource bulk shipments. And probably once your logistics needs starts scaling up, that'll actually work better than the complex solution for multi-item shipments anyway.

Terrestrial science is probably an exception where you do want to combine them into a single rocket up to your space research station; but those are only 6 types of items and you can easily build a rather simple dedicated circuit for it.

Then what remains are incidental shipments for building supplies that run out. But those you can just prepare beforehand with a requester warehouse to fill a rocket before you manually launch it.
Set requests for the warehouse via a constant combinator. Gate it behind a decider combinator that monitors for the non-existance of e.g. the [✔] signal. Hook the inserters from warehouse to rocket to the existance of the same signal. Put that signal in a second constant combinator. Now you can 'flip the switch' on the second combinator to switch between loading the warehouse until it meets the configured item stock, and emptying the warehouse into the rocket.
Technically you could also just wire the recipes to the inserters and check for, iirc, [every] = 0 as an enabled condition (or just put the [✔] signal into that combinator as well and check for that) and just flip the recipe combinator on or off - but I personally find that less clear.
Last edited by RiO; Aug 23, 2021 @ 11:49pm
Hurkyl Aug 24, 2021 @ 5:58am 
Originally posted by RiO:
Originally posted by Premu:
Interesting - as I work in SW development, too, and for me the circuit logic and my programing mindset did lead to some "conflicts". For example, if you assign a variable the value 1 in one task and in parallel assign it the value 2 in another task, the result is illdefined. It's certainly not assured to be 3 as it happens in the circuit logic.
Then you're not actually assigning the values in parallel, i.e. on the same game tick.
Each combinator a signal travels through for processing takes one game tick to process and output an updated signal. Keep that in mind.
No, the way Premu described it really is how it works: the value of each signal on a circuit network is the sum of everything that outputs that signal. Using the verb "assigned" is maybe misleading, though.

For example, if you have two constant combinators in a network that both output 100 on "A", the network will have the value 200 on "A".
Last edited by Hurkyl; Aug 24, 2021 @ 5:59am
RiO Aug 24, 2021 @ 11:21am 
Originally posted by Hurkyl:
Originally posted by RiO:
Then you're not actually assigning the values in parallel, i.e. on the same game tick.
Each combinator a signal travels through for processing takes one game tick to process and output an updated signal. Keep that in mind.
No, the way Premu described it really is how it works: the value of each signal on a circuit network is the sum of everything that outputs that signal. Using the verb "assigned" is maybe misleading, though.

For example, if you have two constant combinators in a network that both output 100 on "A", the network will have the value 200 on "A".

Ah I misunderstood what they meant. Well; yes, if one thing outputs a value 2 and another outputs a value 1 for the same signal, then it outputs a total value of 3 of that signal. There's nothing 'weird' about that. You just have to interpret the signal values as "amount of tokens of type <X>" and it makes perfect sense.

There are scientific computing models which act very similar to this. Look up colored petri nets, for instance. The 'color' of each token in the net is simply the signal type in the Factorio circuit network and then you have a quite close analogy, right there.
Last edited by RiO; Aug 24, 2021 @ 11:27am
Premu Aug 24, 2021 @ 11:30am 
By the way - while there are plenty of useful applicatios of circuits in the game, you can go totally crazy and create for example movie players, a 3D engine or a calculator with those.
RiO Aug 24, 2021 @ 1:09pm 
Originally posted by Premu:
By the way - while there are plenty of useful applicatios of circuits in the game, you can go totally crazy and create for example movie players, a 3D engine or a calculator with those.

You forgot: a working copy of Tetris.
Which someone actually did make.

People will find ways to get Tetris running on anything.
That's an unwritten rule of automation.

And by anything, I really do mean a-n-y-t-h-i-n-g.
A bit over a decade ago - back when I was attending uni - the old main building on campus was going to be torn down.

A few students from electrical engineering and computer science realized:
"Hey wait; this building has centrally controllable lights from building management circuits, right? And all the rooms on this side of the building form a regular grid, like a dot matrix display, right? And it's all going to be torn down in a few days, so no-one cares about it anymore, right?"

Basically: have you ever seen anyone play jerry-rigged Tetris on an office building lighting up the night sky?

'cuz I have...
Last edited by RiO; Aug 24, 2021 @ 1:14pm
< >
Showing 1-15 of 20 comments
Per page: 1530 50

Date Posted: Aug 22, 2021 @ 6:23pm
Posts: 20