Re:Preparing your game for deterministic netcode
by YellowAfterlife on Monday May 24, 2021 @08:15AM
(#27263449)
It is a great technique if the tools allow for it! Author of INVERSUS also described using this approach for fast game state snapshots.
(aside: code blocks in the post could use a fallback font in case Menlo isn't installed)
Instead of serializing individual objects, you serialize all the memory relevant to the gameplay by using a custom memory allocator whenever the gameplay related code runs. This custom memory allocator is designed to allow taking fast memory snapshots, and supports restoring memory snapshots.
This allows rollbacking any code, including in my case rollbacking user-submitted Lua scripts.
I wrote about it at https://www.jfgeyelin.com/2021/02/a-general-state-rollback-t...