Difference between revisions of "Guide to circuits"

From NSV13
Jump to navigationJump to search
imported>YourGrandpa
(Adds icons for the screwdriver and multitool.)
imported>Xhuis
(Massive rewrite; adds more info on the fundamentals, makes it more coherent, adds some visual aids, and adds a step-by-step guide to making a basic flashlight)
Line 1: Line 1:
{{Under construction
+
Science is now capable of building customizable machines, called '''integrated circuits''', to fill any kind of niche imaginable, like a health monitor, a smart turret, a signaller, or maybe just something like a syringe - or something else entirely. Circuits are very complex, though, and take time to learn and work with, so here's a few primers to getting started.
|reason = This feature is new and requires detailed writeups.
 
}}
 
Research is now capable of building custom machines, using '''integrated circuits''', that will hopefully accomplish whatever goal the creator had set out for the machine to solve, such as a health monitoring system, smart turret, a signaler controller for their bombs, or perhaps something to give Beepsky a run for their money. Or perhaps something else entirely, as more and more new parts get added to expand the metaphorical toolbox for these creators.  
 
==The Machine and Components==
 
  
Each machine can hold a limited amount of components, limited by both number of components, as well as an abstract 'complexity' value for each component. Complex components are generally things that interact with the outside world, like weapon systems, or a fast pulse ticker. Smaller machines will have stricter limits on how many things can be shoved inside at once, where as larger ones allow for more space, but are less space efficient when carrying it.
+
'''''Disclaimer:''''' Simple circuits and even a lot of complex ones are doable just with knowledge about circuits. However, complex circuits '''can and often do require math knowledge.''' There are components that use trigonometry, complex flow control components that can operate differently based on conditions, and component combinations to use tons of arithmetic to get the desired result. ''Be ready!''
==Tools==
+
 
The primary method for interacting with devices is through specialized tools.
+
== Preface: Tools ==
*[[File:Circuitprinter.gif]]Integrated Circuit Printer: Makes all the bits for your cool new toys as well as all the tools ( the wiring tool, debug tool and circuit analyzer )
+
 
*[[File:circuitwirer.gif]]Circuit Wirer: allows you to wire and unwire inputs and outputs. Outputs should only be wired to Inputs of a compatible type!
+
To make any circuit, you'll need a few special tools. These all spawn in the circuit lab at roundstart, and more can be made with a protolathe once they're unlocked through R&D.
*[[File:circuitdebugger.gif]]Circuit Debugger: Allows you write Refs, Strings, numbers or the null value to any buffer and send pulses.
+
* [[File:Circuitprinter.gif]] '''Integrated Circuit Printer:''' Your essential tool for creating circuits. It consumes metal to print out assemblies and components, and can recycle those components and assemblies back into itself for metal.
*[[File:circuitanalyzer.gif]]Circuit Analyzer: Allows you to get a text string used to copy devices.
+
* [[File:circuitwirer.gif]] '''Circuit Wirer:''' Used to link parts together (as well as unlink them) too tell the machine how to function.
*[[File:Multitool.png]]Multitool: Writes to bools and pulses.
+
* [[File:circuitdebugger.gif]] '''Circuit Debugger:''' Used to change values directly, as well as to directly "pulse" inputs to activate them.
*[[File:Screwdriver_tool.png]]Screwdriver: Lets you open the device shells to modify them
+
* [[File:circuitanalyzer.gif]] '''Circuit Analyzer:''' Can be used on any assembly to get a code that allows you to clone that circuit in a printer with the cloning upgarde.
==Pins==
+
* [[File:Multitool.png]] '''Multitool:''' A slimmed-down version of the debugger. It can write true/false values, and pulse inputs.
[[File:Pins.png]]
+
* [[File:Screwdriver_tool.png]] '''Screwdriver:''' Lets you open and close the maintenance panel on assemblies. You should probably do this unless you want people to starts yanking pieces out and undoing tons of work.
 +
 
 +
This guide will assume you have all of these tools handy (except maybe the multitool.) Keep in mind that you can also print out wirers, debuggers, and analyzers from any circuit printer with metal.
 +
 
 +
Circuits are inherently complex. ''Really'' complex. Each part in a machine serves a specific purpose and communicates with other parts in various ways to do it, and circuits are designed in such a way that making a machine is also a matter of finding the most efficient way to do that so as to conserve space in the assembly. Here's a ''basic'' rundown of how it all works:
 +
 
 +
== Fundamentals, Part I: Hardware, Space, and Complexity ==
 +
 
 +
'''Assemblies''' are what house machine components. Without an assembly, there is no machine. Every assembly also requires a power cell in order to power its components. The circuitry lab spawns with four by default, but more can be made from an autolathe (which is handily also inside the circuitry lab!) Other than power, there are two variables every assembly has:
 +
* '''Space''' is the total amount of components that can fit in an assembly
 +
* '''Complexity''' is the overall "complexity" score of the machine, which varies based on which components are added
 +
 
 +
Each component you insert takes up one point of space; there are no exceptions or deviations from this. However, every component also has a complexity score, depending largely on what it does. For instance, screens are very basic since they only serve one purpose - to display information - and so they only have a complexity score of 1, but integrated hypo-injectors inject, draw, and move reagents around. Because those are complex and serve many more functions, it has a complexity score of 20.
  
A component, generally referred to as a circuit, has 'pins' on it, of three different types. Pins are connected to other pins, on the same circuit or on another circuit inside the machine, and are used to pass information or activation pulses from one component to another.
+
Making your circuits effectively is a matter of making the most use out of the complexity available to you, though space is very rarely a concern. The amount of complexity and space depends on the type of assembly, of which there are four:
 +
* [[File:Smallcircuits.png]] '''Assemblies''' are small-sized, and have a max space of 25 and max complexity of 75
 +
* [[File:Mediumcircuits.png]] '''Mechanisms''' are normal-sized, and have a max space of 50 and max complexity of 150
 +
* [[File:Largecircuits.png]] '''Machines''' are bulky-sized, and have a max space of 100 and max complexity of 300
 +
* [[File:Dronecircuits.png]] '''Drones''' are bulky-sized, and have a max space of 75 and max complexity of 225, but are the only assemblies that can move autonomously
  
Most components have three types of pins, but some components may have only one or two types. The three types are input, output, and activation.
+
Very simple designs, like flashlights or translators, can typically fit into assemblies. More complex ones, like blood draw kits, are usually mechanisms, and the most powerful designs are only capable of fitting into machines. Drones are more niche, but open up a huge amount of possibilities due to their ability to move.
  
Input pins, as named, are what the circuit uses as input, where as the output pins are where the results go. For example, an addition circuit will sum up all the numbers it finds in their input pins, then put the result in their output pin. Activation pins are special, in that they don't carry data, but instead act as triggers for a component to do work. The addition circuit needs to receive a pulse signal to its activation pin in order for it to actually compute the sum of the inputs. When a circuit does work, and places its output in the outpin pins, it will then 'push' the data to any pins linked to the output pins, so that those pins will have the correct data. Most circuits do not 'pull' data, but instead need to have it 'pushed' from another circuit.
+
Assemblies have different "types", such as type-a, type-b, and so on. The only difference between these is cosmetic, and they all have the same attributes regardless of which "type" you choose you use.
  
A pin can be linked to an arbitrary number of other pins, as long as they are inside the same machine. Removing a component will automatically unwire everything from it, so keep that in mind.
+
== Fundamentals, Part II: Components, Pins, and Data Values ==
  
