Friday Facts #123 - Better Circuit Network II

Posted by Robert on 2016-01-30, all posts

Hello,

Robert here again. It's time for the information I teased about in the previous Friday Facts edition.

Circuit Network Connector

So the idea is, instead of connecting the circuit wire directly to the entity, you attach a new 1x1 entity, called "Circuit Network Connector". And you then connect the wire to the Circuit Network Connector. It will also contain the GUI for setting up circuit conditions or modes of operation
It will be separated into two entities:

  • "Circuit Network Connector Reader" that is responsible for reading stuff from the connected entity, like reading chest contents, reading accumulator capacity.
  • "Circuit Network Connector Writer" that is responsible for controlling the connected entity, for example turning entities on or off.

Logistic Network Connector

Similarly, the idea is extended to the logistic network: You have an 1x1 entity called "Logistic Network Connector". It will basically act as a "Circuit Network Connector Writer", but with the contents of the logistic network it is in range of, being able to control the entity based on logistic network conditions. Unlike the Circuit Network Connector, this will obviously not be able to change the contents of the logistic network. The plan is, you can eventually turn on and off most of the things in your factory(lamps, inserters, belts, assembling machines) using either circuit network or logistic network conditions.

But why?

At first it sounds like a bad idea, now you need extra space to connect something to the circuit network? This sucks! The biggest and greatest advantage is that new entities can now be more easily connected to the circuit and logistic networks(programming wise). Other reasons include:

  • Consistency! You can turn entities on or off in the same easy to understand way.
  • Creates nice feeling of modularity, flexibility and entities interacting with each other.
  • The extra space requirement means you need to plan your setups better.
  • More intuitive GUI interaction. The GUI for setting up the circuit network interaction will be in a separate window of a separate entity. This also helps with designing the GUIs, since I don't have to find a place to add the extra controls in a way that looks good.
  • Speed and memory improvements. By removing the circuit network logic from the inserter entity, it will run slightly faster and use less memory when not connected to the circuit network. Similarly, by not making transport belts connectible directly(which have thousands of instances is some games), there will be no performance hit.

Details:

The smart chest will be removed. Any chest can be read by attaching the Circuit Network Connector to it. The main problem with the Circuit Network Connector is lamps. Combinators are nice for making displays and amazing animations. Having to place another 1x1 entity next to every lamp will break this. For this reason, lamps will remain connectible to the circuit network directly. Finally, I have no fancy screenshots of this in game because the graphics department has been crazy busy with the new trailer(which is great!) and all the graphical things for Steam. Something to look forward to.

The future

I plan to make as many entities as possible controllable by the circuit and logistic networks this way by the time 0.13 is released. No promises about what will be done. Here are some of the things I plan to do(not confirmed and in no particular order):

  • Power switch (can be controlled manually, using the circuit network or using the logistic network).
  • Trains. Many of you are looking forward to controlling trains using the circuit network. I don't want it to be overly complicated, so the be best idea so far(that I got from someone on the forum) is to have a circuit condition that "disables" the train station. If a train's next train stop is disabled this way, it will skip it and move to the next one. Additionally the train wait conditions can also use the circuit network. So this should offer good flexibility without complicating the GUI or making hard to understand gameplay mechanics.
  • Accumulator.
  • Smart inserter: ability to set the inserter's filter using the circuit network.
  • Roboport: read robot statistics: number of available/total logistic/construction robots.
  • Transport belt: turn it on and off and read the number items that are now on the belt.
  • Mining drill: Read the amount of remaining resources.
  • Assembling machine: turn it on an off. Maybe ability to set the recipe, but as many of you noticed this will cause complications that need to be solved.
  • Speed improvements: with people making factories with hundreds of combinators, and 40000 lamps, it makes quite an impact on performance. I will look into ways to improve this performance.

You know the usual, PM me or reply at the forums for suggestions, complaints and comments.