Friday Facts #379 - Abstract rewiring

Regular reports on Factorio development.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3631
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by mmmPI »

raidho36 wrote: ↑Sat Oct 07, 2023 10:11 pm
Qon wrote: ↑Sat Oct 07, 2023 8:36 pm If you actually had done some big and advanced contraption then you would know why being forced to assign wires to channels every time you wire things together would drive anyone completely insane. And not having the option of organizing your wires so that they are possible to visually identify would not make things better. Removing the current features for no reason is a bad idea. Make something non-trivial with combinators once and earn your right to write about the topic.
I tried making a PID controller for my nuclear reactor array and I gave up halfway. Though such a trivial system to implement in Lua, it wasn't worth the effort to do in Factorio.
I think the combinators and wire from factorio are inspired from redstone mod from minecraft and although i've never used this i think the signals there are only pulses. ( similar to terraria in case ). Not like that in factorio; but were they came from. I think the 2 wires colors added a little layer of depth and confort , and transmitting whole number accross different channel is also a little more depth and confort. Some operations were added overtime, for more depth and confort. At this point, it may seem tempting to add another layer because some higher level logic still seem complicated to implement, but maybe it was never made/thought to make complicated contraptions in the first place. Maybe that's were it is going.

I've done several functionning projects with hundreds of combinators, but when i tried something with several thousands it was not a sucess, and what made me gave up was the wiring, not the logic, but the sheer amount of power poles required to carry all the wires and needing to cut their electrical wire or look at an ugly mess. And not being able to understand the part i work the previous week on without needing to follow the wires thing made extra difficult by the density of power poles connecting everywhere. I should have use wooden chest and substation but that feels wrong.

I don't think combinators are designed mostly for such purposes though, of "non-trivial' task, i think they are made "as simple as possible" so that they are still powerfull. But not made to ease the construction of a computer or other complex logic so i don't think one has to have created masterpieces to write about the topic especially if it is to describe what prevented them from achieving so or what frustrated them sorry Qon i share many of your views but not this one, i think combinators are great, i knew nothing about them and feared their complexity while focusing on rail signal logic for weeks initially maybe because i saw some very complex thing and i thought i wasn't going to need/want/make anything like that but i really enjoyed playing with 1 or 2 at first for very simple contraption. And i think it take a lot of time to learn how to "master" and as such only very few people will ever do gigantic contraptions, and many of them will have already previous knowledge of electronic or programming and they wouldn't be representative of the difficulties people have with combinators when they try them.

But on the other hand, i don't think it's necessary in factorio to have such complex features as proposed with the single wire color containing the ID and the signals ,and entities fetching signals by their ID from this single wire. That feel like a super precise tool that takes time to configure where most people want a fast tool that works without time to configure. ( again here only a subset of players are willing to implement something they can trivially do in another langage and can't).

I think trying to ask too much to combinators can damage gameplay because you as a player could be given the impression that you are expected to write programs and it's a never ending quest then of requesting more and more interaction with such and such entity to make those programs possible, whereas it could be argued part of the fun is to try and implement some (simple or not) logic with some (simple) pieces. ( can't read temperature of nuclear reactor makes good (optionnal) puzzle ).

It makes it more accessible to newbs ( like i was back then ) while still entertaining for veterans,( you don't just write what you want you still have to think of the puzzle or think in factorio combinator).

For example doing the operation "green wire/ red wire" is quite difficult with combinators, that's a requested feature, but as is it's also a super puzzle, either to try and make the division with combinators is one, or to try and make what you want ( like your lua program) without using the division greenwire/redwire because it's difficult to implement it in factorio.

IMO the good point of the current implementation is it's fun, not too hard to get into for beginners, not punishing if you don't, still challenging after some years even if you did a lot :) Maybe some puzzle could be simplified to solve challenges from the expansion that would be too difficult with current tools, but for current purposes i like them, some other modifications could already alter the gameplay a lot, ( like 1 new combinator ) which was speculated from a picture of a FFF i think is more likely than a total rework of the green/red wire system. That would maybe feel "too new" altering too much factorio instead of "improving upon/expansion". But i've always liked Wube's suprises so far, so i wouldn't mind being wrong and having another one :D
Tricorius
Filter Inserter
Filter Inserter
Posts: 279
Joined: Fri Jul 01, 2016 9:04 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by Tricorius »

image.png
image.png (27.11 KiB) Viewed 4204 times
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by Qon »

