Super simple multiplayer that works only with input

Hi there,

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 help!

Cheers Tim

It’s simple…

Create input data on the client
Send it to the server
On the server, accept the client’s input and apply it
Send the result to the client

More information can be found here Source Multiplayer Networking - Valve Developer Community

1 Like

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?

Thanks again!

Cheers Tim

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

Read carefully, everything is explained in detail, the main thing is to understand how to implement it
https://www.gabrielgambetta.com/client-server-game-architecture.html

1 Like

Thanks, I‘ll give it a shot!

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.

Here are some useful references:

Overwatch Gameplay Architecture -

1 Like