Logic System Behavior
Tankken includes a digital logic system with dynamic stage elements that can be activated. This page describes how the logic system works. For details about the various dynamic elements, visit the stage elements documentation.
The logic system is divided into three categories of block: inputs, processors, and outputs. An input originates a signal, a processor changes a signal, and an output reacts to a signal.
- Inputs
- Button
- Lever
- Pressure Plate
- Processors
- Logic Gate
- Delay Block
- Outputs
- Rail
- Axel
- Boxing Glove
- Forcefield
- Lamp
- Wire
- Logic Gate
- Delay Block
Connections are indicated between elements via blue lines. Here, a Lever is connected to a Forcefield.
The game processes the logic system when there is a change, and the change is cascaded along all connected components. Even though an Output can have unlimited inputs, the state of the output becomes the state of the most recently changed input. For example, if a Lamp has 5 inputs (3 false, 2 true), and one true becomes false, the lamp will turn off. This is done for performance reasons. If you don't want this behavior, connect a logic gate as the sole Input to the Output, and specify the boolean operation to decide the state of the Output.
It is important to note that when an input or processor changes state, there is a 0.1s delay between the state change and the state propagation. This delay is async to the game tick. It exists to prevent connection cycles from hanging the game. There is no guarantee of ordering within an update.
A digital logic system naturally encourages very complicated contraptions to be built. While we make no guarantees regarding the performance or stability of the game should you choose to build a functioning computer within it, you can improve the performance of your contraption by disabling the Visibility setting of Logic Gates and Delay Blocks. Hidden elements are not synchronized to clients and their sounds and effects are not played, lessening the burden on the game and reducing network traffic.