And / Or etc for circuitry

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5246
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: And / Or etc for circuitry

Post by Klonan »

Sneak peek of 0.15

ImageImage

Yoyobuae
Filter Inserter
Filter Inserter
Posts: 504
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: And / Or etc for circuitry

Post by Yoyobuae »

@Klonan: Nice! Seems even bitwise AND, OR, XOR are in there. :o

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: And / Or etc for circuitry

Post by DRY411S »

Yoyobuae wrote:
DRY411S wrote:
Yoyobuae wrote:
DRY411S wrote:Integer functions (DIV, MOD, x^y, factorial!)
Signals are integer values. So Arithmetic combinator division is actually integer division.
Indeed. DIV would be no different to '/', but it would help readability.
Eh? I didn't know the assembly language DIV mnemonic was actually common knowledge.

Readability for who? Software engineers? Not all players have that kind of background.

Similar problem with MOD and even x^y (but there's no other good option for those).
Hmm, I'm not sure I knew DIV from assembly language. Think it may have been SQL.

If you don't want me to have DIV and want me to use / instead, can I have % on the arithmetic combinator instead of MOD? That definitely won't help readability for 'ordinary' players. ;)

I appreciate that DIV, MOD, x^y are advanced, but there's no harm in having some extra complexity for people who'd like to exploit it is there? There's no need to dumb down the combinators as long as the complexity doesn't impact the game performance. It might encourage players to stretch their knowledge of arithmetic and engineering, and that wouldn't be a bad thing would it? IMO the combinator part of the game would actually be more accessible if these type of functions were available.

(Don't get me started on combinators that have 2 outputs, one on the red wire and a different one on the green....)

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: And / Or etc for circuitry

Post by DRY411S »

Klonan wrote:Sneak peek of 0.15

ImageImage

Woohoo. :!:

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: And / Or etc for circuitry

Post by DRY411S »

Yoyobuae wrote:@Klonan: Nice! Seems even bitwise AND, OR, XOR are in there. :o
And DIV and MOD and x^y :D

User avatar
ChurchOrganist
Filter Inserter
Filter Inserter
Posts: 256
Joined: Sun Apr 17, 2016 12:45 pm
Contact:

Re: And / Or etc for circuitry

Post by ChurchOrganist »

Klonan wrote:Sneak peek of 0.15

ImageImage
Awesome!

Please, pretty please, may we have Hexadecimal entry of values now :)
Want to know where the biters chewing your power plant have come from??
Wondering where your next iron is going to come from??
You need Long Range Radar

User avatar
Gertibrumm
Fast Inserter
Fast Inserter
Posts: 162
Joined: Fri Jun 03, 2016 6:54 pm
Contact:

Re: And / Or etc for circuitry

Post by Gertibrumm »

DRY411S wrote:
Klonan wrote:Sneak peek of 0.15

Woohoo. :!:
Woohootoo :o

now I can remove two deciders and add one!
but the /= seems intimidating.

How are the bitwise operators going to work?

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: And / Or etc for circuitry

Post by DRY411S »

Gertibrumm wrote:Woohootoo :o

now I can remove two deciders and add one!
but the /= seems intimidating.

How are the bitwise operators going to work?
I'd imagine the same way they've always worked. :P

Input: >> or << (shift left or right): this_many_shifts => output_here

User avatar
Gertibrumm
Fast Inserter
Fast Inserter
Posts: 162
Joined: Fri Jun 03, 2016 6:54 pm
Contact:

Re: And / Or etc for circuitry

Post by Gertibrumm »

DRY411S wrote:I'd imagine the same way they've always worked. :P

Input: >> or << (shift left or right): this_many_shifts => output_here
So we got x bit channels now or is this shift stuff encoded into integer numbers?

Yoyobuae
Filter Inserter
Filter Inserter
Posts: 504
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: And / Or etc for circuitry

Post by Yoyobuae »

Gertibrumm wrote:
DRY411S wrote:I'd imagine the same way they've always worked. :P

Input: >> or << (shift left or right): this_many_shifts => output_here
So we got x bit channels now or is this shift stuff encoded into integer numbers?
Integers are encoded as binary numbers (signed 32 bit integers). ;)

I imagine those operations will be applied to the underlying binary representation (ie. just like the operators would work in a programming language).

One thing that I kinda wanted but still is missing is bit test as condition operator. Right now the work around is using extra arithmetic combinators and abusing less/greater than operators. Either option has it's limitations.

The use case is having hundreds of inserters, lamps, pumps, belts being controlled in parallel by only a handful of signals. Minimizes the amount of wiring and the amount of signals, which in turn minimizes the required combinators to control them.

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

Re: And / Or etc for circuitry

Post by orzelek »

Yoyobuae wrote:
Gertibrumm wrote:
DRY411S wrote:I'd imagine the same way they've always worked. :P

Input: >> or << (shift left or right): this_many_shifts => output_here
So we got x bit channels now or is this shift stuff encoded into integer numbers?
Integers are encoded as binary numbers (signed 32 bit integers). ;)

I imagine those operations will be applied to the underlying binary representation (ie. just like the operators would work in a programming language).

One thing that I kinda wanted but still is missing is bit test as condition operator. Right now the work around is using extra arithmetic combinators and abusing less/greater than operators. Either option has it's limitations.

The use case is having hundreds of inserters, lamps, pumps, belts being controlled in parallel by only a handful of signals. Minimizes the amount of wiring and the amount of signals, which in turn minimizes the required combinators to control them.
You will have both and and or logical oprations. Those are your bit tests :D

I do agree that hex values would be very useful then - makes bit settings much more clear and readable.

Yoyobuae
Filter Inserter
Filter Inserter
Posts: 504
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: And / Or etc for circuitry

Post by Yoyobuae »

orzelek wrote:You will have both and and or logical oprations. Those are your bit tests :D
But I want to program bit tests directly to inserters and such. :(

In the above screenshot the AND, OR operators were shown only for arithmetic combinator (so not available for conditional operators, like in deciders, inserters, lamps, etc).

Roxor128
Fast Inserter
Fast Inserter
Posts: 168
Joined: Sun Oct 02, 2016 9:48 am
Contact:

Re: And / Or etc for circuitry

Post by Roxor128 »

Yoyobuae wrote:
orzelek wrote:You will have both and and or logical oprations. Those are your bit tests :D
But I want to program bit tests directly to inserters and such. :(

In the above screenshot the AND, OR operators were shown only for arithmetic combinator (so not available for conditional operators, like in deciders, inserters, lamps, etc).
Not a problem. Just work out your boolean expressions before feeding into the decider.

Eg. Let's say you want (A AND B) OR (C AND D) to trigger an output.

Arithmetic 1 : A AND B
Arithmetic 2: C AND D
Arithmetic 3: Artithmetic 1 OR Arithmetic 2
Decider: Arithmetic 3 == 1

There you go. Simple boolean logic.

Post Reply

Return to “Ideas and Suggestions”