The logic blocks erroneously mix circuit logic with state machines

    Joined
    Oct 14, 2014
    Messages
    3
    Reaction score
    0
    Currently logic blocks only propagate signals on state change. It would be better to propagate signals regardless of whether or not the next block in the series changes state. Here's why:

    Example 1:

    Use: activates light for 1 second.

    Format: Source(What you press C on) -> Target(What you press V on)

    Activation block -> Light && Delay block(Non-repeating)
    Delay block(Non-repeating) -> NOT-Gate
    NOT-Gate -> Activation block

    Activating the block turns on a light then turns it off after 1 second. But this only happens the first time!
    The second time, the Delay block is already active so when the activation block is activated again there is no state change in the Delay block and no signal is propagated.

    This effect reduces the flexibility of the entire system because logic circuits have no way of resetting themselves without using a Non repeating logic gate which creates an infinite loop. Which is often times not the desired effect.

    Example 2:

    Now consider the same system, except we use a repeating Delay block and try to halt the infinite loop.

    Activation block -> Light && Delay block(Repeating)
    Delay block(Repeating) -> AND-Gate
    Activation block(Always inactive) -> AND-Gate
    AND-Gate -> Activation block


    Here we use an AND gate that will always take the signal from the Delay block and make it false, effectively allowing it to loop infinitely, but have the light remain off after the signal has propagated through the Delay block. However, if you try this you will find that the signal stops at the and block because the state does not change. So this system can't work. This effect if it worked wouldn't be ideal since the signal would propagate around the loop infinitely without any indicator that it is. However this can certainly be detected and halted by simply counting the number of propagation and state changes of a signal in code.

    This is assuming that a signal is an entity, which i doubt it is in the current system. The current system resembles a state machine with circuit logic which is creating odd results. Allow signals to propagate without a state change of the block please. =D
     
    Last edited:
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    Currently logic blocks only propagate signals on state change. It would be better to propagate signals regardless of whether or not the next block in the series changes state. Here's why:

    Example 1:

    Use: activates light for 1 second.

    Format: Source(What you press C on) -> Target(What you press V on)

    Activation block -> Light && Delay block(Non-repeating)
    Delay block(Non-repeating) -> NOT-Gate
    NOT-Gate -> Activation block

    Activating the block turns on a light then turns it off after 1 second. But this only happens the first time!
    The second time, the Delay block is already active so when the activation block is activated again there is no state change in the Delay block and no signal is propagated.

    This effect reduces the flexibility of the entire system because logic circuits have no way of resetting themselves without using a Non repeating logic gate which creates an infinite loop. Which is often times not the desired effect.
    Your circuit has that effect because it is flawed.
    Here is what I suggest:
    • Blocks:
      • Activation
      • And1
      • And2
      • Or1
      • Delay1
      • Not1
      • Light
    • Connections:
      • Activation >> Delay1 , And1 , Or1
      • Delay1 >> And1 , Or1
      • And1 >> Not1
      • Or1 >> And2
      • Not1 >> And2
      • And2 >> Light
     
    Joined
    Aug 23, 2013
    Messages
    379
    Reaction score
    65
    Instead of sending the state every single time (regardless of whether it changed or not); you can improve performance by caching the current state and only sending the state when the state has changed (when the cached state is no longer valid). This has identical behaviour, but it's faster (less "sending the state" involved), and is what the game is doing already.

    Basically, always sending the state would only increase overhead/lag.
     

    Thalanor

    CEO Snataris Colonial Fleetyards
    Joined
    Sep 10, 2013
    Messages
    818
    Reaction score
    708
    • Master Builder Bronze
    • Thinking Positive
    • Legacy Citizen 3
    For certain applications though, it would be neat if logic would also update when an input block is removed.

    Two activation blocks with one of them on connected to an AND, for example. Removing the inactive activation block should update the AND.