I’m developing an online multiplayer game.
for the server side, I’m using socketIO to send or receive data from clients.
since I have to send every player’s position to the server, I need to find a way to reduce the network load.
and the alternative way to implement this is to run an instance of the game on the server, and let it play the game and send all the data to players.
The answer to your question varies depending on what you are trying to achieve on the server-side of your multiplayer game. Are you making a game that needs server-authoritative multiplayer where the server must validate each action the player does? Or Are you simply building the server to relay information to other players?
If you’d need to validate the players’ actions, especially their movement through the world, you typically need to run a simulation of the match or a subset of it. Some do this with a headless Unity instance. This is non-trivial and will get quite expensive to operationalize. I would personally hesitate to make the game’s physics simulations server authoritative - other actions like updating level info, or gems, or in-app purchases are much easier to develop.
There are various server softwares that can act as message brokers in your multiplayer game and multiplex the match information between the match participants. Some use JSON data to represent player action, some use a binary protocol (like Protocol Buffers) that they compress to decrease the bandwidth. Have a look at this code example for a way to represent data in the Protobuf format. This should lower the network load on your server.