raidho36 wrote: ↑Sat Oct 07, 2023 10:11 pm
mmmPI wrote: ↑Sun Oct 08, 2023 12:29 am
No, you are both wrong! Wrong about being in disagreement with me that is. You agree with me. Everything I said.
Also your ideas are great, you just need me fine tune them ;)
(As long as you don't even think of removing the necessary functionality)
  • Red+Green wires continue to work exactly like they do now.
  • Blue wire is added.
  • Blue wire gets all the bus features with namespaces.
  • Everyone laughs and are happy, except the artist of Wube that will now cry having to edit all wire attachment points for the blue connection point.
raidho36 wrote: ↑Sat Oct 07, 2023 10:11 pm Well I'm not necessarily suggesting getting rid of colored wires.
Then we agree! :D
raidho36 wrote: ↑Sat Oct 07, 2023 10:11 pm It's a simple solution for single-channel data transmission and it already works. It's just really not ideal for making complicated systems, precisely. I can't quite put it into words, and none of the features are problematic on their own, but together they very subtly make the whole system very obtuse; I think many will find it an apt description. I tried making a PID controller for my nuclear reactor array and I gave up halfway. Though such a trivial system to implement in Lua, it wasn't worth the effort to do in Factorio.
You should think some more on what the subtle things are that make it obtuse to you. So you can explain it, a bit hard to help when there's nothing to go on.
I could share an approach I took to make more advanced programs with combinators.
raidho36 wrote: ↑Sat Oct 07, 2023 10:11 pm Like Zachtronics games, playing with logic gates and hardware routing can be a lot of fun. But in Factorio it feels like a monumental waste of time, it's why I don't usually bother with setups that require more than 2 combinators grand total. I understand that combinators are based off real life relay automation, but actual real life industrial automation using mechanical relays is probably more fun and less headache than this.
Not sure you would find PID controller easy to make with the blue namespace wire you suggested. It's still very low level.
I am currently writing a program that sends IO commands to another network of small computers.
raidho36 wrote: ↑Sat Oct 07, 2023 10:11 pm Consider CAN bus. Every electronic device in the car shares the same data cable, physically. Any device that need to put data on the network, could. And it's up to receiving device to decipher the meaning of whatever packets circulate on the network. This is not unlike having multiple different combinators feeding into the same wire, and then having multiple different inserters being controlled by that same wire. In aforementioned CAN bus this isn't an issue at all, hence a single wire for the entire car. There's no reason it shouldn't be a good design in Factorio either. EDIT: Why, in real life there is an industrial automation system exactly like that too: profibus. You can already specify what kind of signal to produce, simply adding another box for which "subsystems" to send that signal to and read from shouldn't be a problem. The functionality already exists in factorio, since there is a "red" and "green" subsystems already, it's just you choose them by physically wiring the combinators, not by selecting them in GUI.
The blue physical wire should be a physical wire with a GUI channel selector on top. Not just a global connect-to-everything without wire and just channel. Or at least not exclusivly GUI channels and no wire. The ability to not connect to everything in the channel in the entire world is an important feature.



mmmPI wrote: ↑Sun Oct 08, 2023 12:29 am I think the combinators and wire from factorio are inspired from redstone mod from minecraft and although i've never used this i think the signals there are only pulses. ( similar to terraria in case ). Not like that in factorio; but were they came from. I think the 2 wires colors added a little layer of depth and confort , and transmitting whole number accross different channel is also a little more depth and confort. Some operations were added overtime, for more depth and confort. At this point, it may seem tempting to add another layer because some higher level logic still seem complicated to implement, but maybe it was never made/thought to make complicated contraptions in the first place. Maybe that's were it is going.
Minecraft redstone and Terraria wires are way more low level than Factorio wires with combinators. They are fairly similar to eachother though.
Minecraft wires are not pulses, that's only in Terraria.

I'm considering making a language that compiles to Factorio combinators...

mmmPI wrote: ↑Sun Oct 08, 2023 12:29 am I've done several functionning projects with hundreds of combinators, but when i tried something with several thousands it was not a sucess, and what made me gave up was the wiring, not the logic, but the sheer amount of power poles required to carry all the wires and needing to cut their electrical wire or look at an ugly mess. And not being able to understand the part i work the previous week on without needing to follow the wires thing made extra difficult by the density of power poles connecting everywhere. I should have use wooden chest and substation but that feels wrong.
For that reason I NEVER carry red/green wire on power poles (except for long distance along with big power poles). The best option imo is empty constant combinators all facing the same way (north or south). But I haven't tried boxes, they might also be good, more visually distinct from the constant combinators that are there to supply constants when they are close together. But for a bus the wires are neatly separated with constant combinators so it looks neat and tidy.
mmmPI wrote: ↑Sun Oct 08, 2023 12:29 am I don't think combinators are designed mostly for such purposes though, of "non-trivial' task, i think they are made "as simple as possible" so that they are still powerfull. But not made to ease the construction of a computer or other complex logic so i don't think one has to have created masterpieces to write about the topic especially if it is to describe what prevented them from achieving so or what frustrated them sorry Qon i share many of your views but not this one, i think combinators are great, i knew nothing about them and feared their complexity while focusing on rail signal logic for weeks initially maybe because i saw some very complex thing and i thought i wasn't going to need/want/make anything like that but i really enjoyed playing with 1 or 2 at first for very simple contraption. And i think it take a lot of time to learn how to "master" and as such only very few people will ever do gigantic contraptions, and many of them will have already previous knowledge of electronic or programming and they wouldn't be representative of the difficulties people have with combinators when they try them.
I don't require anyone to have made a masterpiece with combinators to suggest adding features. I require that of those that suggest removing features. The features that have been suggested to be removed in this thread are necessary for some advanced combinator constructions to be even possible.

mmmPI wrote: ↑Sun Oct 08, 2023 12:29 am But on the other hand, i don't think it's necessary in factorio to have such complex features as proposed with the single wire color containing the ID and the signals ,and entities fetching signals by their ID from this single wire. That feel like a super precise tool that takes time to configure where most people want a fast tool that works without time to configure. ( again here only a subset of players are willing to implement something they can trivially do in another langage and can't).
I agree that I don't think it will help a lot and that it takes too much time to configure for me for it to be useful for most cases. But if people can find use for it then I'm not against the suggestion.
mmmPI wrote: ↑Sun Oct 08, 2023 12:29 am I think trying to ask too much to combinators can damage gameplay because you as a player could be given the impression that you are expected to write programs and it's a never ending quest then of requesting more and more interaction with such and such entity to make those programs possible, whereas it could be argued part of the fun is to try and implement some (simple or not) logic with some (simple) pieces. ( can't read temperature of nuclear reactor makes good (optionnal) puzzle ).
Without Recursive Blueprints+ mod there's not really much you can control with combinators. That mod gives purpose to combinators. But it's a lot of work and a lot of little details to fiddle with for the kind of computations that are required to make good use of that mod, so they are a bit too crude to quickly spin up great creations.

mmmPI wrote: ↑Sun Oct 08, 2023 12:29 am IMO the good point of the current implementation is it's fun, not too hard to get into for beginners, not punishing if you don't, still challenging after some years even if you did a lot :) Maybe some puzzle could be simplified to solve challenges from the expansion that would be too difficult with current tools, but for current purposes i like them, some other modifications could already alter the gameplay a lot, ( like 1 new combinator ) which was speculated from a picture of a FFF i think is more likely than a total rework of the green/red wire system. That would maybe feel "too new" altering too much factorio instead of "improving upon/expansion". But i've always liked Wube's suprises so far, so i wouldn't mind being wrong and having another one :D
Spage Age is unlikely to even scratch the surface of the challenges required to make advanced self-building factories with RB+. But maybe it will include some non-trivial combinator use case.

What would a new combinator even do?
A full Lua combinator would be useful.
A combinator that has some GUI blocks to do several computations in a single step, similar to train schedule GUI, would be pretty useless and not really help newbies actually do something with combinators. It would just let them use another tool to avoid learning combinators and then they would be stuck with the limitations of the multi-combinator. There are mods for this, but it's not really a good idea imo.
An abstraction combinator (similar to Factorissimo and some not-good-enough mods tried to make) could be great with full recursion and enough internal space and IO to not be limiting. But it would not make combinators easier for newbies, it would help organized advanced users with a new great organization tool. I would love it.
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
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by Qon »

mmmPI wrote: ↑Sun Oct 08, 2023 12:29 am I've done several functionning projects with hundreds of combinators, but when i tried something with several thousands it was not a sucess, and what made me gave up was the wiring, not the logic, but the sheer amount of power poles required to carry all the wires and needing to cut their electrical wire or look at an ugly mess. And not being able to understand the part i work the previous week on without needing to follow the wires thing made extra difficult by the density of power poles connecting everywhere. I should have use wooden chest and substation but that feels wrong.
As someone with combinators in the millions (well, repeatedly copied structure ;) ) I think I have mostly solved some organization problems.
raidho36 wrote: ↑Sat Oct 07, 2023 10:11 pm I tried making a PID controller for my nuclear reactor array and I gave up halfway. Though such a trivial system to implement in Lua, it wasn't worth the effort to do in Factorio.
I could design a PID controller. This thing spits out the coordinates of points of a circle of a certain radius and then increments the radius and continues spiraling out:
Screenshot from 2021-07-06 11-02-13.png
Screenshot from 2021-07-06 11-02-13.png (3.22 MiB) Viewed 4130 times
I think it's fairly well organized and readable. Similar repeated structures are copied in columns. No power poles carry logic (just one to mark output). Heavy use of picker dollies mod to make each part it's own readable component.

But the project I have started now is too big to not have organized even more. For when things would become to complex to just wire up, I have a system for translating regular code into combinators.
First pic here is of 2 kinds of computers. One crushed (it was more readable before I tried to make it fit in a 16x16 grid) cell computational device repeated in a growing circular pattern. The other a controlling "computer" that communicates with the cell network and computes where to place next cell to grow the structure.
Screenshot from 2023-10-08 10-24-19.png
Screenshot from 2023-10-08 10-24-19.png (4.59 MiB) Viewed 4130 times
The full program is shown here:
Screenshot from 2023-10-08 10-26-21.png
Screenshot from 2023-10-08 10-26-21.png (4.05 MiB) Viewed 4130 times
I still need to add a lot more to it, but I know how to extend it without messing up what has already been written.

Here is a more readable zoom in on a part:
Screenshot from 2023-10-08 10-27-29.png
Screenshot from 2023-10-08 10-27-29.png (4.22 MiB) Viewed 4130 times
Same picture again, now with comments:
Screenshot from 2023-10-08 10-27-29_comments.png
Screenshot from 2023-10-08 10-27-29_comments.png (4.03 MiB) Viewed 4130 times
It has lines of code with function calls and a simple structure with blueprints to add more space for more code lines. And blueprints for function calls. And a fairly simple structure for jumps, conditional jumps, reads and writes to memory.

There's still a lot of details to keep track of to make it run faster, eliminating dead ticks.

Here is a zoom in on a cell. Priority was shifted from readability and small combinator count to size, so it's now fairly tricky to understand.
Screenshot from 2023-10-08 10-46-23.png
Screenshot from 2023-10-08 10-46-23.png (3.76 MiB) Viewed 4130 times
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
coppercoil
Filter Inserter
Filter Inserter
Posts: 502
Joined: Tue Jun 26, 2018 10:14 am
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by coppercoil »

Qon wrote: ↑Sun Oct 08, 2023 10:17 am Same picture again, now with comments:
Could you share more details how memory cells and access are implemented? Or at least a BP?
raidho36
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 01, 2016 2:08 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by raidho36 »

Qon wrote: ↑Sun Oct 08, 2023 10:17 am I could design a PID controller.
I could too in principle - In TIS100 and ShenzhenIO I would consistently end up in top brackets. It's just seriously not fun to do in Factorio.

Recently I've been developing a game that's basically a Vampire Survivors clone. Every piece was there but the game just wasn't fun. Everybody acknowledged that but nobody could put their finger on why. Same thing here. Pretty sure virtually everyone who had to deal with combinators had great deal of frustration, but virtually nobody can describe exactly what is the cause.

One of my particular grievances was that two wires is often not enough data separation. It also extends to the fact that data on all inputs adds up, not just on the same wire. So I wanted to multiply red wire signals by same type blue wire signals? Too bad, go build a giant signal type converter and then a giant math array. Wiring a combinator to itself perhaps seems clever, but it's actually the worst due to control signal leaking into the output and then back into its own input so it has to be dealt with separately.

What game mechanic precisely is responsible for it? What changes could solve that? Who knows really. A "digital packet" wire might help with some of it.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by Qon »

coppercoil wrote: ↑Sun Oct 08, 2023 10:54 am Could you share more details how memory cells and access are implemented? Or at least a BP?
Sure. The whole system is a bit of a WIP and I've had a big break from playing though. But I'll try. The mod I use for wire color changes red to purple and green to teal.
How memory works
The memory works very similar to how the program line execution works. But the program selects output combinators with an instruction pointer that is incremented each tick and modified for jumps with jump instructions.

Memory basics: A decider combinator linked to itself makes it a memory, anything sent to it is added to it. Condition is signal-white = 0, this means if you write in signal-white the memory will reset.

Memory addressing: Each line is a memory address. A chain of arithmetic combinators to the left (signal-red for write) and right (signal-green for read) calculate the position of the memory cell automatically so that I can just place down extensions to memory with blueprints and have each cell working without configuration. They count down in the negatives.
The decider to the left of the memory combinator takes the signal-red from The Program (one wire that goes to all memory selectors) and sends it to the actual memory cell combinator input on the condition that signal-red is 0. This means signal-red will not be added to the memory cell. This only happens if the positive signal-red for selecting which memory address is "equal" (in absolute) to the negative signal-red from the positional arithmetic combinator, so they cancel out.

Same thing for memory read, but signal-green (other signal color just so it is visible in program if it's a read or write instruction) on another wire is used with a similar arithmetic combinator on condition signal-green = 0.

Lamps show which signal is currently being written and read from. Both are possible in the same tick. Read is 1 tick delay for any memory cell (to resolve addressing) and write is 2 since it takes 1 tick for a memory cell to store and start outputting the signal and it also needs 1 tick for addressing. So it's fast RAM. But for a memory write you probably also want to clear the memory first, otherwise the new value is added to the old. You don't have to wait for clear to finish, you can clear and write new value in the tick after so it takes 2 ticks, with a lag of 3 ticks from start of process.

The rightmost part of the whole RAM unit (const combinator, lamp, arithmetic with signal-S) are extra. The constant combinator is just to automatically count how big memory is currently, can be nice to have. The lamp and signal-S arithmetic combinator are just to visualize the stack pointer position.

The memory is also used for IO to other hardware with memory mapped hardwired combinators that are part of my setup. Basically if I want to read something in from a special combinator in my program I send read and write to specific memory addresses. Those memory cells also have wires coming in from the left side of the RAM block, either going to the memory output selector for input to program or wired to memory cell write selector combinator input to send the signal to some other hardware outside the memory instead of to the actual memory combinator.
Some info on how program interacts with memory
The first lines in main function reset the memory that will soon be written to. This is done with a signal-red (number is address) and a signal-white (anything non-0).
After a reset a write is sent for initialization to some value with another write. First two lines in main that you can see clears address 0 and then writes the stack pointer with symbol signal-S there (signal-red is actually 0 but added in constant combinator for visual clarity). Signals that should be sent to the memory are wired to the rightmost column of constant combinators in the code block. Red (purple) wire for writes.

12th line in program has a signal-green going to to memory. This is wired a bit differently on the right side, going to to the right green(teal) wire. The column of constant combinators on the left side of the instructions in the program will have the memory output on the red(purple) wire in the tick after.

signal-black is used in the program as instruction pointer, what combinator is allowed to pass it's output is done exactly like memory addressing. For branching a signal-B is sent to the left column of constant combinators on the right side of the code block, on the green (teal) wire. It will be translated to signal-black and added with some delay to the instruction pointer value which is stored in a memory cell north of the program and the other memory (almost out of screenshot with comments at top of picture).
raidho36 wrote: ↑Sun Oct 08, 2023 11:52 am One of my particular grievances was that two wires is often not enough data separation. It also extends to the fact that data on all inputs adds up, not just on the same wire. So I wanted to multiply red wire signals by same type blue wire signals? Too bad, go build a giant signal type converter and then a giant math array.
Look at the wiki tutorial on combinators (bottom of page) for how to multiply values with 7 combinators.
raidho36 wrote: ↑Sun Oct 08, 2023 11:52 am Wiring a combinator to itself perhaps seems clever, but it's actually the worst due to control signal leaking into the output and then back into its own input so it has to be dealt with separately.
My RAM design explained above has no control signals leaking into memory and has infinite extensibility with no configuration and random access. And it can be read from and written to every tick.

Here is the blueprint book:
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
Nidan
Filter Inserter
Filter Inserter
Posts: 267
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by Nidan »

raidho36 wrote: ↑Sun Oct 08, 2023 11:52 am So I wanted to multiply red wire signals by same type blue wire signals? Too bad, go build a giant signal type converter and then a giant math array.
There's a well known 5 combinator solution, as long as the square of each input doesn't overflow into the sign bit. For a general solution see this thread.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3631
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by mmmPI »

sorry i reorder your quote to match how things are in my head
Qon wrote: ↑Sun Oct 08, 2023 9:38 am Minecraft redstone and Terraria wires are way more low level than Factorio wires with combinators. They are fairly similar to eachother though.
Minecraft wires are not pulses, that's only in Terraria.
[...]

A full Lua combinator would be useful.
Thing i learned, but point still stand, factorio signals could be just pulses and it wouldn''t prevent some players from making contraptions with milliions of them. Though it would change the range of expectations most players have on what they can do with them. Making programs and higher-level logic would not be as tempting and the request to ease their use would be different. But if you add depth and confort and functionalities to a system that is a pulse one, you end up with changing the initial system from a low level one to always go in the same direction of higher-level logic. And then you have to implement a worded langage like a lua combinator. I think there is a potential trap here when thinking about adding features to a system when looking at such system instead of considering its purpose which we may not have full information on. ( only to help oil processing ? , to be a game inside the game ?).

To me personnaly i would say it break the immersion, that's going too far for it to be a thing in vanilla factorio when you can just write command in a combinator in the langage of the game inside the game. That's like playing with the debug menu on or something. That's no longer feels like playing the factorio game but more playing with the factorio game. Fine too but only because i've been playing the game so much, not the same fun.
Qon wrote: ↑Sun Oct 08, 2023 9:38 am I'm considering making a language that compiles to Factorio combinators...
exactly as i said "playing WITH the game" vs "playing the game" :D nothing wrong about it, but that's not something you can offer to a player as part of the game experience really. That's time you spend solving a puzzle you made for yourself from the game. What would work for me i think would be this mod : https://mods.factorio.com/mod/fcpu

That's one mod i think will make me spend time playing inside the game, although it may require reading extensive manual, which is not part of the fun in game, it's the same tradeoff as reading the rules for 10 hours before you can play a 200 hour game or so. The reading the rules part is not fun, it's necessary. I think for many players combinators are already like this, requiring reading extensive manual to start using. But not many players are attracted to it, and i think it's part of why to keep the game fun for everyone the combinators are not mandadory really in vanilla factorio. ( thinking about the simplification of oil processing ).
Qon wrote: ↑Sun Oct 08, 2023 9:38 am Without Recursive Blueprints+ mod there's not really much you can control with combinators. That mod gives purpose to combinators. But it's a lot of work and a lot of little details to fiddle with for the kind of computations that are required to make good use of that mod, so they are a bit too crude to quickly spin up great creations.
[...]
Spage Age is unlikely to even scratch the surface of the challenges required to make advanced self-building factories with RB+. But maybe it will include some non-trivial combinator use case.
What would a new combinator even do?
I tend to agree that combinators are "too powerful" for the vanilla "problems". And "not enough" to make computers or video players easy. I agree that Recursive Blueprints is a great use for them(giving a purpose). In vanilla apart for your oil processing and nuclear plant i started with "smart furnaces" and had fun with making optionnal things for trains, multiplexors for sending quantities, crossings , honks , ofc i had to learn how to make displays, and you can even make wifi using trains that detect open station anywhere on the map instantly or music boxes ! Most of them are like side quest i feel, many dedicated players enjoy them but you don't make a game around the side-quest.

mods like SE gives a lot of purpose to combinators too. But also some mod like the warehouse mod can yield nice puzzle when you try to make one the center of your direct insertion build and/or the crafting combinator mod. Those are more accessible and optionnal challenges that i could see added in vanilla if it integrate nicely with some space thing. This or a memory cell, or a filter combinator. Things that have a direct explicit purpose written on it. Maybe to make it easier to achieve higher level logic required for space logistic or space production. Filter combinator would be given only with a nice relation to the spaceport in a case where it's very obvious what you want to filter like the destination and new player would be handheld to use it. But then anyone be free to use the filter combinator for any purpose instead of having to use blueprint. to help "spin up" creation, could also work for memory cell combinator, or other thing i can't think of related to space things.

Qon wrote: ↑Sun Oct 08, 2023 9:38 am For that reason I NEVER carry red/green wire on power poles (except for long distance along with big power poles). The best option imo is empty constant combinators all facing the same way (north or south). But I haven't tried boxes, they might also be good, more visually distinct from the constant combinators that are there to supply constants when they are close together. But for a bus the wires are neatly separated with constant combinators so it looks neat and tidy.
Boxes don't flash when not powered that's also an idea behind it. I used a mix of medium and big electric pole because i had 16 wires going parralels, 8 green and 8 red,I didn't used substation for electricity to not add even more and relied on the wire-carrying-pole for the electricity-coverage too it was really a mess. It felt like i was attempting to empty the sea with the spoon. It felt like in theory i could have finished the project it was working as intented for the vertical slice that was built, but then also that i should have written a program to make the blueprint instead of attempting to manually copy and wire a few hundred thousand things while having to remove electrical wire sometimes to make it work. i used many constant combinators for manually typed hardcoded data as such i didn't want to potentially get confused when using constant combinators for another purpose that's as you say another reason. But when it comes to such feelings i think it's beyond the scope of the game, it's just me who attempted to do something in the game whereas it would have been more efficient to do it partly outside the game and it was not a fun experience overall but i can't blame the game for that, i was not really playing the game, more like playing with the game.
raidho36 wrote: ↑Sun Oct 08, 2023 11:52 am I could too in principle - In TIS100 and ShenzhenIO I would consistently end up in top brackets. It's just seriously not fun to do in Factorio.
I think it make sense in a way, because Zachtronics game are designed around the feature that would be the combinators, whereas in factorio they are only an optionnal tool. The genre of the game is a little different. Players of Zachtronics game do not include the players of factorio that never used combinators i suppose. Maybe this is more explicit with Terraria, where the wiring complexity is ignored by most players whereas it is the core of the Zachtronics game. I suppose "making the combinators fun" is not the same as "making the game fun by introducing combinators for people who think those are fun".

In ShenzhenIO the whole game is about the same thing, when you compete for the top bracket you are fully experiencing the game core mechanic as intended, whereas in factorio when making a PID controller for a nuclear plant you are pushing a mechanic, expecting a lot of it, maybe due to your already existing knowledge of programming, you give yourself complex tasks that the tools in game are not suited for. To control nuclear power plant, realisticly there are simpler ways than making a PID controller. As such i understand your request for features that would help you achieve your goal and have fun doing it, but i see them as request for additionnal feature more than a convincing exposition of a current flaw in the combinators.
raidho36 wrote: ↑Sun Oct 08, 2023 11:52 am Pretty sure virtually everyone who had to deal with combinators had great deal of frustration, but virtually nobody can describe exactly what is the cause.
The cause of my frustration was realizing i couldn't achieve what i tried because i realized midway through that it would be boring for long time and i would only feel relief at the end and the journey would suck which made me quit.

On the other hand, as i said i don't blame the game for that. I had not felt such frustration when playing the game as intended, only during my self imposed challenge. ( and when no challenges at all it's not fun either i wouldn't impose myself challenge otherwise.)

Making fun videos games is tough hopefully they share some tips everyweek !
raidho36
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 01, 2016 2:08 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by raidho36 »

mmmPI wrote: ↑Sun Oct 08, 2023 5:54 pm In ShenzhenIO the whole game is about the same thing, when you compete for the top bracket you are fully experiencing the game core mechanic as intended, whereas in factorio when making a PID controller for a nuclear plant you are pushing a mechanic, expecting a lot of it, maybe due to your already existing knowledge of programming, you give yourself complex tasks that the tools in game are not suited for. To control nuclear power plant, realisticly there are simpler ways than making a PID controller. As such i understand your request for features that would help you achieve your goal and have fun doing it, but i see them as request for additionnal feature more than a convincing exposition of a current flaw in the combinators.
Well like I said it's virtually impossible to pinpoint specific problems with combinators that make them such a poor fit for their one and only job. If you consider any specific individual feature, they all make sense. Even considering them together, there isn't anything wrong with it, visibly. The effect is very subtle, but the result is extremely pronounced. If I'm being frank, the way combinators work in Factorio -despite being completely fine on paper- defies all logic and reason. That one Zachtronics game where you make soviet CPUs makes perfect sense at all times; combinators stop making sense very rapidly once there's more than a handful. They're turing-complete, there's never a situation when you have no way to accomplish a specific computation. It's just if it's not already a part of a blueprint, you're gonna have a very bad time. I recall another game where you pilot a spaceship and can automate it, and its logic blocks are even simpler than combinators, yet wiring those together was a smooth process and it worked great; the game has you mine resources and kill enemies and I could automate the entire process, I could even make seeker missiles and deployable mining drones. It has a dedicated robot sumo mode where you're not even allowed to make manual inputs, your drone has to defeat the enemy on its own. And in that game you only had on-off signals and binary logic gates to work with. No math, no if/else, no nothing. So again, the issue isn't with the idea of combinators or how they're implemented, it's how innocuous design choices coming together create an abomination.

There are indeed much simpler ways to control reactors. I made due with just the P part of the PID controller. Making it was a relatively straightforward process, though not smooth by any means. And I'm stuck in a situation where more power draw = less energy available in storage. It's like mechanical car suspension - when you load it, it goes closer to the ground, and it will never come back to its original ride height unless you unload it.

I honestly have no idea whatsoever how to "fix" combinators. It will probably entail changing signal system altogether. All I know is that one of the problems I had can be fixed by adding a "packeted data" wire. Adding whitelist/blacklist to combinators when you use wildcards would also be nice.
aka13
Filter Inserter
Filter Inserter
Posts: 795
Joined: Sun Sep 29, 2013 1:18 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by aka13 »

raidho36 wrote: ↑Sun Oct 08, 2023 6:32 pm I recall another game where you pilot a spaceship and can automate it
You have a name by chance?
Pony/Furfag avatar? Opinion discarded.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3631
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by mmmPI »

raidho36 wrote: ↑Sun Oct 08, 2023 6:32 pm Well like I said it's virtually impossible to pinpoint specific problems with combinators that make them such a poor fit for their one and only job. If you consider any specific individual feature, they all make sense. Even considering them together, there isn't anything wrong with it, visibly. The effect is very subtle, but the result is extremely pronounced. If I'm being frank, the way combinators work in Factorio -despite being completely fine on paper- defies all logic and reason.
To me they seem fitting for their job of helping the automation in the factory , and being a source of mini-game for people interested with them.
I don't think the factory present such programming challenge that would require a scaling of combinator to the hundreds. It's there if you want to though. You described game REQUIRING combinators in their gameloop as far as i can tell it's different than in factorio which is made so that player can finish the game without using them as far as i can tell.
raidho36 wrote: ↑Sun Oct 08, 2023 6:32 pm I honestly have no idea whatsoever how to "fix" combinators. It will probably entail changing signal system altogether. All I know is that one of the problems I had can be fixed by adding a "packeted data" wire. Adding whitelist/blacklist to combinators when you use wildcards would also be nice.
I don't think they are broken, but you want extra features from it to achieve an objective that may be hard to achieve with just extra feature from a system not designed with this endgoal in the first place maybe. You seem to conclude that there is no way to easily make combinators do what you want to use them for. But i want to highlight that it is a very niche usage you are describing and maybe that's why it seem very hard to suggest a feature that would single -handedly achieve that.

If combinators had been designed to be a game in themselves or designed to help players create complex program, i'm sure they would have been made differently from the start. ( like in some Zachtronics game). To me it feels like writing that you can't make a real dam with lego blocks. Yeah that's because lego blocks are toy, they are not meant to be pieces for real architechture. Though people create masterpieces with them. They are still also fit for a young kid. I don't think it would improve all that much the core gameplay of factorio to have better capabilities of programming with combinators as the gameplay challenges present in the factory are not requiring such capabilities. that's just my personnal opinion, if i was to guess the space age is adding a logistic challenge that maybe will cause additions in the combinators department but not to the point where it would cause a need to rework of the whole system as i suppose the expansion was designed like the base game with the mindset that combinators should stay optionnal or simple as i feel was what i read from the various FFF.

It doesn't mean such addition wouldn't also be thought to adress some of the complaints you are trying to identify precisely. I could be completly off too and be very surprised. That happens too :)
raidho36
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 01, 2016 2:08 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by raidho36 »

