Basic Electronics

From Terminal Heist
Jump to: navigation, search

Basic behavior of elements and electrical state behavior.


Wiring Basics[edit]

How power is transmitted[edit]

The source of all power is a power cell. If there is a conductive path from a power cell to an terminal objects that reacts to power, then that terminal objects will be turned on. This only happens in self tests and robberies, in build mode power does not propagate and most terminal objects will appear off.

Power Example 1.png

In this image you can see that Wire are conductive so power can pass from the source through the to the indicator panel and thus turn it on. "Open" indicator panels are also conductive. This means you can use them as a path for the electricity to take, and they will also light up when powered:

Power Example 2.png

As you can see, the lights pass power through. It's important to note that there are some tiles that are not completely conductive, but rather only let power pass through one way, an example of this is horizontal wire:

Power Example 5.png

These do not pass power up or down, just horizontally. The lights are not powered because they are not receiving power. Components do not "draw" or "pull" power out of tiles, the power must be fed into them.

Next to note is that some tiles are not conductive at all, but still react to power:

Power Example 4.png

Non-conductive panels (they have a little n in the upper right corner indicating they aren't conductive) are obviously not conductive. If power is fed into them they will turn on, but they will not pass power to surrounding tiles. Here you can see that the first light is directly powered by the wire. Power cannot get through this light to the wire behind or lights above and below, so no more are powered.

Switches generally change between being conductive and not conductive, for example:

Power Example 3.png

The switch is in its up state, in which it is not conductive. Power can not get through to activate the light. When we press it however:

Power Example 6.png

It goes into its down state, in which it is now conductive. Thus, power can get through and to the light.

Some tiles are conductive, and others are not. Here are a few of the traps you are likely to be using:

PCTCIP.png Trash compactors are not conductive.

PCPDIP.png Neither are powered doors.

PCSPIP.png Shock panels, however, are conductive.

All electricity state changes appear to occur immediately, there is no "propagation delay" like in Minecraft, however some more complicated mechanism however do make use of the fact is calculated in "sub-steps" in which there is a delay.

Color Coding[edit]

There are some simple rules to understanding the tiles that use electricity that can help you remember how the electronic tiles work. One of those is color coding, we try to use consistent colors, and multiple colors may be used in the same the object to convey information about how the tile behaves. For instance, the Trash Compactor has light blue highlights when powered (and closed) and it has dark orange connectors to show the while it takes power it does not conduct power through itself. Another example, both lit powered Indicator Panels show light blue, however, the conductive one has yellow connections and the non-conductive again has dark orange. In the cases of the "connections", they also indicate which way power goes. Relays only trasmit power horizontally never up and down. The fact that there are yellow connections on the left and right sides indicate this. Additionally, the dark orange terminals on the top of the relays show that they take a power input from the top, but do not transmit power in that direction. :

Color Meaning Examples
Light Blue Power/Has Power PowerCell.png   ShockPanelHot.png  IndicatorPanelOn.png  IndicatorPanelCon.png TrashCompactorClosed.png PoweredDoor.png
Yellow Conductive

PowerCell.png   WiredPlasticWall.png ShockPanelHot.png ShockPanel.png IndicatorPanelCon.png IndicatorPanelC.png HorizontalWire.png VerticalWire.png Wire.png BridgeWire.png PoweredRelayClosed.png InvertedPoweredRelay.png SwitchDown.png RotarySwitch.png PermamentSwitchDown.png SecuritySwitchDown.png

Dark Orange Non-Conductive (but takes power)

PoweredDoorOpen.png PoweredDoor.png TrashCompactorClosed.png TrashCompactor.png IndicatorPanelOn.png IndicatorPanel.png PoweredRelay.png PoweredRelayClosed.png InvertedPoweredRelay.png InvertedPoweredRelayClosed.png

Gates and logic[edit]

Powered Relays and Inverted Powered Relays are important components for most beyond the very basics.

PoweredRelay.png A Powered Relay in its default, unpowered, state. It does not conduct in this state.

InvertedPoweredRelay.png A Voltage Inverted Triggered Switch in its default, unpowered, state. It conducts horizontally in this state.

These tiles look and act similar, but are inverted from each other. When either is powered from above the u or n symbol will go from dark blue to light blue indicating it is powered from above. Also, the horizontal bar will turn from black to grey when it is transmitting power horizontally.

PoweredRelayClosed.png On the Powered Relay, you can see that its n symbol is light blue (powered), and it is transmitting power horizontally as the horizontal body is now gray.

InvertedPoweredRelayClosed.png On the Inverted Powered Relay, you can see that its u symbol is light blue (powered), the body has turned from gray to black meaning power is not transmitted..

With these behaviors "Logic gates" can be made:

Logic Example 1.png

This is an "And" gate. For the light to be on, both switches have to be pressed down. The upper switch lets power flow through to the top of the Powered Relay, and thus pushes the bar down. The second switch lets power flow through this switch horizontally.

If only the the upper switch was pressed then the bar would be down, but there would be no power to get through to the light. If only the lower switch was pressed, then the power could not get through the Powered Relay as it would be in its non-conductive state.

This next example looks almost identical, but has a Inverted Powered Relay instead of a normal Powered Relay:

Logic Example 2.png

If the bottom switch is pressed, then power can get through to the light. However if the upper switch is pressed, it powers the Inverted Powered Relay which will then cut off power to the light. For the light to be powered the bottom switch has to be pressed and the upper one has to be unpressed.

Below are descriptions of all electrical components, and then a table of logic gates.

Wiring Components[edit]

  • Wire - normal wire connects all four edges to let power through, vertical wire connects only the top and bottom, horizontal wire connects only the left and right.
  • Wired Plastic Wall - acts like wire, but blocks movement like a plastic wall.
  • Switch - changes state from conductive to non conductive and vice versa when stepped on by nauts or animals.
  • Permament Switch - initially non conductive, changes to conductive when stepped on and cannot be toggled back off.
  • Vertical Rotary Switch - acts like vertical/horizontal wire and toggles between them when stepped on. Initially vertical power is connected.
  • Bridged Wire - connects power vertically and horizontally, but does not let them interfere.
  • Powered Relay - conducts horizontally when power is applied to the top, does not conduct when there is no power applied.
  • Inverted Powered Relay - conducts horizontally when there is NO power applied to the top, does not conduct when there is power applied.
  • Power Cell - applies power to adjacent tiles.
  • Indicator Panel - Green - lights up when powered, but does not conduct power (acts like Powered Door or Trash Compactor).
  • Indicator Panel - Red - lights up when powered, and conducts power (acts like Shock Panel).
  • Security Switch - only button that can be activated by bots. Acts like a Sticky Pressure Switch. Cannot be pressed by droids or player.
  • Trash Compactor - Safe (closed) when powered. Deadly when unpowered. Does not conduct electricity.
  • Powered Door - Acts as a wall when powered. Open when unpowered. Does not conduct electricity.
  • Shock Panel - Deadly when powered. Safe when unpowered. Conducts electricity.

Logic Gate Examples[edit]

Description Image Truth Table
OR
If either button is pressed, the light activates.
Logic Or.png A B A+B
1 1 1
1 0 1
0 1 1
0 0 0
AND
If both buttons are pressed, the light activates.
Logic And.png A B A.B
1 1 1
1 0 0
0 1 0
0 0 0
NOT
If button is not pressed, the light activates.
Logic Not.png A
1 0
0 1
XOR
If only one button is pressed, the light activates.
Logic Xor.png A B A⊕B
1 1 0
1 0 1
0 1 1
0 0 0

Substeps[edit]

You'll probably eventually make something like this and wonder what happens:

Substep Example 1.png

The power should at first get through, letting it up and around to the top of the switch. This however turns the switch on, which stops power getting through. Now that no power is getting through though the switch should become unpowered and let power through again; it should get stuck in a loop!

If you make it though you'll see that it doesn't rapidly change back and forth as fast as the game can handle, or even just when you take a step, it "settles" into a state that looks exactly like it does in the picture. To understand why we first need to understand substeps.

A lot of the following examples will be created in castledraft, the map editor, as it allows showing which are on and which are off.


For the game to figure out the final state of electronics, it goes through many "substeps". This simulation happens every single time a naut makes a move or uses a tool.

In a substep, first, power propagates through anything conductive that it can. Then at the start of the next substep, voltage triggered (inverted) switches are triggered according to whether or not they were receiving power at the end of the last turn. The game keeps running through substeps until in the whole terminal repeats a "state" and one substep exactly matches another.

Lets say we make something like this:

Substep Example 2.png

When we step onto the switch, power will immediately get through the conductive switch and wire, but won't yet trigger the inverted power relay (VTIS).

Substep Example 3.png

It will take until the start of the next substep for the switch to update according to whether or not it is receiving power from above:

Substep Example 4.png

Once this happens, power can immediately get through on this same (second) substep:

Substep Example 5.png

And the light is powered. On the third substep the game sees that everything has stayed exactly the same, so stops the simulation at three substeps and gives the above state as the final state that you see.

Joshwithguitar put together a castledraft map to act as a visual guide to electronic substeps: http://castledraft.com/editor/2sP62y

Each row in the above example represents the substeps that the game goes through in order to determine the state of the different electronic configurations.

In the rows the leftmost circuit represents the initial state of a circuit before a pressure switch is turned on. The circuits to the right represent each cycle after the button is pressed until it repeats a state. The to the far right the final state as it will appear to the player.


Going back to the initial circuit though, what happens with this?:

Substep Example 1.png

This map shows the substeps that it will go through: http://castledraft.com/editor/oJviC2

By the third substep the game detects a repeated state, where everything is exactly the same as it was before, which means that it is going to loop. It doesn't need to go through any substeps after the third. The game simulates this loop again and finds the lowest seen state of each tile. This means their unpowered state. It then settles each tile individually down into their lowest seen state, and you end up with the circuit shown on the far left, which also happens to be what it looks like in build mode.

Even though it looks like power should be getting through, the game has forcefully decided that the and VTIS should be off, as that was the lowest state they were seen in during the loop.

Tips[edit]

Power flows both ways along , so be careful when using multiple gates together. Although in this example it seems like the bottom light only lights up if both switches are powered, pressing the bottom button will also provide power to the voltage trigger switch, lighting up the light even though only one button is pressed. One solution to this problem of bi-directionality is to use a "diode" type circuit.

File:Logic one-way.jpg

Related Topics[edit]

  • Advanced Electronics - such as bit-storage, pulses, counters, clocks, and how electronics cycles work
  • Traps Guide - applied for creative and interesting traps