<story><title>Preparing your game for deterministic netcode</title><url>https://yal.cc/preparing-your-game-for-deterministic-netcode/</url></story><parent_chain></parent_chain><comment><author>hesdeadjim</author><text>If you want to not hate your life building a real-time multiplayer game, fully embrace data oriented design.&lt;p&gt;I took the gamble and picked Unity DOTS and NetCode for our current MOBA-esque game (not other packages, we bolt regular Unity visuals on much like the V in MVVM). Outside the headaches of using preview tech, it has been amazing what we have been able to do compared to regular OOP hell.&lt;p&gt;By not having hidden game state lurking in classes, lambdas or coroutines, we have been able to hide much of the networking layer as an encapsulated set of glue systems that shuttle &lt;i&gt;just&lt;/i&gt; enough data across the wire that the view-layer can present the game to the user. Movement and other prediction has been much easier too, because the game state is just data and not intertwined with behavior, I just run most of the same algorithms locally as I do on the server — AI, steering, etc.&lt;p&gt;This technique still requires a lot of foresight and challenging architecture decisions of course. I forced our core gameplay logic to not know anything about the visuals, which has made some things harder. However when it came time to make a headless build with no graphics, it was as simple as flipping a switch. No changes in our gameplay code.&lt;p&gt;I have a principal engineer from Sea of Thieves on my team, and he has also breathed huge sighs of relief working on this project. Unreal is the complete antithesis to this design pattern, and is full of hidden state, magic behavior, and heisenbugs.</text></comment>
<story><title>Preparing your game for deterministic netcode</title><url>https://yal.cc/preparing-your-game-for-deterministic-netcode/</url></story><parent_chain></parent_chain><comment><author>davedx</author><text>Nice article.&lt;p&gt;I implemented netcode for a canvas game I made a while ago over websockets. It used client-server with various RPCs from&amp;#x2F;to the clients and worked pretty well. I’m just starting on a kind of follow up of that game that will have more discrete movement so it was useful to read this overview. I’d maybe like to add that often games make a distinction between “authorized” actions players take (eg spell casts that damage other players), that often use the client-server RPC mode, and the “p2p rollback” actions that are less strict but generate more traffic like player movement. I believe World of Warcraft uses this model, and I also worked on a FPS that IIRC also worked this way: a gun fire was RPC over TCP; movement was done via UDP broadcast.</text></comment>