FANDOM


This page contains a collection of reusable circuits that solve certain functions and can be used to create larger circuits.Circuittest

General Concepts

Stores

Ring Store

RingStore

We have no memory chips at the moment, but we can store values by forming a ring. The ring can be extended by more chips that modify the value. Note however, that rings larger than one chip can be affected by the Ring Evaluation Order issue, if they have more than one entry point to the ring. Ring stores should be designed in a way that they do not modify the value in the default state, only once when required (e.g. when the user presses a button). Otherwise they will continuously do so.

RNG Store

RngStore

A random number generator chip in continuous mode can be used to hold a single value. Compared to ring stores, RNG stores are not affected by the Ring Evaluation Order issue, but do not provide native reset capabilities. So to be able to reset the value to 0, additional chips are required.

Single Bit Store

See RS Latch.

Increment

Increment

This Circuit increments a number every time the button is pressed.

Button Value

ButtonValue

A value usually has a value of 0 when not pressed, and 1 when pressed for a short amount of time. This circuit makes the button have 0 when not pressed and an arbitrary number when pressed.

Button Values

ButtonValues

This circuit replaces the button output by arbitrary numbers. The example results in 3 when unpressed, and 7 when pressed.

Pulse/Steady Conversions

Pulse to Steady

Ring Based

A simple ring store can be used to convert a value pulse to a steady value signal. Dice for example output the rolled number for a single tick and then output 0 again.

However when you use the simple ring store, you have to be sure that there will be no new pulse until the old value is reset. Otherwise use this:

PulseToSteady

This circuit always stores the last non-zero value. This circuit can be affected by the Ring Evaluation Order issue.

RNG Based

RngStore

This circuit performs the same function as the one above, see RNG Store for differences.

Steady to Pulse

Delay Based

SteadyToPulseTimer

A delay chip can be used to convert a steady input to a single tick pulse. Every time the input changes, the delay outputs that value for a single tick and then outputs 0 again. It is worth noting that the delay chip does always delay the signal by exactly one tick, but up to five ticks.

Ring Based

SteadyToPulse

This circuit does the same, but emits the pulse in the same tick that the value changes and outputs 0 in the second tick. It can be affected by the Ring Evaluation Order issue.

Copy Value

Ring Based

CopyValue

This circuit takes an input value from the left and copies it to the ring store on the right when a signal is triggered. The circuit can be affected by the Ring Evaluation Order issue. In that case the result is the same, but delayed by one tick.

RNG Based

CopyValueRng

This circuit performs the same function as the one above, see RNG Store for differences.

Toggle

Toggle

The button toggles the output between 0 and 1. Use this variant with caution: It keeps toggling as long as there is a 1 input. Therefore, only use 1-tick-long pulse signals to trigger it. However this behavior might also be useful when it is possible that two consecutive ticks trigger the toggle signal, with no 0 in between.

State Cycle

StateCycle

The button cycles the output between an arbitrary number of states. In this example the output can have 3 states: 0, 1 and 2. If the number of states is set to 2, this behaves like the Toggle circuit above, therefore the State Cycle is a generalization of the Toggle circuit.

Room Initializaion

RoomInit

This circuit outputs a 1 pulse when a new room instance is created, or the room is saved or restored. This allows you to execute some initialization routines, e.g. moving a piston to a certain starting point.

Logical Plus/Minus

Logic1

Often you don't need 1 or 0 as a result of a logic comparison or Boolean operation, but 1 or -1.

Absolute Value

Abs

Produces the absolute value of an arbitrary input.

High Score

Highscore

The left ring is a placeholder for the current score. If the score is higher than the current high score, the high score is immediately adjusted. The circuit contains rings and therefore might be affected by the Ring Evaluation Order issue.

Cooldown Button

CooldownButton

A button that is disabled for 5 seconds after it was pressed. This circuit can be affected by the Ring Evaluation Order issue.

RS Latch

RsLatch