aka13 wrote: ↑Sun Oct 08, 2023 7:46 pm
raidho36 wrote: ↑Sun Oct 08, 2023 6:32 pm I recall another game where you pilot a spaceship and can automate it
You have a name by chance?
I think it's called Nimbatus. It might be dead, and not in a benign way.
raidho36
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 01, 2016 2:08 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by raidho36 »

raidho36 wrote: ↑Sun Oct 08, 2023 11:52 am
Qon wrote: ↑Sun Oct 08, 2023 10:17 am I could design a PID controller.
I could too in principle
I gave it another go. If I just accept that the design will get ugly, I can get it to work. Here's the setup that maintains precisely 2 iron plates on the 10-long section of belt.
Untitled.png
Untitled.png (1.07 MiB) Viewed 3767 times
mmmPI
Smart Inserter
Smart Inserter
Posts: 3631
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by mmmPI »

raidho36 wrote: ↑Mon Oct 09, 2023 8:58 am I gave it another go. If I just accept that the design will get ugly, I can get it to work. Here's the setup that maintains precisely 2 iron plates on the
10-long section of belt.
You can also just wire the 10 belts to inserters with condition active if iron plate < 2 and stack size 1. 0 combinator, newb friendly. not super precise.

You can also wire the inserter adding iron plate to send a pulse with their content to a 2 combinators memory cell. And use the last belt of the 10 to send pulses made negative to decrement the memory when the plate exit the section. That's more advanced but would work to maintain 2 iron plates on the belts.

It's hard to tell how you prevent both inserter to insert a plate when there is already 1 in your setup without the blueprint.

But congrats if you get it to work the way you wanted :) Maybe you have choosen a very complex way to achieve your result, and it's an achievement in itself i think, hopefully you had fun designing the PID controller and maybe sharing infos about it will let someone give you advice if it's possible to compress the build even more. but it's not that ugly ;)
aka13
Filter Inserter
Filter Inserter
Posts: 795
Joined: Sun Sep 29, 2013 1:18 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by aka13 »

raidho36 wrote: ↑Mon Oct 09, 2023 8:58 am I gave it another go. If I just accept that the design will get ugly, I can get it to work. Here's the setup that maintains precisely 2 iron plates on the 10-long section of belt.
Untitled.png
Man, stop flexing I already feel inferior, "I just made a PID controller to prove a point" :D :D
I wish I was that smart.
Pony/Furfag avatar? Opinion discarded.
raidho36
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Wed Jun 01, 2016 2:08 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by raidho36 »

mmmPI wrote: ↑Mon Oct 09, 2023 9:18 am You can also just wire the 10 belts to inserters with condition active if iron plate < 2 and stack size 1. 0 combinator, newb friendly. not super precise.
The core feature of a PID controller is that it's self-adjusts to maintain the desired value. In Factorio vast majority of systems don't even have a place for it, as there is a strict 1:1 relationship between inputs and outputs. You just hook them up together and the rest will sort itself out. The one place where this isn't true is in nuclear reactors. So you use a PID controller to feed reactors and it'll figure out appropriate fuel insertion rate on its own regardless of loads, constant or intermittent. Of course the amount of fuel needed to feed the reactors is completely trivial anyway - you need less than 1 ore per second to feed 10 reactors nonstop.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3631
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by mmmPI »

raidho36 wrote: ↑Mon Oct 09, 2023 9:56 am The core feature of a PID controller is that it's self-adjusts to maintain the desired value. In Factorio vast majority of systems don't even have a place for it, as there is a strict 1:1 relationship between inputs and outputs. You just hook them up together and the rest will sort itself out. The one place where this isn't true is in nuclear reactors. So you use a PID controller to feed reactors and it'll figure out appropriate fuel insertion rate on its own regardless of loads, constant or intermittent. Of course the amount of fuel needed to feed the reactors is completely trivial anyway - you need less than 1 ore per second to feed 10 reactors nonstop.
I understand that using this mechanism is different than for example counting how much steam is produced by counting how many tanks are filled, or how many cargowagon are leaving the nuclear power plant filled with steam. As this would be monitoring the output and then mathing how much input should be given. ( 1:k relationship where k constant based on nuke plant efficency/reactor adjacency ) ( i've seen many different way of controlling the power plant insertion in this topic viewtopic.php?t=99993 )

But i'm not sure i understand correctly the thing you made to be honest.

If you monitor when steam is low in tanks and trigger synchronized refuel at that moment doesn't that replicate the self-adjusting property of the PID controller for fuel insertion rate ? ( mechanically with belt backed up triggering production of exactly what's being consumed with a delay ).

That can't overshoot though, so i suppose it's not quite the same mechanism of self-adjustment than for a PID controller.

Regardless of its utility in game(If it achieve results that one could get with simpler method) , i found the concept interesting, when you look at the PID controller page of wikipedia there's some pseudo code that look like it's a tough challenge to implement in game with combinators. And there are plenty of mods that introduce randomness in the outputs as failure rate, or byproducts. Where this contraption could find maybe more use. Although it look like if a mod was requiring such contraption, it would be "very difficult" for maybe too many players. :D

If you don't mind me bothering you again with more questions, i'm curious if you wouldn't mind share the blueprint, i think you could even make a post "showing your creation" as that's what people do when they come up with such stuff, maybe someone else trying to do something similar would find it helpful. I would look at it for sure.

