Pulse mode: a good friend or an insidious enemy?
Posted: Tue Sep 13, 2016 9:58 pm
At this moment we have two different kind of entities with pulse mode support: all belts and all inserters.
For arithmetic and decider combinators pulse mode is "native" language so they are out of scope.
At the first sight, pulse mode is quite useful thing, using this mode you can connect belt or inserter directly to self-looped combinator (aka memory cell) and measure belt/inserter throughput or count items. Seems useful... but this is a very big illusion. Together with this illusory usefulness you will receive a huge danger.
To prove this I will start from the very beginning (here and everywhere I will talk only about circuit-connectable entities).
All entities can be divided in two groups:
- energy-independent: burner inserter, rail signal, gates, all belts, all chests (read only), storage tank (read only), accumulator (read only), power switch (write only), offshore pump (write only), train stop (write only)
- energy-dependent: combinators, roboport, all inserters, small pump (write only), lamp (write only, but it is safe)
Energy-independent entities are considered as always full-powered.
Energy-dependent entity updates its internal state and output signals according to input signals only if it has enough energy inside internal buffer. For example, if for some reasons you main electricity grid has satisfaction level 33% (this means each combinator will fill its internal buffer only by 33% each tick), combinator will calculate its output signals once per three ticks. But what will happen if pulse signal (from belt for example) is send while combinator is out of energy? Nothing, this signal will be completely ignored and item which triggered this signal won't be counted.
You may say that you have hundreds of accumulators and you will never run out of energy, but this is truth only partially.
Even if you have enough energy stored accumulators energy consumption still may be temporary larger than max discharging rate (for example: 20 laser turrets requires 124,8 MV of energy or 416 accumulators during firing).
So, each time when you connect energy-independent entity to energy-dependent you add some instability to your system.
This instability may vary from very minor (like connecting a lamp directly to belt) to the major (the entire system may be ruined).
The larger the system - the larger destruction.
Even connecting energy-dependent enities between themselfes also may introduce some instability, simple example: inserter with pulse mode is connected to memory cell. On the low energy combinator may be disabled, but inserter still will be able to catch an item and send a pulse signal because its internal buffer is larger. Result is the same - pulse signal is ignored.
Actually, pulse mode is not the main cause of these problems but this mode significanty strengthens them.
It would be great to summarize this short post with some simple rules that can prevent many mistakes, but I didn't find anything similiar and easy in usage. So, here is my three advice for everyone:
- always ask yourself what will happen if you suddenly lose your energy.
- check advice #1 again before using pulse mode with inserters.
- check advice #1 one more time before using pulse mode with belts (they require the strongest ever guarantee from you, and this is often very expensive).
For arithmetic and decider combinators pulse mode is "native" language so they are out of scope.
At the first sight, pulse mode is quite useful thing, using this mode you can connect belt or inserter directly to self-looped combinator (aka memory cell) and measure belt/inserter throughput or count items. Seems useful... but this is a very big illusion. Together with this illusory usefulness you will receive a huge danger.
To prove this I will start from the very beginning (here and everywhere I will talk only about circuit-connectable entities).
All entities can be divided in two groups:
- energy-independent: burner inserter, rail signal, gates, all belts, all chests (read only), storage tank (read only), accumulator (read only), power switch (write only), offshore pump (write only), train stop (write only)
- energy-dependent: combinators, roboport, all inserters, small pump (write only), lamp (write only, but it is safe)
Energy-independent entities are considered as always full-powered.
Energy-dependent entity updates its internal state and output signals according to input signals only if it has enough energy inside internal buffer. For example, if for some reasons you main electricity grid has satisfaction level 33% (this means each combinator will fill its internal buffer only by 33% each tick), combinator will calculate its output signals once per three ticks. But what will happen if pulse signal (from belt for example) is send while combinator is out of energy? Nothing, this signal will be completely ignored and item which triggered this signal won't be counted.
You may say that you have hundreds of accumulators and you will never run out of energy, but this is truth only partially.
Even if you have enough energy stored accumulators energy consumption still may be temporary larger than max discharging rate (for example: 20 laser turrets requires 124,8 MV of energy or 416 accumulators during firing).
So, each time when you connect energy-independent entity to energy-dependent you add some instability to your system.
This instability may vary from very minor (like connecting a lamp directly to belt) to the major (the entire system may be ruined).
The larger the system - the larger destruction.
Even connecting energy-dependent enities between themselfes also may introduce some instability, simple example: inserter with pulse mode is connected to memory cell. On the low energy combinator may be disabled, but inserter still will be able to catch an item and send a pulse signal because its internal buffer is larger. Result is the same - pulse signal is ignored.
Actually, pulse mode is not the main cause of these problems but this mode significanty strengthens them.
It would be great to summarize this short post with some simple rules that can prevent many mistakes, but I didn't find anything similiar and easy in usage. So, here is my three advice for everyone:
- always ask yourself what will happen if you suddenly lose your energy.
- check advice #1 again before using pulse mode with inserters.
- check advice #1 one more time before using pulse mode with belts (they require the strongest ever guarantee from you, and this is often very expensive).