Interactive Elements: Their Use and Potential
In the Dual Universe March 2017 DevDiary video, we were given a teaser for some contraptions referred to as Interactive Elements. One of the examples shown was a pressure sensor; when the player stepped on top of the sensor, two lights were switched on. These elements make up a simple input/output system, explained below.
The laser sensor, an input, emits an active signal when it is triggered. When it is not being triggered, it emits no signal, or an inactive single. The lights are outputs, and they receive inputs. When the output of a sensor is connected to the input of a light, and that sensor is triggered, then the active signal of the sensor triggers the light to turn on.
Something like a sensor is called an input, because it is what takes the input of the user. However, it sends an output. Output signals are the only things sent and received in a simple logic system like this.
A light receives that output and does something with it; and that light is also called an output, because the light turning on is what you get out of the system.
Before moving on, I would like to clear up some fundamental conceptual details about a system like this. In a game like Dual Universe, with its simple input/output system, everything is always “running”. In real life, when you flip a switch in your home, you send electricity to a light; but in Dual Universe, the light already has power, as does everything else. When you flip a switch in the game, you are simply telling the light when to turn on. Similarly, when you activate a sensor, you are not sending electricity to the light, you are sending a signal which is telling the light to turn on.
Another feature that was shown in the recent DevDiaries were logic gates. Three different kinds were shown: OR, AND, and NOT gates. These elements are special nodes which can both take inputs and send outputs, depending on criteria.
Typically, inputs (switches, sensors) are present at the beginning of a system and outputs (lights, doors) are at the end. Logic gates reside in the middle, where they can be used alone very simply, or combined with many other nodes to create complex systems.
The diagrams below use switches and lights to show the state of the system. Switches are used because it is easy to illustrate whether they are on or off.
An OR gate can have any number of inputs and outputs. The output signal of an OR gate will be active if any of its inputs are active. It could have 100 different sensors hooked up to it, but all it takes is just one of those sensors to be triggered for the output of the OR gate to be activated.
An AND gate requires all of its inputs to be active for it to send an active output signal. If an AND gate has 100 sensors hooked up to it, each sensor would have to be simultaneously triggered for it to send an active signal.
A NOT gate is simple; it only has one input. A NOT gate reverses the state of the signal it is receiving; if a sensor is hooked up to it and not being triggered, then the NOT gate will be sending an active signal. If the sensor is then triggered, the NOT gates output signal will deactivate.
Solving a Problem
We are now going to use all three of these gates to solve a simple problem. Let’s say you have a room. There is a switch next to a door on either end of the room, and on the ceiling there are lights. You want to make a system where flipping either switch will reverse the state of the lights. So the scenario you want is this:
- If the lights are off, someone can enter the room from either end, flip the switch, and turn the lights on.
- They can then leave the room at the other end, and flip the switch there to turn the lights off.
Stated again, we want a system where either switch reverses the state of the lights; if they are on, they should turn off no matter the switch, and vice versa. One initial thought might be to simply hook both switches up to and OR gate, and hook the OR gate up to the lights. But this will not work; remember how these simple input/output systems work. If this system was used then this would be the case:
- When neither switch is flipped on, the lights will be off. Flipping one switch will activate its output and thus the output of the OR gate, and the lights will turn on!
- However, if the other switch is flipped, its output will also activate, the OR gate will have two active inputs, and the lights will stay on.
So while it may seem like a very easy problem at first, it quickly becomes apparent that the solution requires a bit of thought! There would be no point in providing a written explanation for this; the diagram below is a solution to this problem, and studying it is all that is needed.
So as you can see, figuring out how to make this system of lights work actually requires a bit of thought. For a simple system like this, there are already solutions online; for more complex systems, especially those specialized for a function you want in particular, you’re going to have to figure it out on your own!
Several Interactive Elements have been shown so far, including switches and force fields. These all may seem like they are part of a very simple system, and indeed they are! It will be trivial to make a system where a switch activates several lights at once. However, this small little feature has the potential for so much more than that. Several video games before have implemented simple systems similar to that shown in the DevDiary video; two great examples are redstone in Minecraft, and wiring in Terraria. Both of these examples are very simple input/output systems, with buttons and switches able to trigger things like enemy spawners, pistons, and arrow traps.
However, what systems like these have in common is that players always find ways to take them farther than many would think possible. Things such as calculators and computers have been created in these games using only the tools provided by the game (Terraria systems notably often utilize a glitch which rapidly moves NPCs around the map, essentially treating the NPC as, for complete lack of a better description, a single lump of active signal. I am pretty unfamiliar with this method, but it is called hoiktronics for those interested).
Dual Universe and its Interactive Elements will be no exception, which is why the introduction of these elements is one of the best features to be announced for the game so far. It will give players so much to tinker with and try and figure out, and will lead to contraptions that many people wouldn’t think possible. All kinds of videos and guides and showcases will be created around all sorts of contraptions for this wonderful feature. Simple little systems like these have shown in the past to have potential for so much; I can’t wait to see what people will do with these tools!