How boolean gates operate: For Beginners

Hey everyone.

I put this short tutorial together after I couldn’t find one on the forums. I’ve noticed in the past that some users, especially beginners, don’t have a full understanding of how the various Boolean nodes operate within Blueprints.

To put it simply, a Boolean is a logic gate whose output can be one of two states - true or false. Below are types of Boolean’s available in Blueprints.

booleantypes.PNG

You’ll see that they have two inputs, but remember that Boolean’s can contain a number of inputs to cater for your project’s needs. This can be achieved by clicking ‘add pin’ on the Boolean node (this only applies to AND, OR and NAND gates within Blueprints).

How each one operates can be seen in the following tables where 0 = FALSE and 1 = TRUE. OP = Output.

AND

The AND gate will output TRUE when all inputs are TRUE.

[table=“width: 100, class: grid, align: left”]

**A**
**B**
**OP**


0
0
0


0
1
0


1
0
0


1
1
1

OR

The OR gate will output TRUE when any one or all inputs are TRUE.

[table=“width: 100, class: grid, align: left”]

**A**
**B**
**OP**


0
0
0


0
1
1


1
0
1


1
1
1

NOT

The NOT gate acts as an inverter. Whatever the input, the inverse is output.

[table=“width: 80, class: grid”]

**IP**
**OP**


0
1


11
0

NAND

The NAND gate is a combination of the AND and NOT gates. This will output the inverse results of the AND gate.

[table=“width: 100, class: grid, align: left”]

**A**
**B**
**OP**


0
0
1


0
1
1


1
0
1


1
1
0

NOR

The NOR gate is a combination of the OR and NOT gates. This will output the inverse results of the OR gate.

[table=“width: 100, class: grid, align: left”]

**A**
**B**
**OP**


0
0
1


0
1
0


1
0
0


1
1
0

XOR

The XOR (known as exclusive OR) gate will output TRUE when either one of the inputs is TRUE but not when both are TRUE.

[table=“width: 100, class: grid, align: left”]

**A**
**B**
**OP**


0
0
0


0
1
1


1
0
1


1
1
0

XNOR (not available in Blueprints)

The XNOR (known as exclusive NOR) gate is a combination of the XOR and NOT gates. This will output the inverse results of the XOR gate.

[table=“width: 100, class: grid, align: left”]

**A**
**B**
**OP**


0
0
1


0
1
0


1
0
0


1
1
1

Examples

AND Gate

The player needs multiple keys to open a door or to activate something.

Has KEY 1 > No KEY 2 > Door remains locked
Has KEY 1 > Has KEY 2 > Able to open door

OR Gate

Throughout a level the player has to find and lead NPC’s to a safe zone. To succeed they need at least one survivor. If they bring more, the same success is met.

booleantypes.PNG

Combination

The player found and led all the NPC’s to the safe zone. They met the requirements of leading at least one but now that they have them all, they get rewarded with a bonus. This can be achieved by simply using an AND Boolean after the OR criteria was met.
The ‘reward player’ event could also be plugged into the second branch’s ‘false’ output.

Thanks for reading and if anyone has any comments or suggestions please leave them below!

Rob.

8 Likes

Thanks, I often find myself going to google to ensure I am not confusing things when I am working with non-standard(OR/AND) boolean logic. Now I can just favorite this thread and come back to it instead of wasting time searching google for reference. :slight_smile:

No problem, Zeustiak. Glad it will be of use to you! :smiley:

Very helpful, thank you :slight_smile:

Happy to help, TYGABYTE!

Woah really helpful! Bookmarking this for later use. Thanks!

Thanks for checking it out, koolbrosmk!

hi Rob, a very nice little tutorial that even i can sort of understand. would you be so kind and put a version on the wiki, as i expect it will be lost here after a few weeks.

Remember, people, you have a Thread tools link which you can use to subscribe to this page. It’s not quite a bookmark, but pretty similar. :slight_smile:

I’ll get a revised version up on the Wiki as soon as I get a chance :slight_smile:

Could you create a list of name function,method and attribute of blueprint in italian lengage please?

Thanks for mentioning that Jezcentral - I’ve not used that tool myself so that’ll come in use in the future!

SnoWolf, I’ve PM’d you about your question.

hi, can i ask you? Is there some similiar function where is more inputs, for example 9 and i can set that if is there more than 3 TRUE inputs, the output is TRUE. But if there´s less than 3, the output is FALSE. Thank you!