Sets the output to 1 when S is pressed and to 0 when R is pressed.

RS Flip-Flop

RsFlipFlop

When C is triggered changes the output to 1 if S is 1 or to 0 if R is 1.

JK Flip-Flop

JkFlipFlop

Like the RS Flip-Flop, but toggles the output state when C is triggered and S and R are 1. The circuit contains rings and therefore might be affected by the Ring Evaluation Order issue.

Single Tick Delay

The official delay chip has a few characteristics that might not always be desired:

  1. It performs a steady-to-pulse conversion.
  2. It is time based and not guaranteed to delay for a specific amount of ticks.
  3. It takes time to initialize, sometimes up to 4 ticks.

SingleTickDelay

The above circuit delays the input unaltered by a single tick, and avoids all of the mentioned problems. This circuit exploits the Ring Evaluation Order problem to force the right chip to be evaluated before the input from the left is taken into account, which is therefore delayed by one tick.

Since this circuit exploits the Ring Evaluation Order problem, it can be affected by that exact issue. When wired in the wrong order, it will always output 0. If that happens, remove all connections, swap the two chips and rewire it.

Gizmo State

GizmoState

When you stop and restart gizmos in the maker pen menu they will reset, but often not to any meaningful state. The concept above allows you to detect the maker pen gizmo state and act upon that, e.g. reset some more states. The red output of the trigger zone outputs a pulse when gizmos are started, the blue one when the gizmos are stopped, and the green pin outputs a constant 1 while gizmos are active and 0 while they are stopped.

Specific Functions

Disco Light

DiscoLight

The stage light changes color to a different color every second. The color sequence is fixed.

Random Disco Light

DiscoLightRandom

The stage light changes color to a random color every second.

Spawn On Hit

SpawnOnHit

This circuit will respawn any player hit by a weapon. At least one respawn point from the sandbox has to be present in order for the player to respawn.

Spawn On Non-Self Hit

NoSelfHit

This circuit will respawn a player that has been hit if they are not the attacker.

Spawn On Different Team Hit

NoFriendlyFire

This circuit will respawn a player that has been hit if the attacker is on the opposing team.

Teleport Button

TeleportPlayer

Instantly teleports the player who pressed the button the spawn point.

Random Teleport Selection

TeleportPlayerRandom

Teleports the player who pressed the button to a randomly selected spawn point.

Checkpoints

Checkpoints

The buttons can of course be replaced by goals. Each button that is pressed activates the next one. When the last button is pressed, it outputs 1 for a short time to the lower output, increments the lap counter at the top and resets all buttons.

The number of checkpoints can be extended by repeating the sequence of button 2 (button, AND, Plus).

Number Pad

Numpad

This circuit realizes an integer input field, using one button per digit. It could be used for example to create a calculator or a door pin code.

The "From [number]" lines indicate a connection to a button with that number. Each OR chip on the left represents one digit in the binary representation button number. Therefore a button can be connected to multiple chips.

Implementation Note: This circuit can be affected by the Ring Evaluation Order issue.

HP Management

SimpleHp

A simple HP tracking implementation, in an elimination-style fashion. 250 HP are assigned to every player on game start, once a player reaches 0 HP he dies and cannot move anymore until the game ends. Note that there is no game end condition.

The currently most complete demonstration of what can be done can be found in the ^testhp4 room. If you are planning to create a room in the Maker Room and use some kind of HP management, chances are good that the demo supports that. It is fully configurable with variable chips, so you can request to clone it and might save some work.

Smooth Wave

Winker

It is surprisingly hard to create a smooth waving motion with the wave chip, although it appears to be designed to do exactly that. This circuit makes a rotator wave smoothly in a sine fashion from -45° to 45°. It is self-stabilizing and does not run out of those bounds over time. The circuit contains rings and therefore might be affected by the Ring Evaluation Order issue.

Extending this Page

Feel free to add more diagrams to this page.

Different people have created templates that you can use to draw circuit diagrams if you like: