Tutorial:TNT cannons/signals
Inputs
The aim of all inputs is to reduce the minimum time a component has to wait between entering a functional state and activating.
Manual

Left: Noteblock + Observer Right: Movement detection
Left: Autostarter Center: Book Right: Visual feedback
When thinking about manual activation of redstone circuits what comes to mind first are levers and buttons. But those aren't good options in cannoning because they are quite small and thus hard to aim at, usually increasing the time needed to click them. Buttons also need 1 to 1.5 seconds to reset. As an alternative one can use noteblocks instead of buttons and fence gates in combination with T flip-flops instead of levers.
Since moving the mouse around and clicking can take quite some time, one common method of cannon activation is player detection by string through jumping. To minimize the air-time one can place a grindstone next to the string (and optionally a trapdoor under the player) so that the player will rebound of it after just two pixels. This can happen in parallel to loading the cannon
Good practice is to switch between many modes with variable delay / signal strength. Variable delay can be achieved using repeaters. For signal strength the easiest way to do that is by using a lectern with a (15-paged) book and a comparator behind it. Sometimes it can be useful to encode modes using binary. This can be a pretty fast and compact method but one should keep in mind the risk of the convertion from our imagination into binary might take more time, than the few inputs required bring.
In some game modes the kits get distributed to start the fight. Using a block that can only be interacted with by placing an item inside (like placing music discs into jukeboxes or flowers into flower pots) one can spam the slot where said item will appear and thus eliminate reaction time. This is most commonly used to activate flying machines, automatic cannons and missiles.
Sometimes modes can only be changed by destroying and replacing the mounting blocks. This is quite compact and for some modes necessary but only viable in late-game applications because it is too slow for any early game interactions.
Automatic

Top-left: counting circuit
Top-right: BUD
Bottom-left: clock
Bottom-right: Wall + observer
Automation is a key part of freeing up player time for other purposes. Automation circuits might become quite big. To counter this they are often separated from the rest of the cannon so that the cannon won't cease functioning when the automation circuits get damaged.
The most common way to activate cannons automatically is by using block update detectors (including observers). They detect if TNT is at its position to activate a circuit. If this circuit is moving said TNT, common practice is to use a wall + observer combo (fences, iron bars and glass panes can be used as well) since walls only detect full blocks appearing/disappearing next to them and do not detect the piston head movement. This can prevent unwanted double activations.
Clocks might be used instead of BUDs (Block Update Detectors). They are smaller and might be faster. On the downside they oftenly require consistent conditions, limiting their use in manual cannons.
Parts of a cannon can be triggered with redstone logic. For example: If the blockstream has triggered four times, the cannon will activate. This can have various advantages discussed below.
Auto delay
To maintain maximum efficiency over multiple shots into one hole, usually the delay needs to be adjusted each shot. Delay can also be a way to change the current mode. This is usually achieved by wiring the delays in parallel and blocking those that would trigger before the current one.
Auto modes
Modes often can be designed to be full-automatically adjustable as well. Having automatic modes might increase the risk of shooting into holes without targets of interest but them being faster often makes up for that.
Automation matrix
If the enemies are likely to change their targets of interest, it might be beneficial to adopt dynamic automation. Automation matrices allow for planning many shots before the fight begins and tailoring them to the enemies Formation and tactic.
Predictions
As slightly touched on above, cannoning often is a game of predictions. The only ways to predict Formations, tactics and player movement in advance are to learn by asking other players and playing yourself. But some consistencies exist that will be discussed here:
Usually the projectiles and injectors are ignited after the propellants. Thus in many cannons it will save time to prime the propellants before the projectiles are ready, anticipating that they will likely be ready after the delay between propellants and projectiles.
Since not all players are equally fast it might be beneficial to test which players are faster and sort them so that the parts of the fighting machine that need faster actions are supplied as best as possible or fewer potential is wasted on cannons that require slower actions.
Converting signals
Sometimes signals can have unwanted side effects. This section is explaining, which signal type fits which purpose.
Double- & long activation
Double- and long activation often interfere with future events such as placing new TNT. They might also mess up T flip-flops and counting circuits.
To prevent this try to reduce all kinds of long activations (>four game ticks). Common sources are: (observers detecting...) Buttons, pressure plates, repeaters, redstone lamps, pistons, string, TNT placement and ignition. If there is no way around long or double activations, they can be reduced back to short pulses using rising edge monostable circuits.
Piston spitting
Piston spitting is sticky pistons pushing blocks but not pulling them back.
If this is unwanted it can be fixed by using signal lengths of more than two game ticks.
Update order
As a rule of thumb: The earlier a signal was created, the earlier it's update priority is. A 4 redstone tick repeater is processed before a comparator that activates that same tick, because it's signal was created 8 game ticks before that of the comparator (comparators create their signals in the same game tick as they get powered due to comparator priming). And the same can be said about the TNT that will be ignited by those components. The difference in update order is called event delay or ED.
Zero ticks
When a redstone pulse is terminated in the same tick, it is called a zero tick. It is equivalent to a one game tick pulse for some blocks and entities but is not processed by others at all. Some blocks such as sticky pistons and trapdoors get activated and deactivated with the pulse. This results in loads of useful properties. Some are: Trapdoors that are activated with a zero tick pulse might let TNT pass but not players. Propellants might move only for a zero tick, after accelerated to destroy nearby blocks or phase through unloaded chunks.
Synchronization
The synchronization of cannons is explained here.
Since this is a broad topic, only some rules how to make the synchronization less complicated can be named: It is best to let signals stay combined whenever possible. For example if you have an injector- and a projectile delay, let the projectile delay branch of off the injector delay. Now they can be adjusted simultaneously without changing the relative delay between projectile and injector. Or if two parts of the cannon undergo similar changes, it might be possible to perform those changes using the same component. Parts acting in parallel can hide dangers. A common problem is, that one part is BUDed by the other. Those problems are usually easy to fix but hard to find, so it is important to know, what to look for.
| Related | |
|---|---|
| General Concepts |
|
| Combat | |
| Utility | |