deterministic lockstep
- TheKillerChicken
- Long Handed Inserter
- Posts: 95
- Joined: Sat Mar 02, 2019 7:06 am
deterministic lockstep
I do not know if this is the right location, but I am curious why Factorio uses a deterministic lockstep setup. Was there not any other alternative, or is it due to how the engine handles everything?
Re: deterministic lockstep
Because amount of state changes each tick is so large that multiplayer would not be feasible otherwise.
- TheKillerChicken
- Long Handed Inserter
- Posts: 95
- Joined: Sat Mar 02, 2019 7:06 am
Re: deterministic lockstep
I see, now that makes sense. Thank you for this info.
- TheKillerChicken
- Long Handed Inserter
- Posts: 95
- Joined: Sat Mar 02, 2019 7:06 am
Re: deterministic lockstep
Sorry, another question, is there a reason why the server/client must have the exact same data and CRCs?
Re: deterministic lockstep
Otherwise you would not play the same game.TheKillerChicken wrote: Sun Mar 30, 2025 9:14 pm is there a reason why the server/client must have the exact same data and CRCs?
Re: deterministic lockstep
Once you have deterministic lockstep, the entire game can be simulated perfectly, without errors, and any remaining errors are due to existing errors in data or data corruption, and any one error will eventually cascade into completely different game states (read up on the butterfly effect if you're still unsure). Usually caused either by faulty starting data, faulty hardware, or by problems in data transmission during multiplayer. Any of them would be comparatively rare cases, but either way, at that point in program development, it's easily worthwhile to add checks to ensure that the data is and remains the same, considering that after that, you have nearly perfect multiplayer that just works.TheKillerChicken wrote: Sun Mar 30, 2025 9:14 pm Sorry, another question, is there a reason why the server/client must have the exact same data and CRCs?
Lockstep basically requires complete data integrity, so you implement checks for it if you are designing a game with lockstep in mind.
- TheKillerChicken
- Long Handed Inserter
- Posts: 95
- Joined: Sat Mar 02, 2019 7:06 am
Re: deterministic lockstep
Interesting. I did not know that. That solves that mystery for me.MEOWMI wrote: Sun Mar 30, 2025 9:32 pmOnce you have deterministic lockstep, the entire game can be simulated perfectly, without errors, and any remaining errors are due to existing errors in data or data corruption, and any one error will eventually cascade into completely different game states (read up on the butterfly effect if you're still unsure). Usually caused either by faulty starting data, faulty hardware, or by problems in data transmission during multiplayer. Any of them would be comparatively rare cases, but either way, at that point in program development, it's easily worthwhile to add checks to ensure that the data is and remains the same, considering that after that, you have nearly perfect multiplayer that just works.TheKillerChicken wrote: Sun Mar 30, 2025 9:14 pm Sorry, another question, is there a reason why the server/client must have the exact same data and CRCs?
Lockstep basically requires complete data integrity, so you implement checks for it if you are designing a game with lockstep in mind.