Jump to content

Recommended Posts

how to solve the continuous suggestion posts about logic gates

I took this idea and simplified it.

So, the ultimate logic gate is at a very advanced level on the research tree.

It goes like this:

This "logic gate" is taking only four tiles by default, but that can be increased or decreased (until 2*1. One input and one output) . It also has two inputs and two outputs by default (can be adjusted)

What is unique in it? It has a code.

To make things simple, I will talk in a language non-programmers will understand, and I will also explain everything.

Here is how it is going:

if(IN1)
{
send OT1 T
}

 

IN1 is the first input, and OT1 is the first output.

Saying if(IN1) means you run what is written inside the {} only if the first input is true.

You can use if(!IN1) to run the code only if IN1 is false

send OT1 T means sending a positive (T true F false) single through the first output

got it?

Now we are moving on:

if(IN1&IN2)
{
send OT1 F
}
else
{
send OT1 T
}

 

IN1 & IN2 means IN1 is true and IN2 is true (AND logic gate)

more:

IN1 !& IN2 means IN1 is true nand IN2 is true (NAND logic gate)

IN1 | IN2 means IN1 or IN2 is true (OR logic gate)

IN1 !| IN2 means IN1 nor IN2 is true (NOR logic gate)

IN1 ^ IN2 means only IN1 or IN2 is true (XOR logic gate)

IN1 !^ IN2 means not only IN1 or IN2 is true (XNOR logic gate)

!IN1 means not IN1 (IN1 is false)(NOT logic gate)

It can be used as IN1 & IN2 & IN3 (if you has three inputs) for example, or as !IN1 & IN2 | IN3 ^ IN4 when it runs this way:

First !, then & (then !&), then | (then !|), then ^ (then !^).

so that code means: IN1 is false (not trueand IN2 is true, or IN3 is true, xor ( yey, new slang) IN4 is true (tell me in the comments if this is confusing and I'll fix it)

 

got it?

 

else means the code after it will run only if the if before it won't run (the given value is false)

 

we need to add just one (actually three) more thing(s):

wait 5
{
send OT1 T
}

 

"wait 5" means it will wait 5 seconds before running the code inside it. 

Can also be used as "wait 5" without {} simply wait 5 seconds before continuing. 

A nice feature will be a gui you can insert logic gates to, and then it will generate the code.

But what about the T-switch gate?

Then this comes out:

variables

before you run away, I'm going to show you

x = T

if(IN1 & x)
{
send OT1 T
x = !IN1
}

 

means:

x is true (T is true, F is false)

if IN1 is true and x is true, send true from OT1, and set x to the opposite of IN1

you can also do

if(x == y)

which means "if x and y have the same value, then..." (can be replaced with x & y)

and also

if(x != y)

which means "if x and y don't have the same value, then..." (can be replaced with x !& y)

 

So how do you do a T-switch logic gate?

#if there are any mistakes please comment
#IN1 is the given signal
#IN2 is the locker
isLocked = F

if(!isLocked)
{
send OT1 IN1
} 
isLocked = IN2
else
{
send OT1 F
}

 

# indicates notes (like python)

so now, let's add while:

x = F

if(IN1)
{
while(IN2)
{
send OT1 x
x = !x
}

send OT2 x
}

simply, it does that:

If IN1 is true, then as long as IN2 is true, it will send x through OT1, then set x to the opposite of his current state. after IN2 is false, it will send x through OT2

that can simplify lot's of things (I think T-switch also, but I can't make up my mind)

now do:

x = F

do
{
send OT1 x
x = !x
}
while(IN1)

simply, do will run the code inside it, then keep running as long as the while after it is true (while will execute it only if the given parameter is true in the first place, and do ignore it at first)

 

 

 

if any of this is not understood, or you have more ideas, please comment

or actually...

#just do it

if(somthing == !understood | you have ideas)
{
comment
}
Link to comment
https://forums.kleientertainment.com/forums/topic/101513-the-ultimate-logic-gate/
Share on other sites

4 hours ago, SharraShimada said:

while(reading your post)

{

agree

}

It would be nice, but also overwhelming for most of the players. But there is no need to use it. For the players who know how to operate logic circuits it would be plenty of fun.

Yeah, while would be fun

I'm also gonna change some thing to make it easier (sending updated) 

4 hours ago, ConnerMc2000 said:

instead of code why not just logic gates? Open a gui of a grid and build the logic similar to how you do in the map. It would also help determine a material cost for the compleat gate.

Yeah, that's nice

However, code brings more possibilities and might be easier to understand, and as I said, there should be a way to convert logic gates to code using a gui

Also, let's make a step further. 

Maybe an ultimate ultimate logic gate that can also hundle numbers, and not just booleans (true or false) 

Also also, code needs NO MATERIALS. 

On 1/7/2019 at 3:41 AM, TG pro said:

Yeah, that's nice

However, code brings more possibilities and might be easier to understand, and as I said, there should be a way to convert logic gates to code using a gui

Also, let's make a step further. 

Maybe an ultimate ultimate logic gate that can also hundle numbers, and not just booleans (true or false) 

Also also, code needs NO MATERIALS. 

Yeah, I feel like this would be OP for game balance.  The sensors and devices all handle boolean signals only for simplicity.  While I would like integer handling, being forced to work with boolean seems to be an intentional design constraint that forces creativity.  Although the idea of turning ONI into a programming puzzle has some appeal, the fact is that the buildings themselves are the logical operators.  Being forced to use physics to implement some of the things you want is what makes it an interesting game, IMO.

They could introduce a microcontroller that has, say, 8 inputs and 8 outputs, and whatever logic you like in between, and all fits in, say a 3x3 space on the Automation overlay, but even that would be borderline OP.  If gates are handed out too freely, the pressure to optimize is reduced.  I think having limited automation is a good thing for game balance.

On 06/01/2019 at 5:09 PM, TG pro said:

This "logic gate" is taking only one tile. However, that can be increased. It also has two inputs and two outputs by default (can be adjusted)

It's not a "logic" gate if it can have 4 port on only 1 tile ! O_o

 

If you want 2 inputs and 2 output, your gate must, at least, be a 2x2 square.

On 1/12/2019 at 8:34 PM, Lawnmower Man said:

Yeah, I feel like this would be OP for game balance.  The sensors and devices all handle boolean signals only for simplicity.  While I would like integer handling, being forced to work with boolean seems to be an intentional design constraint that forces creativity.  Although the idea of turning ONI into a programming puzzle has some appeal, the fact is that the buildings themselves are the logical operators.  Being forced to use physics to implement some of the things you want is what makes it an interesting game, IMO.

They could introduce a microcontroller that has, say, 8 inputs and 8 outputs, and whatever logic you like in between, and all fits in, say a 3x3 space on the Automation overlay, but even that would be borderline OP.  If gates are handed out too freely, the pressure to optimize is reduced.  I think having limited automation is a good thing for game balance.

About integers, I have something planned... 

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...