Recognized by Council Logic Proposals

    Joined
    Feb 16, 2016
    Messages
    67
    Reaction score
    42
    First post, yet a lengthy proposal.... Several proposals, actually...

    1. Inspired by the Logic space proposal:

    A new entity type called 'circuit' to place logics in. It's blueprint could be saved in the catalog for copying, sharing, moving. It will use it's own space. The logic gates inside will be invisible from the outside world. All other blocks should be visible and use normal space (activators, buttons, non-logic blocks). Two new blocks should be created: input and output pin. These should be visible too because they will be the way the circuit interacts with the rest of the universe.

    A circuit will be a black box for the outside world. It's state will be hidden, only the pins are exposed. Thus a potentially large (in terms of logic block count) piece of circuitry will be replaced by a structured entity with a few contact pins. This will lead to potentially big, even huge, performance and stability boost when the game evaluates logic blocks. The outside world won't depend on the states of a circuit's internal elements, but only on the states of it's output pins. On the other hand, the circuit depends only on the states of it's input pins, not on the rest of the universe.


    Example:
    a. Create a 'memory cell' circuit: some gates for a flip-flop, write input, control input, read output. A total of like 10 logic blocks.
    b. Create a 'byte chip' circuit: 8 instances of the memory cell, 8 read outputs, 8 write inputs, control input -- about 8 circuits + like 20 blocks more for a total of 100 blocks (if inner circuits are expanded).
    c. Create a 'memory' circuit: 8+ instances of byte chip, 8 inputs, 8 outputs, 3+ address inputs. A total of like 800+ blocks (if expanded).

    Thus almost a thousand of blocks in the world are replaced with a single entity. It's further divided into smaller entities. Every circuit in this tree is not so complex on it's own and is evaluated easily. On the other hand -- evaluation of 800 blocks at the same time, over and over again, is not very easy. Assuming the logic evaluation algorithm is O(n^x), x>1, this will improve performance (drastically, even). Gameplay-wise , this replaces a mess of hundreds of blocks with a structure of well-defined sub-units.

    Not everyone makes huge circuitry but everyone needs some repeating logic elements like gate controllers. One can save a generic gate controller in their catalog and reuse a good design multiple times.

    The performance and stability boost will be significant. The entire logic graph will be split into several smaller graphs and since graph algorithms are usually more complex than O(x), the computing cost of logic will be reduced significantly. In case a circuit doesn't contain circular dependencies and is a pure binary function, its evaluation could be even reduced to constant complexity by 'pre-compiling' its truth table in the blueprint.



    2. Factories, storages and logic: The ability to control and detect factory and storage blocks like rails.

    Adding an activation block next to a factory could become 'on' on factory cycle end, a button block could emit a signal. The same could be applied to inventories on pull events.

    A logic element as master should be able to start/pause the factory/storage.

    Example:
    Consider you want to mass produce fighters and bombers for your big carrier. Each requires some small amount of different build blocks in strict proportions. Factories could be automated so no overproduction of a single block would occur. Thus a clever assembly line won't let you with hundreds of blue cubes and no white heptas or capacitors or whatever. The assembly line will be able to make the most out of the resources you supply it. This will require some extra logics and here logic entities (the circuits from above) will come pretty handy.



    3. The ability to see the masters of the selected block:


    Much like when you select a block its slaves appear in purple boxes, it would come handy to be able to see its masters too (for example -- in white boxes). This should apply not only to logic blocks.

    Sorry if these proposals are not new to you, thanks for your patience and attention.
     

    ToasterBorst

    Formerly known as Weishaupt
    Joined
    Sep 12, 2013
    Messages
    164
    Reaction score
    172
    • Legacy Citizen 2
    • Wired for Logic
    Love, don't know if possible, but love.

    Another somewhat similar thread which was just posted (Read by Council - Suggestion for integrated logic in starmade). Hopefully he'll bring that commentary here. In the mean time, I've bumped this to the council. Thanks again for posting!

    Also, SkylordLuke, these two posts belong in the logic section of the mega-thread you think?
     
    Last edited:

    Fellow Starmadian

    Oh cool so thats what this is
    Joined
    Jun 7, 2014
    Messages
    227
    Reaction score
    87
    • Community Content - Bronze 1
    • Wired for Logic
    • Legacy Citizen 2
    Heh, cant believe I didn't notice this post! I posted basically the same thing an hour or so ago. You explained the idea much more intelligently though :p

    I sincerely hope that after the current major updates are implemented, they will maybe add this feature. So many possibilities!

    p.s. toasterborst at the time of me posting this, your link in parentheses links to this thread, not mine.
     

    ToasterBorst

    Formerly known as Weishaupt
    Joined
    Sep 12, 2013
    Messages
    164
    Reaction score
    172
    • Legacy Citizen 2
    • Wired for Logic
    Heh, cant believe I didn't notice this post! I posted basically the same thing an hour or so ago. You explained the idea much more intelligently though :p

    I sincerely hope that after the current major updates are implemented, they will maybe add this feature. So many possibilities!

    p.s. toasterborst at the time of me posting this, your link in parentheses links to this thread, not mine.
    Fixed, thanks for the heads up!
     
    Joined
    Nov 21, 2013
    Messages
    146
    Reaction score
    153
    • Community Content - Bronze 2
    • Wired for Logic
    • Legacy Citizen 4
    I like the idea of being able to save logic bits as templates and the idea of the parent/child of each logic block to be displayed. So often I need to find out what is coming TO a block and it's endless confusing trying to puzzle it out.
     
    Joined
    Feb 16, 2016
    Messages
    67
    Reaction score
    42
    Thanks for the positive response :)

    Yesterday after posting this, I tried to see my theory in practice. I have a structurally complex and yet functionally simple circuitry which caused constant lag. This is just the beginning of my Mega-Ambitious Project and it already hit a lag-cap. The circuitry contains a 10 byte bus (about 10 nodes per bit line), a clock and 16 bytes of memory (about 10 nodes per bit) for a total of like 3k logic gates. The lag-o-meter reported constant 150-170 ms lag. Moving the memory to a docked entity reduced the lag to 60-70 ms on occasional spikes. Furthermore as a single entity it took some time for the circuitry to start, it loaded with a big spike of 2-3 seconds and after loading it was often in some dead-locked state (the clock not ticking, memory reads returned wrong data...). When split these problems seem to not appear.

    Thus dividing the circuitry into two or more docked entities improves performance and drastically improves stability. Unfortunately the game mechanic of docking is not so logic-oriented and it's a bit tedious and error-prone to connect two circuits with wireless modules.

    I imagine the 'circuit entity' implemented as a mode in advanced build which allows easy creation and connection of functional elements. Entity docking can be used for the same thing but has some drawbacks on user experience PoV: a ship entity spawns somewhere nearby and you have to attach some thrust and 'park' it at the right spot; this right spot is usually on the outside of the structure; wireless modules don't show their connections across entities. A circuit entity could be more light-weight, it could be able to spawn and be positioned like the copy-paste feature, its I and O pins could connect on contact: an input pin on one entity could attach automatically to an output pin on another. (Wifi modules are both I/O-capable, so one has to explicitly set it as either input, output or both.) Furthermore, hiding gates for the outside world will be good for the calculations required for rendering, collision, damage, thrust etc.

    Fellow Starmadian : I wanted to see if rendering of my circuit causes lag. I covered the entire structure with opaque hull blocks. Performance remained the same. I'd say that it's not the visibility of all these blocks but the connections between them which causes most of the lag. I guess the loads the renderer gets for drawing 1000 logic gates or for 1000 hull blocks are the same. What could cause it trouble are transparency and lights, imo. Visible pipes probably add to the lag too but that's not so noticeable. I'd suggest you to move some parts of your circuit to a docked entity.
     
    • Like
    Reactions: EnerJay

    Criss

    Social Media Director
    Joined
    Jun 25, 2013
    Messages
    2,187
    Reaction score
    1,772
    • Master Builder Bronze
    • Video Genius
    • Competition Winner - Stations
    I do not have the knowledge on logic to give an informed response. I am not sure why the system operates the way it does or if there are limitations. As such I will archive this on our list of suggestions and differ to AndyP or Bench to see if they have any input.
     
    • Like
    Reactions: ToasterBorst

    AndyP

    Customer Experience Manager
    Joined
    Aug 15, 2013
    Messages
    1,199
    Reaction score
    264
    • Schine
    • Wired for Logic
    Moving logic to docked entities does only masquerade a few issues, under the line it increases the problems and delays.

    I build a large pathing network and encountered this issue here:
    T193 - Slow logic rebuild

    The problem seems to increase if the logic is in one big network.
    So small isolated circuits for like:
    button -> flip-flop -> light
    usually work very fast and reliable.

    As in my case, and so most likely for the 10bit bus project, the logic is like one big network, the relations and connections take a while to load.
    For the base I built on its now a 6500 gate network, taking around 13-15 minutes to work properly.
    Worst thing:
    If you fiddle around and manually try to toggle gates, the input seems to be ignored, BUT will be processed once that section comes alive, and if you flip several gates at the same time in a larger network you will jam a few circuits for sure.
    So waiting until they come alive and start working is the only solution.

    I already tried to encapsulate circuits into docked sub-modules (example here), this did make individual circuits react faster, but as the whole system got more complex it took even longer to work as a whole system.
    There is also a problem in the update strategy,
    only a certain amount of logic state changes gets processed and transmitted to clients.
    Then the logic runs in a "anti-spam" mode and delays further updates until the next world-update.
    So flipping more and more gates at the same time causes timing issues and forces to use longer signal travel times to make sure nothing gets eaten in those spam ticks. Wireless sections in that line often miss short pulses and simultaneous changes. (Testing showed: 4-5 changes per update already result in issues with signals getting lost, so it has an even lower spam threshold.)

    So with encapsulated modules, there is another issue:
    You cannot blueprint it or transport it to any other server without reconnecting large parts of the circuit. (T280)

    So in short:
    Yes, I would like to see integrated circuits,
    but this requires a major change in the base framework the logic currently relies on.
    As its already very easy to bring it to practical limitations.
    (Like above mentioned base-door-control taking 15 minutes to start working is impractical when showing your base to someone ^^)
    Some bus-network with named signals and bits to form an universal in-out-system (like the bus/IO-expander network from red-power 2 mod for minecraft) would be great.
    But this would also increase metadata and cause a much higher data density as the current logic system, with the 1 block - 1 function design. (Memory, and CPU power required will increase as people start to utilize that gained density)

    I also do like the idea of a "logic beam" that could transmit a true or false, depending on an input state, to have a stateless wireless connection. And thus would allow like docked-to-parent and parent-to-docked communication in a reusable way without having to hard-code links between them.
    There are also some interesting suggestions to "named" wireless connections,
    they all sound promising, and I would be happy if they come into the game in long term.
    But before adding complexity, we should get the basics ready for true large scale ciruits. =)

    - Andy
     
    Joined
    Feb 16, 2016
    Messages
    67
    Reaction score
    42
    Firstly, knowing that the current dev plan is aimed towards a more living universe, not adding new building/crafting features, I really appreciate your response on this.

    Integrated circuits would be a cool addition. I thought creating a new logic-type entity wouldn't be a big problem, since it would inherit some functionality which is already present. And as a bonus, it could hide logic gates which has some reason. After all, an AND gate is not 1 cubic meter big IRL .

    Wireless modules tend to loose their connections on load. I suppose that's the core of the T280 issue. Consider a parent entity A and a docked entity B. When loading this structure, I found that connections from A to B are kept, while backward connections form B to A get destroyed. (That's why I moved to a single circuit design, which has lag issues) If wireless modules could be explicitly set to either input or output, it won't be very hard for the game to repair these connections. Be it with splitting wireless modules into I and O modules, or attaching some GUI to the existing wireless module. This GUI could allow the player to set the current block to input, output or both (default). When an input block (or a wifi module in input mode) touches an output block from a different entity, they could auto-magically connect with the output as master. A 'duplex' block could be slave to a neighbor output block and master for an input block.

    Named connections and logic beams would be more flexible, and thus harder to implement. So I'd suggest the I/O blocks as an easier (imho) solution.

    If there are hidden problems in the logic framework (what I call the logic evaluation algorithm), well I suppose the devs know best how fixable these are. Adding a few new features definitely will not fix them but probably would make them easier to workaround. When these problems get fixed eventually, the new features sill will be useful.

    Regards
    6
     

    AndyP

    Customer Experience Manager
    Joined
    Aug 15, 2013
    Messages
    1,199
    Reaction score
    264
    • Schine
    • Wired for Logic
    Yeah, but more complexity, will increase loading times and thats already a big problem.

    I also see the point in logic gates being very large compared to realistic logic.
    It may someday work a bit like a cargo system. And you have a central "processor" block that acts like a circuit board, or even as a computer with some type of scripting, and you link activators to it (special named ones), and they can be used as in or out for the board.

    But that is something for the future, other things are more important first.
    As the amount of players that really push the complexity to the practical limits is way lower than the amount of players waiting for something to do in the universe.

    - Andy
     
    Joined
    Feb 16, 2016
    Messages
    67
    Reaction score
    42
    I agree. The team has a whole universe to design, create, populate and pleasing a few math/programming geeks is not that important. Modifying the game to add an extensive feature which most won't use and a few will abuse is not worthy at the current stage. Furthermore, modders also need some work to do.

    I'd simplify my proposals to something more feasible in the near future:

    1. A way for wifi blocks to maintain connections on server, chunk, blueprint etc. loads. Optionally: a way to auto-connect wifi blocks;
    2. Logic reacting to factory and storage cycles. Factory and storage cycles controlled by logic. (Something which is present for lights, docks and weapons, so just an extension to an existing feature);
    3. When a block is selected with C, its masters to be outlined too. For example: the selected one in orange, the slaves -- purple, the masters -- white. If a block is both a master and a slave of the selected one, its outline color could pulsate to indicate this bidi relationship. Not just for logic blocks but weapons, factories and anything C+V linkable. (A minor cosmetic feature which would improve building a lot).

    Regards & thanks