On the wiring interface, input pins are always on the left, output pins are on the right, and activator pins are on the bottom side. They are also colored red. Pins that are linked to to other pins are bolded, and will have a link to go to that circuit underneath. The data that pin holds, and the type it is, will also be visible.
+
'''Components''', or circuits (yes, it's confusing) are the parts of a machine that make it tick. They handle everything the machine does, from storing reagents to passive recharging to holding and throwing items. As mentioned in Part I, each component has a complexity value, which you can see by examining that component.
[[File:Pin notation.png]]
 
==Wiring==
 
  
[[File:circuitwirer.gif]]To wire something, you first need a special 'wiring' tool. You will also need a custom machine item, which resembles a cube, and some special circuits. All of this can be printed in R&D, and in the future can be found in tech storage.
+
Components are created from a circuit printer. Many, however, are unavailable by default, and need an upgrade disk installed in order to print them. You can recycle components back into the printer by hitting the printer with that component. Additionally, if you have an assembly full of components, you can quickly recycle all of them by hitting the printer with the assembly as long as the assembly's maintenance panel is open. After a short delay, this will start shaking out all the components into the printer, and once they're all gone, you can also recycle the assembly itself for a full metal refund.
  
You may also need a screwdriver to open and close machines.
+
To communicate with the rest of the machine, components use '''pins.''' Pins are connected to other pins using a circuit wirer, either in the same component or in another component in the same machine, and are used to pass information through activation pulses. In short, they're the guts of your machines.
  
First, use a screwdriver on the machine to open it, if it is not opened already, then start sliding some circuits inside. You'll hear it slide into place if there's enough room and it's not too complex. After that, examine or hit the cube with the wiring tool, then select a circuit to look at. After that, click on a pin, then on another pin, on the same or a different circuit, and they'll link together. Remember that activation pins don't carry data, and so can't be linked to input/output pins.
+
There are three types of pins:
  
To unwire, just use the wire tool in your hand to change it to unwire mode, then click two pins to unwire them.
+
[[File:Pins.png]]
Data
 
  
Pins can hold three types of data, which are strings (text), numbers (both integers and floating-point, because BYOND), and object references (called Refs). If there is no data in a pin, it displays 'null'.
+
<span style='color:#005500'>'''Inputs'''</span> store info on how the component operates. This might be how many reagents to inject, or how much power to transfer.
  
Some circuits mandate that input data be a specific type of data. For example, a circuit wanting X and Y coordinates will require that those inputs be numbers. If it's given text, it will do nothing, and therefore won't work. Sometimes numbers can be converted to text, and text to numbers, with specialized circuits. For example, the number 5 can become the string “5”.
+
<span style='color:#000099'>'''Outputs'''</span> store info gained when the component does an operation, and are used as inputs in other components.
  
On the wiring interface, you can tell what type a piece of data is by looking at how it is presented, between two brackets. Strings are always wrapped in quotes, as in many programming languages, where are numbers are not, and are (obviously) only numbers. References have a [Ref] at the end of the name for the referenced object, and no quotes. Refs are somewhat more rarely used, but are powerful.
+
<span style='color:#FF0000'>'''Activators'''</span> tell the component to do certain things, like calculate how two values compare.
  
Numbers can be converted to strings easily with a number to text circuit. String can become numbers with a text to number circuit, so long as the string has only numbers inside of it (e.g. “28”. “Five” won't work). Refs can be converted one way to text, which will give you the name of the referenced object, using a ref to text circuit.
+
A circuit wirer is used to link pins together. By clicking on the name of a pin, you store that pin's data, and you can click on another pin to link those two pins, which will cause them to share values. You can also use the circuit wirer in your hand to switch between "wire" and "unwire" modes; in unwire, it works in reverse, by unlinking two pins that are already linked.
  
Valid types for pin data;
+
How different pins can be linked depends on the data type they use. There are several data types: String, Number, Ref, List, Bool, and null.
  
 
     “This is a string.”
 
     “This is a string.”
Line 52: Line 61:
 
     the crowbar [Ref]
 
     the crowbar [Ref]
 
     list[2](("hydroponics tray"),("soil"))
 
     list[2](("hydroponics tray"),("soil"))
 +
    TRUE
 
     null
 
     null
  
 +
* Strings are text. They hold words, sentences, and the whole shebang. Numbers in a string are treated like letters.
 +
* Numbers are numbers.
 +
* Ref is shorthand for "reference" and points to a specific object in the game world.
 +
* Lists can hold multiple data values of any other kind, like two strings or two numbers. They can also be interchanged, so you can have one string and one number.
 +
* Bools are either TRUE (yes) or FALSE (no). The debugger doesn't have a bool function, and instead uses number assignments; 0 for FALSE, and 1 for TRUE.
 +
* Null values point to nothing. It means that the value hasn't been set, or that it isn't being acquired correctly.
 +
 +
You can see data values, among other things, near a pin's name:
  
==Terms==
+
[[File:Pin_notation.png]]
Circuits work with two kinds of signals.
 
*Pulses: used to coordinate the device and tell circuits to act.
 
*Data: a value that the circuits store act, with, modify, and transmit as outputs.
 
**Strings are plain text values.
 
**Numbers are a numerical value that can have math done on it.
 
***Booleans are a special Number expecting any number >=1(True) or 0(False)
 
**Refs are references to specific objects in the world.
 
**Lists are lists of strings, numbers, or objects.
 
  
==Flow Control==
+
Some parts lack inputs, outputs, activators, or all three. Passive components like the tiny photovoltaic cell have no pins at all and will simply fill their function automatically when conditions are met.
  
Flow Control is a term used generally for programming languages for determining in what order does code get executed. The same principal applies for custom machines, using activator pins. The proper management of how a pulse goes to each component in the correct order will be very important for complicated or big machines.
+
== Fundamentals, Part III: Pulses ==
 +
 
 +
As mentioned earlier, '''pulses''' are what tells a machine to operate. They're the only way to make it ''do'' anything, because even with data values, it can't use them unless it hears something telling it to. There are two types of pulses, PULSE_IN and PULSE_OUT.
 +
 
 +
PULSE_IN pulses are "listeners." When they receive a command, they will run whatever function they're linked to. For instance, the "light" component has a PULSE_IN called "toggle light." When that toggle light receives a command, it will toggle the light component on or off. ''However,'' PULSE_IN components '''can''' link to other PULSE_IN components and work together with them. The "button" component uses a PULSE_IN called "on pressed" to communicate its pulses.
 +
 
 +
PULSE_OUT pulses are "speakers." They do not receive commands directly, but will ''output'' commands when certain actions transpire. For instance, the "reagent pump" component has a PULSE_OUT called "on transfer." Whenever the reagent pump successfully transfers reagents, it will send a command from "on transfer", and any PULSE_INs linked to that will receive a command. PULSE_OUT pins ''cannot'' be linked to other PULSE_OUT pins.
 +
 
 +
Understanding pulse links is essential to making circuits work. As an example, the button component's "on pressed" can be linked to the light component's "toggle light" using a circuit wirer. As long as the assembly has power, this will cause the light to toggle on and off when the button is pressed by using the assembly in your hand. You can also link multiple pulses together; even when it's linked to "toggle light", you can also put that "on pressed" onto a beeper circuit's "play sound" to make it play its sound with the value it's been assigned. This will make pressing the button toggle the light ''and'' play a sound.
 +
 
 +
=== A Note on "push ref" ===
 +
 
 +
Some circuits, especially those with an output pin that references itself, have a PULSE_IN pin called "push ref." When pulsed, this pin will cause any other components this part is linked to via that reference to actually obtain the reference for it. However, if you ''don't'' do this, then it will refer to the self-reference of the component as null, thus making it impossible to work. For this reason, "push ref" should be pulsed '''''exactly once''''' in order to synchronize it with other components.
 +
 
 +
The easiest way to do this is with a "starter" component, in the Power - Passive section. This component will pulse out a single time whenever the machine gains power. Linking the starter's "pulse out" to any "push ref" pins in your circuit is essential to getting them to work. You can also assign them in other ways, but note that pulsing "push ref" while the machine is running ''will'' cause it to malfunction and not work with no clear indicator.
 +
 
 +
== Fundamentals, Part IV: Flow Control ==
 +
 
 +
Flow control is a term used generally for programming languages for determining in what order code is executed. This principle also applies to integrated circuits. The proper management of how a pulse goes to each component in the correct order is very important for large or complex machines.
 +
 
 +
Fortunately, there are some components to help with organizing your flow control. For example, there are pulse splitters to allow for cleaner wiring by transforming a single input into multiple outputs. Delay timers also exist so that you can make sure everything goes off at the right time (although it's best if your machine is not dependent on that, which is known as a race condition in programming.) Many circuits will also propagate a pulse if it passes a certain condition, like logic gates, ensuring that something will occur only if you want it to.
 +
 
 +
Here's a somewhat terrifying chart illustrating the concept:
  
Fortunately, there are some components to help with organizing your flow control. For example, there are pulse splitters to allow for cleaner wiring. Delay timers also exist so that you can make sure everything goes off at the right time (although it's best if your machine is not dependent on that, which is known as a race condition in programming). Many circuits will also propagate a pulse if it passes a certain condition, for example many logic gates, ensuring that something will occur only if you want it to.
 
 
[[File:Circuit relationship.png]]
 
[[File:Circuit relationship.png]]
  
[[Category:Guides]]
+
When the button is pressed, the first thing to happen is for the global positioning system to gather its coordinates. Immediately after this, the X screen loads its data, and then the Y screen. These screens have the X-coordinate and Y-coordinate from the GPS respectively as their displayed data. Because the GPS gathers coordinates before the screens load their data, it displays the coordinates without a hitch, but if the screens were to load first, then it would not display the coordinates correctly, instead displaying the coordinates ''last'' recorded - so if you pressed it at one spot and then moved a few rooms away and pressed it again, the coordinates displayed would be for the first spot, even though the GPS's recorded data is in the new room, because the screens updated before the coordinates did!
 +
 
 +
== Making a Basic Circuit: Step-by-Step ==
 +
 
 +
To put all this knowledge together, here's a step-by-step guide to making a very simple circuit flashlight. This will use a button to toggle the light on and off, and we'll also put a tiny photovoltaic cell inside of it so that it charges itself from being in the light - enough to counter its own power draw, making it self-charging!
 +
 
 +
First, print any assembly - we'll use a type-a one for this purpose - a light component (Output), a button component (Input), and a tiny photovoltaic cell (Power - Passive).
 +
 
 +
[[File:Circuit_stepbystep_1.png]]
 +
 
 +
Once you have all of your parts ready, insert them into the assembly one at a time by attacking the assembly with them. You should also put in a variety of power cell; the roundstart ones work, or you can make one from the autolathe. For this purpose, we'll use a light fixture battery from the autolathe, due to its extremely cheap cost and compact size. Once you've done that, your assembly interface will look like this:
 +
 
 +
[[File:Circuit_stepbystep_2.png]]
 +
 
 +
Take note of the space and complexity. To get this thing to actually, work, we're going to need to link the button's "on pressed" to the light's "toggle light" using our circuit wirer. Click on the button's name, then put the circuit wirer in your hand and click on "on pressed" to store it in the data buffer. Then click "Return to Assembly", navigate to the light, and click "toggle light", also with the ciruit wirer, to link them.
 +
 
 +
[[File:Circuit_stepbystep_3.png]]
 +
 
 +
[[File:Circuit_stepbystep_4.png]]
 +
 
 +
[[File:Circuit_stepbystep_5.png]]
 +
 
 +
And voila! The two are linked. You can see this on both of their interfaces:
 +
 
 +
[[File:Circuit_stepbystep_6.png]] [[File:Circuit_stepbystep_7.png]]
 +
 
 +
Now that our machine is finished, use your screwdriver to close the maintenance panel so the part list doesn't come up every time we turn it on or off:
 +
 
 +
[[File:Circuit_stepbystep_8.png]]
 +
 
 +
We now have a complete circuit that functions as a flashlight and charges itself in the light to ensure that it won't run out of power. To test it, head to a dark area - we'll say maintenance, and try turning it on and off.
 +
 
 +
[[File:Circuit_stepbystep_9.png]] [[File:Circuit_stepbystep_10.png]]
 +
 
 +
''"Let there be light"''
 +
 
 +
And there you go! You now have a fully functional flashlight. But don't stop there - experiment! With a little bit of experimentation by using an advanced light, a debugger to manually set its brightness and color, and linking in the same way, you can make something closer to a portable floodlight with a little bit more effort. And this all barely scratches the surface of what circuits are capable of - it's possible to make portable gun chargers, assemblies that grind up food you hit them with and then inject it into you directly, translators that let people communicate even with no known languages, and a nearly limitless amount of other gadgets, tools, and devices to fill any purpose you can imagine.
 +
 
 +
Welcome to integrated circuits, bucko.
 +
 
 +
[[File:Circuit_stepbystep_11.png|500px]] [[File:Circuit_stepbystep_12.png|500px]]
 +
 
 +
''"Nightmaresbane"''
 +
 
 +
== Common Concepts and Important Notes==
 +
 
 +
Although the basics are out of the way, there are some helpful concepts as well as some things to know that should be kept in mind when making integrated circuits. Feel free to add to this list with your own!
 +
 
 +
* Tiny photovoltaic cells are enough to power most simple gadgets and devices indefinitely.
 +
* Starter components are highly important, and can be used to cause things like screens to gain their information when powered if they should always have that information to begin with.
 +
* You can make a one-second ticker by linking two "one-sec delay circuit" components together, and pulsing one through starter, so that they indefinitely pulse each other.
 +
* Light-emitting diodes have a very small complexity cost (0.1), making them the best way to track status of Bool variables on examining.
 +
* Small screens only show their data on examine. Screens show their data to the person holding the assembly when they load their data. Large screens show that data to anyone nearby, as well. They all have the same complexity, so use them according to your needs. For instance, something that gathers data when you point the assembly at something might be best to have a normal screen to tell you that data immediately.
 +
* There is the potential for skilled players to make immensely-powerful circuits that can easily break the game just by existing. Please don't use them. We like circuits. They're fun. Please don't get them nerfed and removed. Please?

Revision as of 17:03, 17 February 2018

Science is now capable of building customizable machines, called integrated circuits, to fill any kind of niche imaginable, like a health monitor, a smart turret, a signaller, or maybe just something like a syringe - or something else entirely. Circuits are very complex, though, and take time to learn and work with, so here's a few primers to getting started.

Disclaimer: Simple circuits and even a lot of complex ones are doable just with knowledge about circuits. However, complex circuits can and often do require math knowledge. There are components that use trigonometry, complex flow control components that can operate differently based on conditions, and component combinations to use tons of arithmetic to get the desired result. Be ready!

Preface: Tools

To make any circuit, you'll need a few special tools. These all spawn in the circuit lab at roundstart, and more can be made with a protolathe once they're unlocked through R&D.

  • Circuitprinter.gif Integrated Circuit Printer: Your essential tool for creating circuits. It consumes metal to print out assemblies and components, and can recycle those components and assemblies back into itself for metal.
  • Circuitwirer.gif Circuit Wirer: Used to link parts together (as well as unlink them) too tell the machine how to function.
  • Circuitdebugger.gif Circuit Debugger: Used to change values directly, as well as to directly "pulse" inputs to activate them.
  • Circuitanalyzer.gif Circuit Analyzer: Can be used on any assembly to get a code that allows you to clone that circuit in a printer with the cloning upgarde.
  • File:Multitool.png Multitool: A slimmed-down version of the debugger. It can write true/false values, and pulse inputs.
  • Screwdriver tool.png Screwdriver: Lets you open and close the maintenance panel on assemblies. You should probably do this unless you want people to starts yanking pieces out and undoing tons of work.

This guide will assume you have all of these tools handy (except maybe the multitool.) Keep in mind that you can also print out wirers, debuggers, and analyzers from any circuit printer with metal.

Circuits are inherently complex. Really complex. Each part in a machine serves a specific purpose and communicates with other parts in various ways to do it, and circuits are designed in such a way that making a machine is also a matter of finding the most efficient way to do that so as to conserve space in the assembly. Here's a basic rundown of how it all works:

Fundamentals, Part I: Hardware, Space, and Complexity

Assemblies are what house machine components. Without an assembly, there is no machine. Every assembly also requires a power cell in order to power its components. The circuitry lab spawns with four by default, but more can be made from an autolathe (which is handily also inside the circuitry lab!) Other than power, there are two variables every assembly has:

  • Space is the total amount of components that can fit in an assembly
  • Complexity is the overall "complexity" score of the machine, which varies based on which components are added

Each component you insert takes up one point of space; there are no exceptions or deviations from this. However, every component also has a complexity score, depending largely on what it does. For instance, screens are very basic since they only serve one purpose - to display information - and so they only have a complexity score of 1, but integrated hypo-injectors inject, draw, and move reagents around. Because those are complex and serve many more functions, it has a complexity score of 20.

Making your circuits effectively is a matter of making the most use out of the complexity available to you, though space is very rarely a concern. The amount of complexity and space depends on the type of assembly, of which there are four:

  • Smallcircuits.png Assemblies are small-sized, and have a max space of 25 and max complexity of 75
  • Mediumcircuits.png Mechanisms are normal-sized, and have a max space of 50 and max complexity of 150
  • Largecircuits.png Machines are bulky-sized, and have a max space of 100 and max complexity of 300
  • Dronecircuits.png Drones are bulky-sized, and have a max space of 75 and max complexity of 225, but are the only assemblies that can move autonomously

Very simple designs, like flashlights or translators, can typically fit into assemblies. More complex ones, like blood draw kits, are usually mechanisms, and the most powerful designs are only capable of fitting into machines. Drones are more niche, but open up a huge amount of possibilities due to their ability to move.

Assemblies have different "types", such as type-a, type-b, and so on. The only difference between these is cosmetic, and they all have the same attributes regardless of which "type" you choose you use.

Fundamentals, Part II: Components, Pins, and Data Values

Components, or circuits (yes, it's confusing) are the parts of a machine that make it tick. They handle everything the machine does, from storing reagents to passive recharging to holding and throwing items. As mentioned in Part I, each component has a complexity value, which you can see by examining that component.

Components are created from a circuit printer. Many, however, are unavailable by default, and need an upgrade disk installed in order to print them. You can recycle components back into the printer by hitting the printer with that component. Additionally, if you have an assembly full of components, you can quickly recycle all of them by hitting the printer with the assembly as long as the assembly's maintenance panel is open. After a short delay, this will start shaking out all the components into the printer, and once they're all gone, you can also recycle the assembly itself for a full metal refund.

To communicate with the rest of the machine, components use pins. Pins are connected to other pins using a circuit wirer, either in the same component or in another component in the same machine, and are used to pass information through activation pulses. In short, they're the guts of your machines.

There are three types of pins:

Pins.png

Inputs store info on how the component operates. This might be how many reagents to inject, or how much power to transfer.

Outputs store info gained when the component does an operation, and are used as inputs in other components.

Activators tell the component to do certain things, like calculate how two values compare.

A circuit wirer is used to link pins together. By clicking on the name of a pin, you store that pin's data, and you can click on another pin to link those two pins, which will cause them to share values. You can also use the circuit wirer in your hand to switch between "wire" and "unwire" modes; in unwire, it works in reverse, by unlinking two pins that are already linked.

How different pins can be linked depends on the data type they use. There are several data types: String, Number, Ref, List, Bool, and null.

   “This is a string.”
   98.5
   the crowbar [Ref]
   list[2](("hydroponics tray"),("soil"))
   TRUE
   null
  • Strings are text. They hold words, sentences, and the whole shebang. Numbers in a string are treated like letters.
  • Numbers are numbers.
  • Ref is shorthand for "reference" and points to a specific object in the game world.
  • Lists can hold multiple data values of any other kind, like two strings or two numbers. They can also be interchanged, so you can have one string and one number.
  • Bools are either TRUE (yes) or FALSE (no). The debugger doesn't have a bool function, and instead uses number assignments; 0 for FALSE, and 1 for TRUE.
  • Null values point to nothing. It means that the value hasn't been set, or that it isn't being acquired correctly.

You can see data values, among other things, near a pin's name:

Pin notation.png

Some parts lack inputs, outputs, activators, or all three. Passive components like the tiny photovoltaic cell have no pins at all and will simply fill their function automatically when conditions are met.

Fundamentals, Part III: Pulses

As mentioned earlier, pulses are what tells a machine to operate. They're the only way to make it do anything, because even with data values, it can't use them unless it hears something telling it to. There are two types of pulses, PULSE_IN and PULSE_OUT.

PULSE_IN pulses are "listeners." When they receive a command, they will run whatever function they're linked to. For instance, the "light" component has a PULSE_IN called "toggle light." When that toggle light receives a command, it will toggle the light component on or off. However, PULSE_IN components can link to other PULSE_IN components and work together with them. The "button" component uses a PULSE_IN called "on pressed" to communicate its pulses.

PULSE_OUT pulses are "speakers." They do not receive commands directly, but will output commands when certain actions transpire. For instance, the "reagent pump" component has a PULSE_OUT called "on transfer." Whenever the reagent pump successfully transfers reagents, it will send a command from "on transfer", and any PULSE_INs linked to that will receive a command. PULSE_OUT pins cannot be linked to other PULSE_OUT pins.

Understanding pulse links is essential to making circuits work. As an example, the button component's "on pressed" can be linked to the light component's "toggle light" using a circuit wirer. As long as the assembly has power, this will cause the light to toggle on and off when the button is pressed by using the assembly in your hand. You can also link multiple pulses together; even when it's linked to "toggle light", you can also put that "on pressed" onto a beeper circuit's "play sound" to make it play its sound with the value it's been assigned. This will make pressing the button toggle the light and play a sound.

A Note on "push ref"

Some circuits, especially those with an output pin that references itself, have a PULSE_IN pin called "push ref." When pulsed, this pin will cause any other components this part is linked to via that reference to actually obtain the reference for it. However, if you don't do this, then it will refer to the self-reference of the component as null, thus making it impossible to work. For this reason, "push ref" should be pulsed exactly once in order to synchronize it with other components.

The easiest way to do this is with a "starter" component, in the Power - Passive section. This component will pulse out a single time whenever the machine gains power. Linking the starter's "pulse out" to any "push ref" pins in your circuit is essential to getting them to work. You can also assign them in other ways, but note that pulsing "push ref" while the machine is running will cause it to malfunction and not work with no clear indicator.

Fundamentals, Part IV: Flow Control

Flow control is a term used generally for programming languages for determining in what order code is executed. This principle also applies to integrated circuits. The proper management of how a pulse goes to each component in the correct order is very important for large or complex machines.

Fortunately, there are some components to help with organizing your flow control. For example, there are pulse splitters to allow for cleaner wiring by transforming a single input into multiple outputs. Delay timers also exist so that you can make sure everything goes off at the right time (although it's best if your machine is not dependent on that, which is known as a race condition in programming.) Many circuits will also propagate a pulse if it passes a certain condition, like logic gates, ensuring that something will occur only if you want it to.

Here's a somewhat terrifying chart illustrating the concept:

Circuit relationship.png

When the button is pressed, the first thing to happen is for the global positioning system to gather its coordinates. Immediately after this, the X screen loads its data, and then the Y screen. These screens have the X-coordinate and Y-coordinate from the GPS respectively as their displayed data. Because the GPS gathers coordinates before the screens load their data, it displays the coordinates without a hitch, but if the screens were to load first, then it would not display the coordinates correctly, instead displaying the coordinates last recorded - so if you pressed it at one spot and then moved a few rooms away and pressed it again, the coordinates displayed would be for the first spot, even though the GPS's recorded data is in the new room, because the screens updated before the coordinates did!

Making a Basic Circuit: Step-by-Step

To put all this knowledge together, here's a step-by-step guide to making a very simple circuit flashlight. This will use a button to toggle the light on and off, and we'll also put a tiny photovoltaic cell inside of it so that it charges itself from being in the light - enough to counter its own power draw, making it self-charging!

First, print any assembly - we'll use a type-a one for this purpose - a light component (Output), a button component (Input), and a tiny photovoltaic cell (Power - Passive).

Circuit stepbystep 1.png

Once you have all of your parts ready, insert them into the assembly one at a time by attacking the assembly with them. You should also put in a variety of power cell; the roundstart ones work, or you can make one from the autolathe. For this purpose, we'll use a light fixture battery from the autolathe, due to its extremely cheap cost and compact size. Once you've done that, your assembly interface will look like this:

Circuit stepbystep 2.png

Take note of the space and complexity. To get this thing to actually, work, we're going to need to link the button's "on pressed" to the light's "toggle light" using our circuit wirer. Click on the button's name, then put the circuit wirer in your hand and click on "on pressed" to store it in the data buffer. Then click "Return to Assembly", navigate to the light, and click "toggle light", also with the ciruit wirer, to link them.

Circuit stepbystep 3.png

Circuit stepbystep 4.png

Circuit stepbystep 5.png

And voila! The two are linked. You can see this on both of their interfaces:

Circuit stepbystep 6.png Circuit stepbystep 7.png

Now that our machine is finished, use your screwdriver to close the maintenance panel so the part list doesn't come up every time we turn it on or off:

Circuit stepbystep 8.png

We now have a complete circuit that functions as a flashlight and charges itself in the light to ensure that it won't run out of power. To test it, head to a dark area - we'll say maintenance, and try turning it on and off.

Circuit stepbystep 9.png Circuit stepbystep 10.png

"Let there be light"

And there you go! You now have a fully functional flashlight. But don't stop there - experiment! With a little bit of experimentation by using an advanced light, a debugger to manually set its brightness and color, and linking in the same way, you can make something closer to a portable floodlight with a little bit more effort. And this all barely scratches the surface of what circuits are capable of - it's possible to make portable gun chargers, assemblies that grind up food you hit them with and then inject it into you directly, translators that let people communicate even with no known languages, and a nearly limitless amount of other gadgets, tools, and devices to fill any purpose you can imagine.

Welcome to integrated circuits, bucko.

Circuit stepbystep 11.png Circuit stepbystep 12.png

"Nightmaresbane"

Common Concepts and Important Notes

Although the basics are out of the way, there are some helpful concepts as well as some things to know that should be kept in mind when making integrated circuits. Feel free to add to this list with your own!

  • Tiny photovoltaic cells are enough to power most simple gadgets and devices indefinitely.
  • Starter components are highly important, and can be used to cause things like screens to gain their information when powered if they should always have that information to begin with.
  • You can make a one-second ticker by linking two "one-sec delay circuit" components together, and pulsing one through starter, so that they indefinitely pulse each other.
  • Light-emitting diodes have a very small complexity cost (0.1), making them the best way to track status of Bool variables on examining.
  • Small screens only show their data on examine. Screens show their data to the person holding the assembly when they load their data. Large screens show that data to anyone nearby, as well. They all have the same complexity, so use them according to your needs. For instance, something that gathers data when you point the assembly at something might be best to have a normal screen to tell you that data immediately.
  • There is the potential for skilled players to make immensely-powerful circuits that can easily break the game just by existing. Please don't use them. We like circuits. They're fun. Please don't get them nerfed and removed. Please?