Change background image
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Integrated Circuits: Solutions to Common Problems

Discussion in 'Tutorials & Information' started by Cheb Pomidorov, Feb 13, 2020.

  1. Cheb Pomidorov

    Cheb Pomidorov Petty Officer First Class

    Hello nerds. Welcome to yet another guide on integrated circuitry, a subject so unimportant in the grand scheme of Baystation12, yet so large it could not be thoroughly explained in a single guide. The previous guide in question is
    Over the time, it accumulated a rather large bloat of information, so I found it necessary to create yet another, with a distinct purpose. This one will focus on common problems a circuiteer faces, and how to solve them in the most efficient way possible. This one's intended for medium level/advanced users who know what this is all about.
    Reach me in-game (ENS Aria Guinness) or on Discord (Soapenhauer) for guidance.


    I use <br> in my strings in order to go to the next line, and it works fine, but when I use other HTML tags like <b></b> it doesn't work.
    Solution: Stop trying, because only <br> is supported.

    Problem: My signaller/integrated signaller was working fine, but after cloning the assembly, it no longer transmits.
    Solution: It's a game code-level bug. Simply overwrite the frequency variable (even with the same value) on both signallers, and it should work again.

    Problem: I want to access all elements of a list, or all characters of a string, or to repeat an operation a set amount of time. What do I do?
    Solution: Use the iterator construct (reset constant-arithmetic operation-logic check-delay). More on this subject in the other guide, section EXTRA.

    Problem: I want the data of a certain input wire to cycle through several values at the push of a button. What's the best way?
    Solution: Use a cycler construct (addition-modulo) with a multiplexer. More on the cycler in the guide, section EXTRA.

    Problem: The reagent circuits don't seem to work at all.
    Solution: Remember to push the correct <REF>s to the correct circuits, and read the instructions of each circuit carefully to prevent misuse.


    I need to send a list of values to another device via advanced signaller. The signaller only accepts a string as its command value.
    Solution: Use the join-text circuit to encode the entire list into a string. Use an uncommon character such as | to prevent complications when decoding.
    To decode the string back into a list, use the string exploder circuit.

    Problem: I want to toggle something's state by a method other than the toggle button, and then keep track of that state.
    Solution: Use a toggle-check construct (JK Latch-SR Latch). More in the other guide.

    Problem: I use a button on my remote to toggle the camera of my remote-controlled drone, but after a few toggles I'm no longer sure whether the camera is on or off.
    Solution: Every time your button is supposed to toggle a binary state, use a toggle button. Even if you're not going to use the extra data wire the toggle button provides, it does make it easier to discern the actual state, because of the added UI feedback.

    Problem: I have [insert exorbitant amount here] advanced integrated signallers and it's really cutting into my complexity score.
    Solution: You only need 1 advanced signaller on the condition that you never send 2 signals at once. Simply push the correct ID/frequency values before you signal.
    If you need to receive the signals, however, you do need one signaller for each signal to receive, unless you're going to use one signaller to manipulate another into receiving the correct signal.


    I want to write a value to a given index in a string. Lists have a "write circuit" for that purpose, but strings have no equivalents! Cheb, help!
    Solution: If your string lacks an easy-to-manipulate format you can exploit with the string exploder, this becomes a convoluted, expensive, multi-step process.
    1. Get the index of the character you want to write to.
    2. Use the "separator" circuit with the index value. This will be your "right side."
    3. Decrement the index by 1.
    4. Use the "separator" again with the decremented value. This will be your "left side."
    5. Glue everything back together using a small concatenator, writing the desired character (or string, if you fancy) between the left and the right side.

    Problem: The delays are too much! 10 seconds to fire an AEG? Is there a way to reduce delays?
    Solution: You'll need to use several instances of the circuit you want to reduce the delay of. The most efficient way to go about this is dictated by how many instances you want to use:
    • 2 or 4: use a sequence of JK Latches. If you're using N circuits, you need N-1 Latches, which is why this solution becomes expensive for 8 or more circuits. Mind that the outputs are not ordered in the order of appearance.
    Example of why using 7 latches for 8 circuits is a bad idea (apart from essentially using 15 components :eek:):
    • For 3 or 5+ instances of the target circuit, use a cycler construct with a pulse-demultiplexer.
    If N is the number of circuits, and D is the delay of a single circuit, the delay will be effectively reduced to D/N. There exist no deterministic ways of reducing it to below 0.1 seconds.

    Problem: I need to implement some memory registers my program can read from, and write to.
    Solution: Demultiplexer for writing, multiplexer for reading. Something will control the actual numerical value of the slot to write to/read from. Your data transfer circuits should ideally be the same size as the memory circuit chosen.

    Problem: 16 is too limiting, I want more slots for memory storage! I want ALL the slots!
    Solution: You can stack data transfer circuits sequentially. Let's make an example using 32 slots. We'll call K the desired slot number to write to.
    1. Do (K-1)/16
    2. Round the result to either 0 or 1 using a round circuit.
    3. Increment the result by 1.
    4. Plug this number into a 2-demux and a 2-pulse-demux. The former selects which data transfer unit to send data to, the latter selects which will be pulsed.
    5. Do ((K-1) modulo 16) + 1
    6. Plug this value into your data transfer unit: it's the slot number, from 1 to 16.


    Circuits are hard. Good circuits are hard to make. I hope these tips will make it an easier process. It might be obvious, but I'll say it anyway: I love circuits, and I want to spread the magic to others.
    If you have any other problems you're facing, and would like them solved, do write them in the comments.
    Special thanks to: Lushsalmon123, Syncron, Zenith, RustingWithYou, Mister Fox and other members of the circuit gang. You make it worth spending my time on.
    Last edited: Feb 25, 2020
  2. Smellfungus

    Smellfungus Assistant

    Wow, nice guide! Regarding D-latches, a common use for them with me is implementing one time actions. ID reader pulses a D latch which has its' inputs set to one, and inputs one and two wired respectively to outputs one and two. First pulse in pulses out Q, subsequent pulses are !Q. In the example, the first pulse on the latch locks the circuit for use by the owner and starts a cycle that will wipe if it ends up in the wrong hands, for instance, and further swipes add the scanned hash of whatever ID to a list without updating the owner.

    edit: Eh, this was meant to be a reply to your other guide... Whoops. :(
    Last edited: Jul 22, 2020
  3. Cheb Pomidorov

    Cheb Pomidorov Petty Officer First Class

    Oh, that's useful. I've always been making one-time things with at least 2 latches, so having a double-efficiency solution is a big deal.

    Could you clarify this? Just an "active wait" sort of deal?
  4. Smellfungus

    Smellfungus Assistant

    Ah, right, sorry, I think I was half asleep when I wrote this (hence all the mistakes, I fixed what I could at the time...). IIRC, the setup I envisioned was a local locator, a reference to string, an equal gate, and a delay circuit. As the ID card reader outputs the name on the card, not a reference to the holder, the local locator + converter is necessary. Setting the delay to five seconds or so should ensure a wipe before it could be put to use without impacting server performance, especially for such a simple circuit. However, this could be upgraded with a D latch alongside an equals gate to ensure it only return false if it is in somebody else's possession by wiring the "is creature" pin to the second input of the D latch and the equals gate to the first input. Thus, depending on how storage in bags and pockets is handled by the local locator, putting the assembly down for a time wouldn't cause it to panic wipe. In the event of Q, run the delay circuit. When !Q, pulse a null constant wired to the passkey then update the access circuit. The delay loop should, of course, be wired to the card reader to avoid overhead and remove the need for a starter.

    Using proximity sensors attached to signalers could work well for stationary circuits in theory, though I've not tested picking them up with a grabber and seeing how those interact. It could be fun for an automated patrol drone, if it works, or a stationary console that bolts/unbolts nearby airlocks depending on who is standing nearby. Alternatively, you could use laser attached signalers, but I have no idea how those interact just yet.