I was thinking about this discussion and realized that everytime i want to do something with combinators, i'm using the mod picker dollies https://mods.factorio.com/mod/PickerDollies so i should nuance my previous arguments, even with a 30 combinator build, i would feel it's improving greatly my experience, in particular for the not so abstract REWIRING.
Tertius
Filter Inserter
Filter Inserter
Posts: 933
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by Tertius »

raidho36 wrote: ↑Mon Oct 09, 2023 9:56 am
mmmPI wrote: ↑Mon Oct 09, 2023 9:18 am You can also just wire the 10 belts to inserters with condition active if iron plate < 2 and stack size 1. 0 combinator, newb friendly. not super precise.
The core feature of a PID controller is that it's self-adjusts to maintain the desired value.
OMG, googling PID controller and reading the stuff here, I realized I encountered a PID controller in the past but didn't understand what it is for. It was 40 years ago with this electronics experimentation kit for teens that teached about (discrete) transistor circuits. Now I know where this esoteric thing has a use case (was esoteric and incomprehensible for me at that time). And I understand the math behind it, which was not the case 40 years ago.

And indeed, I'm not satisfied with my fuel control for my nuclear reactor in Factorio. Will look deeper now, if it's possible to use this knowledge. It's not that easy, because a bigger nuclear reactor has an enormous momentum if it comes to heating up and cooling down that's quite difficult to handle if the load doesn't change smoothly but rather abruptly. I guess a different controller type (not PID) is required for that kind of workload, but I have a new approach.

Thanks!

ps.
If it comes to item production, I would say this is demand driven. It doesn't make sense to create a sophisticated controller here, in my opinion. You need to build a production line that's able to satisfy peak production. Spikes are buffered with chest buffers you need anyway. With demand driven I mean items are unbuffered and put on the belts, if demand is high and the belts are empty. And stall and are being buffered, if demand is low and belts are full. The plate factory will automatically stop on its own, if all output buffers are full. You gain nothing, if you control any input, output or throughput here.

It could make sense if you want to minimize buffering, but does that really matter? With nuclear reactors it can matter, because you waste resources, if the reactors get over 1000Β°C instead of just stopping. But all other machinery in Factorio just stops with no cost.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3631
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #379 - Abstract rewiring

Post by mmmPI »

Tertius wrote: ↑Mon Oct 09, 2023 1:25 pm OMG, googling PID controller and reading the stuff here, I realized I encountered a PID controller in the past but didn't understand what it is for. It was 40 years ago with this electronics experimentation kit for teens that teached about (discrete) transistor circuits. Now I know where this esoteric thing has a use case (was esoteric and incomprehensible for me at that time). And I understand the math behind it, which was not the case 40 years ago.

And indeed, I'm not satisfied with my fuel control for my nuclear reactor in Factorio. Will look deeper now, if it's possible to use this knowledge. It's not that easy, because a bigger nuclear reactor has an enormous momentum if it comes to heating up and cooling down that's quite difficult to handle if the load doesn't change smoothly but rather abruptly. I guess a different controller type (not PID) is required for that kind of workload, but I have a new approach.
Well i don't know if it's cheating or not but i was told that combinators are quite similar to fpga in real life, and it just so happen that there exist scientific article explaning how to implement digital PID controller on fpga source : https://www.ijert.org/research/hardware ... 020719.pdf
PIDalgo.jpg
PIDalgo.jpg (36.79 KiB) Viewed 3625 times
That picture make me think a LOT about the blueprint especially after reading the PID page of wikipedia and the pseudo code but i suspect some more trickery is required to do it only with integers number.

Tertius wrote: ↑Mon Oct 09, 2023 1:25 pm If it comes to item production, I would say this is demand driven. It doesn't make sense to create a sophisticated controller here, in my opinion. You need to build a production line that's able to satisfy peak production. Spikes are buffered with chest buffers you need anyway. With demand driven I mean items are unbuffered and put on the belts, if demand is high and the belts are empty. And stall and are being buffered, if demand is low and belts are full. The plate factory will automatically stop on its own, if all output buffers are full. You gain nothing, if you control any input, output or throughput here.

It could make sense if you want to minimize buffering, but does that really matter? With nuclear reactors it can matter, because you waste resources, if the reactors get over 1000Β°C instead of just stopping. But all other machinery in Factorio just stops with no cost.
I agree with the first part, but i think that it is possible in game to make it so for nuclear plant too, if you consider they are just assembler and the input is fuel and the output is steam. If you have huge buffers for steam and good ratio of heat exchanger/reactor to avoid overheating, you only have to "read the demand" in empty steam tank. And trigger refueling with a simple condition.

I think i understand it's not the same thing as using the PID, that's transforming the problem so you don't need the complicated solution but i find the complicated solution interesting in itself :)

In factorio there is a problem i encountered which the PID may have solved, and i wished i understand more about it.

Scenario : Seablock, no ressource from mining only way to get ressources filter some "dirty water" receipe : 10 dirty water = 50% iron ore 50% copper ore.

Problem : factory doesn't need 1:1 ratio at all time, and not consuming one or the other would stockpile in buffer and eventually jam everything.

Solution : make different array of furnaces with and without productivity module, so that in case of surplus of one or the other there is a way to increase or decrease its consumption relative to the other.

PID controller i suppose is one control mechanism that can handle the stock variation to match desired buffer value while/by controlling which array of furnaces get to work to prevent jamming everything.

My solution was not something as well defined as a PID it was some splitters with reading belts and conditions, it was also not working properly, so not really a solution. :)
Post Reply

Return to β€œNews”