FCDB #2 : Offline computation

Your factory is not running the same way as when you are online. Actually, it is not running at all, because it would be too much power consuming for the server. Instead, the time you left your factory and the time you are back are used to compute what happened in your factory. To make it possible, FactoryCapi needs to be determinist, it means that given any input state, the output will be the same. I have been working on the offline computation program since I started developped the game because they are linked together.

How does it work ? (easy explanation)

Instead of recomputing the game state 50 times per second like the real game, we compute how many 'empty' frames there are before a new state update is needed. Then we update every entities, and restart the same processus until the asked number of frame computed is reached.

Can we rely on it ?

Yes. It is frame perfect. You will find your factory in the exact same way as if you stayed online.Reserved iconThis test compares the output state file of the real game and the offline computation program after a certain amount of frame. It tests it with multiple save file, and with multiple amount of frame computed.

Is it fast ?

Blazing fast. Without multi-threading, we can compute 1 real life month factory computation in about 7-8 seconds.

Nerd zone

To be sure that the offline computation is right, I have made a consistency test. For a given save file, this test will compute the resulted save map after several random different number of frame, by the real game logic AND the offline computation program, and will compare them.

I have also made some benchmark to show off my static polymorphism multi-threaded optimisation ! I will put an output test result with a huge save file.