Read by Council Instant Delay Logic Block

    What do ye think of the suggestion?

    • Absolutely love it!

      Votes: 1 100.0%
    • It's good

      Votes: 0 0.0%
    • Not bad

      Votes: 0 0.0%
    • Couldn't care if it's in or not

      Votes: 0 0.0%
    • Don't particularly like it

      Votes: 0 0.0%
    • It's bad

      Votes: 0 0.0%
    • Bloody awful!

      Votes: 0 0.0%

    • Total voters
      1

    Blaza612

    The Dog of Dissapointment
    Joined
    Nov 16, 2013
    Messages
    787
    Reaction score
    209
    • Legacy Citizen 4
    On a previous thread, I talked about possibly changing the logic system, so that the logic activates sequentially, rather than all at the same time. Logic Steps, I had called them. However, it got literally no attention, so I'm going to talk about them again, except with something that can be implemented easier than changing the entire system.

    Introducing the Instant Delay Block. This will act as a normal Delay block, however, it's Delay will be restricted to the single logic tick, rather than half a second, making the delay almost un-noticeable by the human eye (hopefully).

    This simple addition will allow for the use of more complicated logic setups, and even reduce lag. One of the biggest problems with making a proper computer or Conway's Game of Life in logic is the sheer number of blocks required, due to the fact that the same RAM or thread cannot be used more than once per tick. If this was to be introduced, then multiple changes and processes can happen almost instantaneously, significantly reducing the number of blocks needed for a variety of logic devices.
     
    Last edited:
    • Like
    Reactions: Miraak
    Joined
    Feb 22, 2015
    Messages
    869
    Reaction score
    179
    • Purchased!
    • Legacy Citizen
    A single logic tick is half of a second.
    Making logic process faster would increase lag, not reduce it.


    And what would be the point of a delay that causes no delay?
     

    Blaza612

    The Dog of Dissapointment
    Joined
    Nov 16, 2013
    Messages
    787
    Reaction score
    209
    • Legacy Citizen 4
    A single logic tick is half of a second.
    wat

    Making logic process faster would increase lag, not reduce it.
    If this is indeed the case (no, I'm not calling you a liar), then, well, fuck. However, I would like someone from higher up to state this, before I consider it fact. I'm still not 100% sure how the logic system works, all I know is that it's "broken", in a sense. If it were to cause lag via it's method, then I'm left questioning it's method of creation. If the game cycles through each logic block and sees which ones need changing via the differences, then that's a terrible method. It fails to be optimized, and is just another way of keeping the bytes/block down to three.

    So far, there have been a number of cases where adding that fourth byte to blocks will ultimately allow more, in terms of mechanics or other optimizations. We can have more blocks and add more variations on to them, allowing more decoration, and we can have a MUCH more efficient way of handling logic.

    The more efficient method would be for each block to have it's own, "intelligence", sort of. Rather than cycling through EVERY block with a foreach loop, instead simply set a bool to true every tick. The blocks would check the bool, and if it's true, then it changes the blocks it affects. This minimizes activity of logic blocks to the blocks that actually need changing, rather than EVERY SINGLE logic block, which is where the lag comes in.

    So I may not have been explicitly told, but the evidence provided prompts and IMMEDIATE change to the logic system, to make it more efficient and more flexible. This may take a fair bit of time, but if schema wants logic to be prominent in the game, then this is a necessary step. And if it requires the fourth byte? Then so be it, that byte will ultimately add to the game, rather than take away from it. Sure, there can't be as many blocks on screen at once, but we can get SO much more flexibility from those blocks, as well as a greater variety.

    This has just turned into a more general discussion, lets get back on track. :p


    And what would be the point of a delay that causes no delay?
    The fact that it DOES cause a delay, however it's so fast that the naked eye can't pick it up. This means multiple processes can run at extreme speeds, making computers possible, and allowing Conway's Game of Life to be made without each node having the ENTIRE circuit in it (There are many nodes). In general, it just adds more flexibility.
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    The only real problem I would see, is that I am not sure logic ticks even exist. From all I can tell by how it behaves, it is event based, meaning there are no ticks.
     
    Last edited:

    ZektorSK

    Poor boi from northern Hungary ^^
    Joined
    Aug 31, 2015
    Messages
    407
    Reaction score
    121
    • Legacy Citizen 2
    • Purchased!
    • Community Content - Bronze 1
    Does logic ticks exist ? I mean, I know that in minecraft it has some sort of fuction with repeaters, but in Starmade ?
     

    Blaza612

    The Dog of Dissapointment
    Joined
    Nov 16, 2013
    Messages
    787
    Reaction score
    209
    • Legacy Citizen 4
    The only real problem I would see, is that I am, not sure logic ticks even exist. From
    all I can tell by how it behaves, it is event based, meaning there are no ticks.
    Does logic ticks exist ? I mean, I know that in minecraft it has some sort of fuction with repeaters, but in Starmade ?
    The evidence (That apparently this will block will cause lag, and the fact that all logic blocks change simultaneously) indicates some sort of logic "ticks". Ticks is simply a way of saying a looping amount of time when a collection of actions occur. Hopefully that explanation is guten. :p

    What of course would be better is removing the tick system, and if ticks are half a second, then it should be lowered, a LOT (such as to 0.1 or 0.05 of a second). And if lowering the time between ticks will cause lag, then evidentally, the method of which the engine manages the logic is VERY inneficient, using a foreach loop and going through EVERY single logic block.

    You know what, fuck it. I'm going to make a new suggestion, which is just fixing logic, and then another which tells the devs to make optimization a priority. I've been doing many a discussion on chat, and thinking, and have come to some conclusions. :p
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    The evidence (That apparently this will block will cause lag, and the fact that all logic blocks change simultaneously) indicates some sort of logic "ticks".
    False. The fact that processing takes up processing time does not state anything about what and how it is processed, it only states how much is processed.
    I will repeat once more that I have no evidence for the existance of logic ticks, so removing it or increasing tick-rate isn't possible, if ticks don't exist at all.
     

    Blaza612

    The Dog of Dissapointment
    Joined
    Nov 16, 2013
    Messages
    787
    Reaction score
    209
    • Legacy Citizen 4
    False. The fact that processing takes up processing time does not state anything about what and how it is processed, it only states how much is processed.
    It's the fact that increasing such a rate would apparently cause lag. In general this would add to the resources consumed, however, it will only be significant if found in a foreach loop, where the world goes through EVERY single logic block, and changes stuff accordingly.

    I will repeat once more that I have no evidence for the existance of logic ticks, so removing it or increasing tick-rate isn't possible, if ticks don't exist at all.
    The above is the first bit of evidence. The second bit of evidence (which I only just picked up on) is from NeonSturm on the logic steps thread. He said that a logic block can only change once every 0.5 seconds, which indicates a tick rate of 0.5 ticks.

    However, ultimately we'd need word from schema. There are bits of evidence that reference different details for the system, however they point towards the idea of a tick system. Hopefully he recovers soon, because I'd like to actually know exactly how this system works. :/
     
    Joined
    Mar 10, 2015
    Messages
    122
    Reaction score
    50
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 5
    You said you wanted to make Conway's Game of Life in Starmade - I suggest you try building it with a normal programming language (if you know nothing about GUIs, javascript is probably a good choice). People like building turing complete redstone computers, which is nice, but they're just showpieces - they're not even remotely practical and are generally massive lagbombs. The same concept applies here - do you really need this in Starmade? Your life will be a lot easier if you build it somewhere else, and - more to the point - rebuilding the entire logic system just so you can make a useless logic trophy is a bit much to ask.

    As for "instant delays", they actually already exist: they're called activation blocks. Take this circuit:


    The OR links to the NOT, and the NOT links to both ANDs. Only one AND can activate the OR. This is, effectively, a race condition: both the top and bottom row are racing to turn on the OR. Notice that the bottom row has one less activation block than the top row. When we push the button:


    The bottom row wins. This is a 100% reproducible result - you can give the extra activation block to the bottom row, or use 100 activation blocks instead of 3, or change all the activation blocks to ORs, or Rotate it any direction, put it on a ship, a station, fly it through a sun, it doesn't matter: the shortest path to the OR will always win.

    Logic "ticks" don't exist. I'm even inclined to say that all .5s delays are asynchronous (if they weren't, you'd probably notice that some are shorter than others), but I haven't actually tested that. Internally, logic circuits are directed graphs where blocks are vertices and links are edges. Every block is in one of two states, on or off. Barring any outside interaction, all blocks will remain in their current state. All interactions are instantaneous, and therefore, when the circuit changes, there is exactly one source signal at any given time (eg. you pushing a button). The graph is then updated with a breadth first search:

    1. Let Q be a queue of blocks.
    2. Push the initial block into Q (eg. the button you pushed)
    3. While there are blocks in Q:
      1. Pop a block B out of Q.
      2. For each child C of B:
        1. Use B's state to update C's state (eg, if B is on and C is a NOT, set C to off).
        2. Push C into Q.

    I suspect there are more rules than this to prevent infinite loops (have you ever tried linking two NOTs together?), otherwise processing ends when Q is empty. This is as good as it gets; only the blocks that need to be updated are updated, and everything else keeps the same state. Frankly, this is a fairly sane and straightforward system that doesn't leave much room for improvement. Any optimization schema can make is going to be JVM voodoo rather than algorithmic tweaks.

    Finally, as Megacrafter mentioned: yes, instant delays would (and do, since they exist) increase lag. More blocks, more processing. More processing, more lag. Simple as that.

    For further reading, here's a thread on timing from a guy who spent way more time on it than I did.
     

    Blaza612

    The Dog of Dissapointment
    Joined
    Nov 16, 2013
    Messages
    787
    Reaction score
    209
    • Legacy Citizen 4
    do you really need this in Starmade
    Yes :p

    Your life will be a lot easier if you build it somewhere else
    That's the point, the challenge is fun, except for when Starmade's logic system decides to say no.

    rebuilding the entire logic system just so you can make a useless logic trophy is a bit much to ask.
    Adding flexibility to any system is always a good thing, and in the event that the foreach loop method is being used, so is optimization. Having to re-write a game to optimize it can and will kill a developer's interest to continue development. Again, in order to come to a proper conclusion, we need word from the devs themselves in order to confirm this, since there is evidence that shows both a global tick system and no tick system at all.

    [img=[MEDIA=imgur]ChWoNCZ[/MEDIA]
    That's not how you embed :p

    As for "instant delays", they actually already exist: they're called activation blocks. Take this circuit:
    Believe me, I've tried every possible thing conceivable to man. The problem has moved on from having an instant delay (I'm just gonna put the OP into a spoiler and say to move on) to allowing a block to be changed once per tick, which is every 0.5 seconds. It appears as though that each block has it's own tick timer, which would be taking up valuable space in the amount of bytes a block could use, which too is inefficient. Either way, then system will need to be changed, unless word from devs say otherwise.

    In general, the problem isn't the fact that I can't have a slight delay, I know that activation blocks create these delays, however at the time of writing this, I wasn't aware of the fact that blocks cannot be activated more than once in a tick. I imagine it's a safety feature to prevent abuse, hence the best option would be to lower the tick rate. Hell, before I learnt more and more from what others know about logic, I thought everything was done simultaneously, but since opening this thread and discussion taking place, I've learnt that in reality it's all just a clusterfuck of using global, local or no ticks at all.

    In reality, I'd prefer it all to work similar to actual electricity or redstone. with the advantages of single block ANDs, NOTs and ORs, to name a few, the community can make some remarkable stuff with a much lower block count, however the engine is the sole thing limiting everyone and quite simply being confusing with how exactly the system is written. I'm not entirely sure how the redstone system works, but it seems to work with the absent of being limited to ticks, and still requiring a massive block count due to not having the pre-made logic function.

    Alright, so in the middle of writing that, I was making a demonstration to show an example of the fact that a block cannot change twice per tick. Well, it appears as though they now can? I had pulled the blueprint of an old demonstration I used Yonks ago, and all of a sudden it works in the way that would logically make sense, which is quite simply odd, as yonks ago, it didn't. I'm just going to about my day as normal, as logic appears to have changed, "under the hood", so Idfk what's going on with it anymore. I'm just gonna go with this new development. :p
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    The above is the first bit of evidence.
    Sorry, I don't see how the above is evidence, as it assumes a tick-rate exists, so please show that it doesn't assume that.
    The second bit of evidence (which I only just picked up on) is from NeonSturm on the logic steps thread. He said that a logic block can only change once every 0.5 seconds, which indicates a tick rate of 0.5 ticks.
    That is half true, as you can show with the following experiment:
    Place down an activator, and 1 of each logic block, that can have an input (and, or, not, delay, flipflop, button, activator, etc), and link the activator directly to each of them. Now switch the activator on an off manually as fast as you can, and see which of the linked blocks change their state accordingly.
    Just now, when I ran this experiment, and switched the activator at at least 10 Hz(0.1s), the blocks updated instantly and accordingly at the same frequency, with only 1 exception: the delay block, which didn't change state at all until I stopped switching the activator that quickly.
     
    Joined
    Mar 10, 2015
    Messages
    122
    Reaction score
    50
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 5
    The theme of this thread seems to be "the logic system is broken because it doesn't work exactly the way I want it to". I'm going to stick with my original point:

    rebuilding the entire logic system just so you can make a useless logic trophy is a bit much to ask.
    The functionality you want already exists and the system works as intended.
     

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,168
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    The only real problem I would see, is that I am not sure logic ticks even exist. From all I can tell by how it behaves, it is event based, meaning there are no ticks.
    It needs ticks. If it doesn't have them now, they need to be added or it will always be derpy.
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    It needs ticks. If it doesn't have them now, they need to be added or it will always be derpy.
    Except they could break it further.
    An event based system is very efficient in that it does not do anything if nothing needs to be done[it doesn't even have to check if something needs to be done]. A tick system would first need to check if something needs to be done for EVERY logic block with an input, easily increasing lag in comparison with the event based system.

    E.g. if someone was to build a 32bit computer in starmade, it operating would easily be able to lag the game, simply because of the amount of signals being transmitted and processed. However, if the clock of that computer was to be halted, the lag would fully subside(assuming starmade has enough resources to handle an entity made from the same amount of non-logic-blocks without lag), as no block would change anymore. With a tick based system, not only would there be more lag to begin with, as even in each moment unused blocks need to be accounted for, but turning off the computer wouldn't affect most of the lag, as the activity of the logic doesn't matter anymore.

    It is true that the event based system creates race-conditions, which can be affected by lag, but there are ways to combat them(mostly using delays and memory-cells to force two parallel signals into being sent simultaniously.
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    Can we hook up speed controllers to delay blocks? In some cases, it would be nice to get 1/10 s delay instead of 1/2....
     
    Joined
    Mar 10, 2015
    Messages
    122
    Reaction score
    50
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 5
    Can we hook up speed controllers to delay blocks? In some cases, it would be nice to get 1/10 s delay instead of 1/2....
    I would also like a longer delay. Right now, if you want a 10s delay, you need 20 delay blocks, or one of those weird LCD AND clocks.
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    I would also like a longer delay. Right now, if you want a 10s delay, you need 20 delay blocks, or one of those weird LCD AND clocks.
    Once upon a time, I heard you could use a storage block as a 10s or 15s delay block. However, that was many, many updates ago, and I have never played with storage blocks to give extended-time delays. If it still works, it would be nice if speed controllers worked to change that delay also.
     
    Joined
    Jul 14, 2013
    Messages
    98
    Reaction score
    27
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen
    We need people working on the game to respond to this, but right now you can build more compact computers in starmade that work faster than Minecraft. Minecraft's system, what ever it is, is incredibly slow. I've never had problems with delays, you just have to make your logic correctly. I usually avoid delay blocks entirely, I've even created multiplication circuits that run in one go. No delays, but it will lag your game, because star-made tries to run it as a normal execution. I've done the same with division, but it lags a full second in single player before the output comes out (and the dimensions are enormous). You can hardwire your circuit so everything runs in one go as well, it just makes things more complicated to create, though still take up much less space than minecraft and give a result much faster.

    Additionally I've been told that increasing the frequency of delay blocks will increase lag in the server (Schema responded to some of my questions directly in one of the suggestion/questions video streams they did in the past)
     
    Joined
    Mar 10, 2015
    Messages
    122
    Reaction score
    50
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 5
    Minecraft's system, what ever it is, is incredibly slow.
    Minecraft has a .1s tick system. Signals move through redstone dust instantaneously, but torches, repeaters, and pistons take .1s to toggle. Signals also can't move through more than 15(?) blocks of redstone in a line.

    Effectively what this does is spread out computation over many frames, which prevents redstone circuits from freezing your game at the cost of making them take way longer to process. That, and the fact that the only default gate in minecraft is NOT.
     

    Blaza612

    The Dog of Dissapointment
    Joined
    Nov 16, 2013
    Messages
    787
    Reaction score
    209
    • Legacy Citizen 4
    Omg, guys pls, logic was changed under the hood at some point, it's all good now. :p

    Seriously, allow the abandonment of the thread, it's useless now