ZeroGravitas
The Destroyer
[Last Updated: 2015-08-19. Questions/suggestions will help flush out this guide. Recommended reading first: Hoik Guide]
+ Introduction:Terraria wiring is different to that in real life (and Minecraft). It is activation based, rather than relying on a steady voltage state or continuously applied on/off indicator. These activation events only come from the following: pressure plates, timers (1, 3 or 5 second, after they've been turned on) or switches/levers clicked by a player. These 'switches' are more like buttons really, since they only send an instantaneous pulse, as do plates. There are no other input devices or sensors (as of 1.2.4.1). So making wire devices change what they're doing requires either a player, friendly NPC, statue mob or 'wild' spawned monster to hit a button. I'll call these characters 'actors' for want of a better umbrella term, since they trigger activations.
Plates send only a single activation when hit by an 'actor', then nothing more until their body has cleared the plate (and then overlapped it again). Actors are only allowed to trigger 1 plate at a time and plates have to be at least 1 tile apart, so this puts a cap on how fast wiring devices can do stuff: the top speed of the actor involved. A former wiring staple, bird engines, top out at ~10.6 activations per second, in line with the bird's top speed in tiles/s. (Up to 37acts/s possible from some mobs via a rainstick configuration.)
But straight line speed isn't all that interesting in it's possible uses. The path of mobs has to be diverted sometimes in order to make true switches (transistor equivalents) for logic operations. This can, and has, been done with birds, for example. But even birds are clumsy and somewhat unpredictable (although deterministic) in navigating bends. This means that there is a greater need for statues, whereas mobs from a single statue can be distributed around a device far more quickly with hoiktronics.
PowerCosmic's scoreboard | DicemanX's 24 hour hoiktronic clock | Slownick's reset tower design | My compact reset line.
'Hoiktronic' is intended to communicate the key use of the 'hoik' glitch (with sloped blocks) to control the movement of NPCs so rapidly and precisely that they become somewhat like big, fat electrons, facilitating rapid digital mechanisms. In even the best designed bird reset towers it take several seconds for a bird to blunder through all the motions, while a reset line (of about the same size and number of resets) takes 16 ticks or less (~1/4 of a second). Similarly, while PowerCosmic's bird powered lookup table for scoreboard display is very efficient, it still takes about 1 second to update, where as the hoiktronic equivalent is done almost too fast to see the change ripple through the segments (8-18ticks total).
Skeletons are the tallest statue mob, so are best for use in hoiks. This is because the vertical and horizontal jump distance of the hoik glitch is determined by height category of the sprite colliding with the sloped blocks. The height also allows space to insert pressure plates into each hoik step, between, below, or above hoik teeth (depending on hoik type). Happily, skeletons have the same dimensions as players and town NPCs, which is convenient because the same hoiktronic designs will work with any of these. So player can test the design themselves, before letting the little monsters loose all over the place.
1 player, 10 skeletons max, 21 'town' NPCs, (and up to 15 snow zombies, if you're clever!)
This new wiring paradigm can arguably be divided into further subtypes as follows:
+ Type 1 Hoiktronics - Captive Actors: are held in the hoiktronic logic device, waiting for input. This allows it to respond immediately (same tick) to any input signal. The flip-flops in my first hoiktronic counter operate at up to 60 times per second, i.e. changing state once per game tick. This is effectively a 'synchronous' device, and perhaps the closest you can get to conventional electronics logic in Terraria, since input signals are updated to output every tick.
+ Type 2 Hoiktronics - Travelling Actors: are sent down hoik lines to update logic one step at a time, asynchronously. Actors behave like marbles or billiard balls rolling through a Digi-Comp mechanical computer, tipping levers this way or that, their path shaped by barriers. They are the read/write head. Unlike type 1, this paradigm is far more easily extendible, at only the cost of latency, as a longer run will increase the time it takes to complete a full iteration of logic updates, etc.
by using a 1s timer as input and being extended to the width of a 1920p screen.
Extending these devices too far can hit other practical limits of the game: skeletons will spontaneously de-spawn within ~12 seconds when they go off screen (1920p resolution), instantly under certain conditions. At night, off-screen NPCs will immediately teleport to a home too, unless their home is visible. Players are the most reliable of actors, since they only despawn on death and don't (necessarily) try to move around on their own (falling out of alignment for down-hoiks, for example).
A particularly useful feature, of horizontal hoiks, is that the exact vertical position of an actor during a step depends on whether the previous step had a top (against ceiling), or a bottom (against floor) hoik tooth.This distinction is just enough to make the difference between hitting a pressure plate or clearing it on the next step (diagram below, left). This allows for an unbroken hoik run, of a fixed number of steps, when a series of logic levels are reset (or set). DicemanX's reset mechanism (below right) with the same run time regardless of number of resets required. My more compact reset line (see top of post) is half the size, but more complex with variable execution time, due to optional waist height bottom hoik steps (and only works right to left). This feature has many other potential uses...
+ Type 3 Hoiktronics - Discrete Components: hoiktronic logic can be packaged up into self contained units, with only wires connecting between (see below). This is more like the old bird powered logic and is limited by the 0.5s input cooldown on spawning statues. To overcome this you could simply chain these discrete devices together with teleporters, output to next input. However, this would then be more of a convoluted type 2 hoikronics, with instantaneously fast, wired teleporter routes replacing hoik connection lines. The extra wiring for the teleporter interlinks may prove prohibitive in (parts of) complex builds, and could lead to extra failure modes, with actors being accidentally back-teleported when multiple actors are in use.
+ Hoiktronic Computing:
Teleporters can be used to instantly mount a spawned skeleton onton a hoik, without having to wait for them to clear the statue on foot. Teleporters are also particularly useful for exit points that would be difficult to install within a complex mechanism using hoik-only routing (since we're stuck in 2 dimensions here). DicemanX's expandable computer is a good example of this, with many teleporters all linked up to the same exit, to clear skeletons out when they're finished with. It's also a execution of a relatively powerful design for doing mathematical operations on binary numbers.
Multiplayer - skeletons and NPCs seem to behave entirely correctly, although they may fail to render for long lengths of hoik, so machines may seem to be working by entirely invisible magic. Players do not work correctly in devices like the counters shown in the type 2 hoiktronics video. Wiring events seem to take several ticks to get updated, while block collisions continue to update, hence player will not be diverted correctly by instantaneous actuation of blocks. Alternative server software has not been tested.
Down Hoiks - are generally problematic, because they are sensitive to the actor's precise horizontal positioning (must be right up against the thick side of the sloped teeth). Players can easily fall out after walking into a down mount, and lengths over 6-7 consecutive steps are unsuitable for use with skeletons and NPCs are their continual movement will cause them to get jammed.
+ 1.3 Update Changes (2015-07-30):
- There is one more NPC available now (the Tax Collector
- NPC behaviour has also been slightly modified, @DicemanX says this has broken parts of many of his hoiktronics builds, which will need tweaking.
- Mob behaviour looks largely unaffected, so far.
- Hoik physics itself seems otherwise unchanged. (However, trap timings have been tweaked, which may affect related builds.)
- Target Dummies look set to revolutionise hoiktronics since their 'ghosts' can drop or be teleported away from the fixed standing position of their sprite! It appears this will add an additional 100 very well behaved size 3 (player/skeleton sized) actors.
- @DicemanX's guides:
- Universal Logic gates (type 3 Hoiktronics - AND, NOR, etc).
- Giant Logic gates ('ghost dummy' hoiktronics for binary operations, etc).
- T-MEC (Terrarian Mechanical Engineering Corps) discussion group, for the latest in hoiktronic developments.
- Definitive Terraria Engineering Resource Links List (includes links to hoiktronic builds).
- Player & General Hoiks | Item Hoiks | Fastest Engines Measured.
- Bird logic guide (by LunarFuror, on old forums, from V1.2)
Last edited: