Starmade Logic Tutorials

    Bench

    Creative Director
    Joined
    Jun 24, 2013
    Messages
    1,046
    Reaction score
    1,745
    • Schine
    • Wired for Logic
    • Legacy Citizen 6
    True



    False :p

    Without copy+paste, you can't make something like:
    "Start Date" = [start date]
    ""End Date" = [end date]
    "Time Left" = [time left]
    Need to add subtract logic anyway...

    Or if I want a shop sign like:
    Code:
    ###########################################
    # BBBB     A    SSS SSS SSS SSS   CC  RRR #
    # BBBB AAAAAAA  SSS SSS SSS SSS  C    RR  #
    # BBBB     A    SSS SSS SSS SSS   CC  R R #
    ###########################################
    B = Block of the day
    A = Arrow
    S = Diplay-Sign
    CR = short for credits as big hull-letters.

    Now I need 4* 0..9 and it would be a lot smaller circuit if it is stored in bits as one number.
    that's true, if i were to upgrade a v4 i'd include some bit-output support so you could do bit math. I haven't studied electronics in a long time though so i'd need to refresh myself on the theory before attempting. That's a bit advanced for most gamers too, so at least v3 if they follow the videos they can build what they want to build.
     

    Criss

    Social Media Director
    Joined
    Jun 25, 2013
    Messages
    2,187
    Reaction score
    1,772
    • Master Builder Bronze
    • Video Genius
    • Competition Winner - Stations
    @Bench What code did you use to make the table of contents functional? I should probably know but I'm too lazy to figure it out.
     

    Bench

    Creative Director
    Joined
    Jun 24, 2013
    Messages
    1,046
    Reaction score
    1,745
    • Schine
    • Wired for Logic
    • Legacy Citizen 6
    @Bench What code did you use to make the table of contents functional? I should probably know but I'm too lazy to figure it out.
    I use post permalinks to do it. You can get the permalink to a post by clicking the number next to the quote and reply buttons.
     
    Joined
    Sep 30, 2013
    Messages
    23
    Reaction score
    6
    so in testing of logic ive been seeing that you can link logic to shield rechargers/capacitors , power reactors/storage, and thrusters. but i cant figure out what this does as of yet, nothing seems to change. any ideas?
    what im working on is a modular mobile base. and what i want to do is link the shields of all the different parts together via shield transfer beams. i just need a way to detect if the module is taking damage so it can stop sending shields and start receiving/collecting shields form surrounding modules. otherwise the ships drain/ receive will equal out and might be worse for the module.
     
    Joined
    Jun 19, 2014
    Messages
    1,756
    Reaction score
    162
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen
    It is hard to test the shield modules without shields. I was tweeking the blockbehavior config and that was the firstband only thing I noticed, because I was too lazy to get some shield modules.
     
    Joined
    Jul 29, 2013
    Messages
    1,173
    Reaction score
    494
    • Competition Winner - Small Fleets
    • Top Forum Contributor
    • Legacy Citizen 5
    Being able to wrap your mind around this kind of thing... must be nice...

    One problem I'm working on now that you might want to potentially tackle, Bench, is a toggle up/down device.

    Really what I want is a number of logic-activate-able outputs where I can increase or decrease the number of activated outputs in sequence.

    Push the up button once, one light comes on, push the up button again, the next light comes on while the first light stays on.
    Push the down button and the second light goes off, while the first light stays lit.

    Hopefully you get the idea, and would be willing to handle this challenge. :)
     

    Bench

    Creative Director
    Joined
    Jun 24, 2013
    Messages
    1,046
    Reaction score
    1,745
    • Schine
    • Wired for Logic
    • Legacy Citizen 6
    Yeah that's pretty doable. The 7-segment-display has that built in as part of it, and has Not + AND setup so that only one is on at a time, but it's essentially how the display works.
     
    Joined
    Jun 28, 2013
    Messages
    97
    Reaction score
    32
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 5
    I have a question about logic.

    If I make an area controlled circuit, the area controller toggles every time I enter the area. Is there a way to keep it active as long as I'm in the area instead? I'm trying to make lights that are on as long as one is near them.
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    1. Surround your trigger area in area triggers.
    2. Surround this area with area triggers linked to another controller.

    controllerA ->
    buttonA <----------------|
    controllerA -> buttonA -> orA <--> buttonA2 XOR button B2 -> Entered area, on
    controllerB -> buttonB -> orB <--> buttonB2 XOR button A2 -> Left area, off
    controllerB -> buttonB <----------------|
    (note that the 2nd buttons connect back to left or and button both = reset, thus they can be triggered again instantly)
     
    Joined
    Jun 28, 2013
    Messages
    97
    Reaction score
    32
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 5
    Dang, my phone decided it'd be a good idea to suddenly turn off while typing this message. Let's try again.

    I'm sorry to say that I can't make any sense of the way you're denoting circuitry. I do however understand the point you are trying to get across.

    Unfortunately, it's unsuitable. If multiple people enter the lights would turn off. If I were to wrap another area layer around to detect direction, they would turn off after one person leaves.

    If I hook up memory, that's solved but I'm not really willing to build an adder per room into my ship for the sole purpose of having automatic lights.

    The reason I don't want a bunch of step-ons in the floor is that it's ugly. It would work, but I'm basically looking for an area controller to replace the step-on...

    An idea comes to mind with a whole bunch of those hooked up to an OR but since they toggle I'm not sure it'd work.
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    If you want to support many players you have to do a ramp or door where they all go in (else too many area triggers)

    2 blocks are sufficient to detect the direction, 3 (A XOR B + B XOR C) should be sufficient to detect another player. The counting circuit will be more complex.

    Use bench's counter (has to have an increment (+1) and decrement (-1) feature).
    But if 2 players walk next to each other instead of after each other, there is no way ...


    You could also set up motion sensors = area triggers in a checker-board style connected to 2 different controllers which refresh a timed shut-down clock.


    Or make a more complex position tracker and counter for each player (will be more like a computer). Nice idea BTW - will try that
    (finally a reason for having computers!
    Request: Computer, detect Lieutenant Hidden-Markov
    Answer: Lieutenant Hidden-Markov is on deck 7 section C room 42​

    But this will fail if he goes to another players position, stops and this player walks away he stole HM's identity)


    You can detect 2 players walking next to each other if the trigger triggers twice instead of once.

    But that would be too big for a tutorial-thread -> http://starmadedock.net/threads/project-motion-tracker-computer.2920/
     
    Last edited:
    • Like
    Reactions: gamesaucer
    Joined
    Jun 28, 2013
    Messages
    97
    Reaction score
    32
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 5
    The motion tracking thing popped into my head as well... I can use that + an RS-nor latch to power my lights. They'd turn off if no movement is detected for a while. The way to build it eluded me, though.

    Thanks!
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    @Bench:
    Maybe you are interested into combining my RAM (with 4 4bit slots per bank) with your password idea.

    Currently many of your blocks are hull :)p) and my RAM's banks are easily extensible.
    Ping subscribers :)
    Edited (added orange and green stuff. Basically everything except the first two quotes).

    Module : RAM

    2x2x2 Flip-Flop

    Rear (where the magic happens)
    O1 N1
    O0 N0​
    Front (where you control the magic)
    W1 R1
    W0 R0​
    O = or
    N = not
    W+R =and
    W = write
    R = read​
    1 = high state
    0 = low state


    Connections: (A --slaves-> B)

    Write-And -> Or ( behind Write-And )
    Not -> Read-And ( in front of Not )
    high Or -> low Not -> low Or
    low Or -> high Not -> high Or​
    2x 9y 9z Bank
    Front
    R | WR | WR | WR | WR
    __|_WR_|_WR_|_WR_|_WR_
    R | WR | WR | WR | WR
    __|_WR_|_WR_|_WR_|_WR_
    R | WR | WR | WR | WR
    __|_WR_|_WR_|_WR_|_WR_
    R | WR | WR | WR | WR
    __|_WR_|_WR_|_WR_|_WR_
    B | OO | OO | OO | OO

    W = Write ANDs (high + low)
    R = Read ANDs (high + low)
    R(left) = Row-Selectors

    Connects to all 16 W|R ANDs in a 2x2x2 Flip-Flop row
    B = Bank-Selector
    O = Compress All 1 and 0 outputs

    from 8 into 4 blocks and
    from 8 rows into 1
    Left = Low R (per 2x2)
    Right = High R (per 2x2)
    Rear
    . | ON | ON | ON | ON
    __|_ON_|_ON_|_ON_|_ON_
    R | ON | ON | ON | ON
    __|_ON_|_ON_|_ON_|_ON_
    W | ON | ON | ON | ON
    __|_ON_|_ON_|_ON_|_ON_
    . | ON | ON | ON | ON
    __|_ON_|_ON_|_ON_|_ON_
    . | .. | .. | .. | ..


    R = connects to all R-ANDs at front
    W = connects to all W-ANDs at front
    O|N = Or|Not (look above into the Flip-Flop section)
    1st Block-Column:
    Write-All (And) -> slaves each Write-And
    Read-All (And) -> slaves each Read-And
    Row-Selector(And) (connected to all Read+Write Ands of a row - both high and low state)
    Controller -> slaves bank 0 -> slaves bank 1, ... (forward only for read, write and row-selector, not the bank-selctor)​
    Bank-Selector(Any) -> slaves each Row-Selector​
    2nd to 9th Block-Column:
    1 Flip-Flop column = 2 blocks​
    top 8 Block-Rows:
    1 Flip-Flop row = 2 blocks​
    bottom 1 Block-Row:
    8 ORs in a line
    left of two ORs connects from all R0 and to all W0
    right of two ORs connects from all R1 and to all W1​
    1x 9y 9z Bank-Controller
    4 bits Data in 4 states - 1 per 2 columns (matching position with Banks):
    Left active = Low State
    Right active = High State​
    4 bits Address as
    2 bits Row selector:
    00 = row 0 at bottom
    01 = row 1
    10 = row 2
    11 = row 3 at top​
    2 bits Bank selector:
    00 = bank 0 (near controller)
    01 = bank 1
    10 = bank 2
    11 = bank 3 (far from controller)​
    Connect Address to Row/Bank-Selectors (= ANDs)
    Address-Bit = Position
    0 = right
    1
    2
    3 = left


    +Bit 0 to row 0 + 2 = a T_T_ pattern
    -Not 0 to row 1 + 3 = a _T_T pattern
    --
    +Bit 1 to row 0 + 1 = a TT__ pattern
    -Not 1 to row 2 + 3 = a __TT pattern


    +Bit 2 to bank 0 + 2 = a T_T_ pattern
    -Not 2 to bank 1 + 3 = a _T_T pattern
    --
    +Bit 3 to bank 0 + 1 = a TT__ pattern
    -Not 3 to bank 2 + 3 = a __TT pattern​


    I decided for a 4 bit, 16 slots RAM, because it is the best to copy+paste
    1. It fits with 3 banks into a 10x9x9 box and more banks are very easy to add
    2. It can even be compressed to a 9^3 with 4 banks = 16 slots.
    3. The new dev has fixed the copy+paste bug (but you still have to connect to everything outside the copy-box)
      1. Which is not hard (Controller data bits -> Bank1 bottom ORs -> Bank 1 bottom ORs ... -> last Bank back to Controller's data bits)

    Also a 16 slot ram with 4 bits can store 1 address to a slot of itself in 1 slot.



    But you can add any amount of memory slots you want by just
    1. adding enough Bank-selector Address-Bits and connect these to the banks
    2. keep the ControllerOR->BankOR->BankOR->ControllerOR loop intact (Controller needs to mirror it's data in each bank's bottom ORs)
    3. forward a change for Read+Write Mode to the banks.
    Need more bits? Just copy+paste the whole (in the new dev it's fixed!) for every 4 bits more you want.



    How to use:
    1. Write should be set to read before changing the address and set to write after an address is set (use rising-edge and falling-edge detectors)
    2. Data should be Read from the interface (of bank-controller) 1/2+ cycles after address got changed.
    3. Write should Write to the interface 1/2+ cycles after write mode got set and 1/2+ cycles before it gets changed back (for reading the next address for example)

    Multiplexers can increase the performance for multiple reads/writes to multiple memory modules, but that is stuff for experienced users and huge ships :)
    Like Address = privilege level. Slot data == password ? Granted! :else trial-counter reduced?

    To make high privileges even more secure, you may require to unlock the previous privilege level first.
     

    Criss

    Social Media Director
    Joined
    Jun 25, 2013
    Messages
    2,187
    Reaction score
    1,772
    • Master Builder Bronze
    • Video Genius
    • Competition Winner - Stations
    Alright bench, time for your wizardry. I need to have a light blink once every five seconds or so. This is just an example. With your current setup for pulses and blinking lights it stays on for a second and off for a second. If I add more delay where you say to, it stays on for a longer time, but stays off for the same amount of time. I need the light to blink once for about a second and stay off for a lot longer. Have any idea how that would be done?
     
    Joined
    Feb 26, 2014
    Messages
    65
    Reaction score
    5
    I made something similar using the pulse switch Bench showed and connecting a clock somewhere ( only gave 1/2 second delay block worth of flash) however starmade is acting up so I cant give you an exact answer
     

    Criss

    Social Media Director
    Joined
    Jun 25, 2013
    Messages
    2,187
    Reaction score
    1,772
    • Master Builder Bronze
    • Video Genius
    • Competition Winner - Stations
    Well I figured it out. My mistake. Turns out I need somewhat ridiculous setup. It includes a t flip flop and a clock.

     
    Joined
    Feb 26, 2014
    Messages
    65
    Reaction score
    5
    Not nearly as good with logic so I went for a simpler and bigger design

    assuming 1 delay equals 1/2 sec

    Pulse:
    Act 1 ------------------------------>Or
    Act 1 -> Not 1-> Delay->Delay->Or-> Act 2 -> Not 2

    Clock:
    Delay 1-> Delay 2->Delay 3->Delay 4 -> Delay 5 -> Delay 1 etc.....
    (1 sec on 5 sec off so will require 12 delays)

    starmade-screenshot-0002.jpg
     
    Last edited: