I’m currently trying to achieve a simple synchronization for my scene. It is a single scene and it only runs in 2D space, so only the player inputs would have to be synced. How and where would I start with that? I have pretty much no multiplayer experience so far.
Thanks for your answer! Is there some easy way to set this up in Unity? I‘ve read something about some multiplayer systems, but I‘m not sure which one would fit my requirements best.
Regarding Input Data, is this some special class that you can directly access or how would I create that?
In my opinion for your tasks LiteNetLib (https://github.com/RevenantX/LiteNetLib) and hand-written (“if you want to do better, do it yourself”), the first has basic functionality for interaction between connections, the second you can write yourself using UDP or TCP
Rolling your own is really involved. You’re best off using an existing system for both transport and high level. Unity worked on UNET but deprecated it a while back. The best solution really depends on your project requirements but Mirror and PUN are the most common solutions right now with lots of games using them.
I personally recommend Mirror. They have existing structures for syncing transform data and such, but you can roll your own messages and serialize/deserialize whatever data you want manually without having to worry about the low end. This makes it pretty straightforward to send and digest input.
The thing is though, if you’re only syncing input you’re going to run into a lot more issues than you think. Input-only means determinism if you want accuracy and a lot of interpolation/lag compensation for client comfort.