Compound Combinators (complex logic in a single building)

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Tinyboss
Fast Inserter
Fast Inserter
Posts: 205
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Compound Combinators (complex logic in a single building)

Post by Tinyboss »

I remember in 4th grade (I'm dating myself here!) I was addicted to an Apple ][ game called Rocky's Boots, in which you wired up sensors and logic gates to activate a boot to kick the correct items off a conveyor belt. Later I played Robot Odyssey, which had you visually programming little robots in much the same way: you would go inside the robot, and you would be in a room with sensor inputs and action outputs (thruster, grabber, etc.) sticking out of the walls. You would wire these together with logic gates to make it do what you wanted.

It looked like this:
Image

The really cool thing about Robot Odyssey is that you could also build chips, which were basically integrated circuits: they had eight pins that you could wire up. You could go inside the chip, and you'd be in a room with eight terminals on the walls, which you wired up with ANDs and ORs and NOTs to create the behavior of the chip.

In the above image, the whole logic of the robot is embodied in such a chip (the cyan box with a "2" on it). Here's what the inside of a chip looked like:
Image

When I saw that Combinators were coming to Factorio, and also that surfaces were implemented (though not yet used), it immediately gave me the idea for a "Compound Combinator": clicking on it would transport the player inside, where they would see connections for the Compound Combinator's inputs and outputs coming in through the walls, and there would be floor space where standard combinators could be placed and wired up as usual. The player's avatar could be changed to some kind of hologram looking thing, or it could be absent altogether, as in sandbox mode.

What do you think?

Friday Facts comments about surfaces, for reference:
Surfaces
As you may know, the space platform building part was moved to 0.13, but one of the big changes we had to do is already prepared for 0.12. The game can now contain independent surfaces which are basically independent maps in a single game. This option is unused in the vanilla game, but it is possible to create additional surfaces (and teleport there) through scripting interface. I'm almost sure that some mod will use this new feature, so it will be better tested until officially used in 0.13.

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

Re: Compound Combinators (complex logic in a single building)

Post by johanwanderer »

I think this is a great idea, especially if you can import/export (or buy/sell via the market) these "chips".

Edit: added a separated suggestion on the ability to import/export things here: https://forums.factorio.com/forum/vie ... =6&t=14218

User avatar
StanFear
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sun Dec 15, 2013 2:49 pm
Contact:

Re: Compound Combinators (complex logic in a single building)

Post by StanFear »

that would probably be possible using "alternative realms" created with the surface api (or the thing that will be used to make the space platform)

and could be done with a mod I think

User avatar
vampiricdust
Filter Inserter
Filter Inserter
Posts: 314
Joined: Wed Jan 14, 2015 1:31 am
Contact:

Re: Compound Combinators (complex logic in a single building)

Post by vampiricdust »

That would be really interesting and useful. A way to make combinators do more than just 1 thing at a time would be great.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Compound Combinators (complex logic in a single building)

Post by ssilk »

I think, that's what blueprints and mods are for.

Convince me. :twisted:
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Tinyboss
Fast Inserter
Fast Inserter
Posts: 205
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Re: Compound Combinators (complex logic in a single building)

Post by Tinyboss »

ssilk wrote:I think, that's what blueprints and mods are for.

Convince me. :twisted:
Thanks for the reply, ssilk. :)

For starters, it would address (in a slightly different way, and with a little modification to increase the number of inputs and outputs) the desire you posted here.

Yes, blueprints allow us to save and replicate big chunks of combinator logic, but compound combinators would be much more compact as well as aiding clarity, because a particular decision or transformation is physically encapsulated in a single combinator. Speaking of blueprints, we could reuse the clever system of labeling them with up to four icons. These icons would show up in the information view (the one that's toggled by the alt key).

It also can add a little content by letting the player research Mk1, Mk2, and Mk3 compound combinators, with each level increasing the number of inputs/outputs and the available building area inside.

I agree that it could be modded, and in fact the devs were hoping that some mods will take advantage of surfaces between now and 0.13. I'd do it myself if I had the time to learn how, but I don't. Whether the bulk and mess of existing combinator logic justifies adding something like this to vanilla is of course up for debate, and we won't know until people start doing bigger things with combinators. I've already read several complaints about their size and the confusion of wire running.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Compound Combinators (complex logic in a single building)

Post by ssilk »

Ok, that are good arguments and brought be to a point where myself founds good reasons.

One of the biggest problems with the circuits I currently see is the mess (somehow wanted) and the needed space.

The mess is a problem - not from the gameplay (as said, I think it is wanted) but because you cannot explain a circuit by making just a picture. It needs to be explained with some afford. And so it cannot be discussed. And so it cannot be extended/improved.

That is also an anti-pattern in programming: If you need comments, to explain your code (or in this case the circuit) it is too late. You made something wrong. Good code should always explain itself and only in some rare cases you need comments.

Yes it explains itself, if you have Factorio running. But you cannot discuss it. And the comments are lying, because meanwhile you updated your circuit to make it smarter.

There's no good way out of that.

But one good way would be, to have that encapsulated. O.k. I made this mistake once: https://forums.factorio.com/forum/vie ... f=5&t=1016
That didn't make sense, cause Factorio here works as "What you see is how it works". But for circuits this is not true yet and I cannot think of good ways to achieve that.

So here it makes sense. This is an astonishing insight: If we want, that a circuit can be rebuilt, we don't need to explain, how it works. We just need to explain, what goes in and what goes out. The rest can be a black-box. That would make the work, discussion and so on much easier.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

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

Re: Compound Combinators (complex logic in a single building)

Post by johanwanderer »

ssilk wrote:That is also an anti-pattern in programming: If you need comments, to explain your code (or in this case the circuit) it is too late. You made something wrong. Good code should always explain itself and only in some rare cases you need comments.
I agree with everything else, but I just want to touch on the subject of comments. Comments should say what the code is supposed to do (Given input X in the range [0,pi] radian, this block will return the cosine of the angle represented by X.) and not what the code does (the latter would just be redundant). Comments are needed because sometimes the block of code that does X may span more space than a person can read and comprehend in one pass (same issue with the combinator logic here), or the code is so spaghettified (think Perl).

Therefore, I think a "black box" with a truth table on it would be great. The inside may be extremely complicated (or simple, or nested) as long as the IO pins satisfy that truth table. (I'm thinking, when you click on the "box", you see the truth table -- strictly as a comment by the author).

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Compound Combinators (complex logic in a single building)

Post by ssilk »

johanwanderer wrote:
ssilk wrote:That is also an anti-pattern in programming: If you need comments, to explain your code (or in this case the circuit) it is too late. You made something wrong. Good code should always explain itself and only in some rare cases you need comments.
I agree with everything else, but I just want to touch on the subject of comments. Comments should say what the code is supposed to do (Given input X in the range [0,pi] radian, this block will return the cosine of the angle represented by X.) and not what the code does (the latter would just be redundant). Comments are needed because sometimes the block of code that does X may span more space than a person can read and comprehend in one pass (same issue with the combinator logic here), or the code is so spaghettified (think Perl).
If you cannot read the code in one pass it is not readable. A comment cannot change it, indeed it makes it even worse.
Another thing is documentation of functions. But also here: Good code doesn't need comments to make it understandable, cause you name that just like so.
Therefore, I think a "black box" with a truth table on it would be great. The inside may be extremely complicated (or simple, or nested) as long as the IO pins satisfy that truth table. (I'm thinking, when you click on the "box", you see the truth table -- strictly as a comment by the author).
Ah, you mean commenting such compound. Well, I come with my example from Reason:
Image
Image

I would like it like so: Every input has a name, every output has a name and the logic is inside.

Some devices have written documentation on the backside. Some need an extra documentation.

But comments????
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Tinyboss
Fast Inserter
Fast Inserter
Posts: 205
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Re: Compound Combinators (complex logic in a single building)

Post by Tinyboss »

I think it would be helpful to be able to add short comments to the compound combinators (or existing ones, for that matter). I agree that good code is self-documenting, but a bunch of logic gates wired together with each wire carrying potentially hundreds of signals, only a few of which may be relevant, will never be self-commenting in that way.

Post Reply

Return to “Ideas and Suggestions”