This is as good a thread as any for this topic.ssilk wrote: ↑Mon Jan 04, 2021 9:42 amWhat I find currently much more appealing than this, is the idea, that you create many of equal “elements” and you calculate only one.
Because of the deterministic nature of Factorio all others must behave the same, if they have the same input.
See this thread: viewtopic.php?f=6&t=91587 Nuclear Reactors BluePrint Cloning
The only way that statement makes sense is if you don't believe a child factory needs to follow the complete production path of the parent. In that case, it is pretty much the same as simply estimating the input/output, but you have placed some concrete, fixed rules around it. I fail to see much benefit over estimation, except maybe it can work better in multiplayer. It certainly wouldn't be a more accurate simulation and some of the constraints around it seem rather awkward for the player to manage for no particular advantage.. Adding a new child would mean then just to pause all child’s, until the new child is in synchronized state.
More accurate would be what I originally thought you were suggesting, which was synchronizing a child so that it must follow the entire production path (inputs and outputs) of the parent exactly.
A simplified way to think about a production path is this:
Starting from zero state
- at time 1 (after a wipe), you begin with Input at time 1, this creates intermediates plus any outputs at time 1.
- at time 2, you use the intermediates from time 1 + Input at time 2, to create intermediates, plus any outputs at time 2
- at time 3, you use the intermediates from time 2 + Input at time 3, to create intermediates, plus any outputs at time 3
- at time N, you use the intermediates from time N-1 + input at time N, to create intermediates, plus any outputs at time N
We are given the inputs and outputs via tracking the parent factory so do not need to calculate or know the intermediates for a virtual child factory. If a virtual child factory had timely inputs matching the above inputs at times 1 through N (ie, synchronized), then it would be reasonable and accurate to assume that the outputs would be the same as the ones above - outputs 1 through N.
However, total times 1 through N will be arbitrarily, infinitely long unless you periodically reset it to zero state. All of the inputs and outputs at time t will be dependent on the child factory first following the entire series of inputs and outputs from time 1 to t-1
In this case, there is no such practical thing as "waiting until the new child is in synchronized state" if the series length can be arbitrarily long. It could be hours, maybe, perhaps dozens of hours that you would be waiting, depending on how long things had been working.