Hello Gamecrafters!

As we’re sure you’re aware by now, we’re working on some amazing features for the next major Gamecraft update and we’re going to talk about some of these features in each Dev Blog leading up to the release. This week we’ll be diving into the mystical world of logic and talking about all the Logic Gate blocks we plan to add in this coming update.

Each logic gate has its own unique function, and each will output a signal that is either 1 or 0. Inputs can be anywhere between -1 and 1, so we decided to round them so they interact nicely with these Logic Gates. Essentially, the input signal is rounded up when it reaches the Logic Gate (e.g. +0.5 is rounded up to +1, +0.49 is rounded down) and then clamped between 0 and 1 (e.g. -0.9 is clamped to 0 instead).

Let’s dive in and take a look at how each of these Logic Gates works, so you have a better understanding of how to optimise these logic gates in your games. We’ll start with 3 basic gates - AND, OR and NOT.

First, the AND Gate. This gate outputs a signal of +1 ONLY when BOTH inputs are receiving a signal of +1. This can be seen in the example above, the output is giving an output of 0 up until both inputs are giving that signal of +1.
Next, we’ll go onto the OR gate. This gate outputs a signal of 1 when EITHER of the inputs is receiving a signal of +1. This could be one or both of the inputs, but as long as one of the inputs is +1, it will give an output of +1.
Next is the NOT gate. This is a simple gate where it provides an output of +1 as long as the input is not +1. Unlike the AND gate, if both inputs are receiving a signal of +1, this gate goes back to providing an output of 0.
Now that we have these covered, let’s take a look at the rest of the planned Logic Gates. These are slight variants on the AND, OR and NOT gates above. These gates are NAND, NOR, XOR, and XNOR.

The first of these is the NAND gate. The NAND gate is the inverse of the AND gate logic. So, in order for the NAND gate to output +1, BOTH inputs must be receiving a signal that is less than +1. If EITHER input receives a signal of +1, this gate will output 0.
Next is the NOR gate. The NOR gate combines the OR and NOT gate logic together. In order for the NOR gate to output +1, NEITHER of the inputs can be receiving a signal of +1.
The XOR gate is similar to the OR gate, however, it is exclusive. This means ONLY 1 input can be receiving an input of +1 to provide an output of +1. If BOTH inputs receive an input of +1, the output will be 0.
Finally, the XNOR. This gate is a combination of the XOR and the NOT gate. This gate provides an output of +1 as long as BOTH inputs match, as 0 or +1.
All of these Logic Gates, alone or combined, should allow you to create a myriad of logic in your games. We can’t wait to see what you create with them, alongside all the other amazing features coming in this update. These are only the first of many. There are more Math and State blocks to look forward to in upcoming updates as well!
We hope you enjoy this small sneak peek into what we’re planning on releasing in our next update. Remember, we’ll be talking about more of the features that we are currently working on in each Dev Blog leading up to the next release. If you missed last week's blog, be sure to give it a read here: Gamecraft Blog 21/02/2020
We're also giving you another reminder that we'll be dropping support for “signal averaging”. You can read more about that here:
https://steamcommunity.com/gid/103582791464559041/announcements/detail/1693854158811546458
Please follow us on our social spaces and share your creations with us:
Twitter- https://twitter.com/Gamecraft_FJ
Youtube - https://www.youtube.com/channel/UCkcRFCr9aQxszaYeXcWZjwA
Facebook- https://www.facebook.com/GamecraftGame/
Reddit - https://www.reddit.com/r/GamecraftGame/
Discord - https://discord.gg/gamecraft
Thanks for reading!
The Gamecraft Team
