Lately I’ve been trying to develop a RTS Multiplayer based game and I’ve read some stuff about how Age of empires multiplayer was done and some models of mutliplayer game and I’m quite worried if my model will work.
My idea was to have all the players host an instance of the game as client mode and the one hosting run two instances of the game, one as client like the others and one as server.
The server instance would receive all the commands or actions executed by the players and run the simulations (Like pathfinding, moving a unit, making a unit attack) and at the same time tell all the clients the coordinates (the state of the transform component) of all the units at all times, so basically only the server had the authority to move stuff around and the clients would only be able to see where the units are and select them to give them orders which are sent to the server and the server executes them.
At first I thought it would be a good model but then I realized it’s very bandwidth consuming and I’m not sure if it would work. Since it’s a RTS there could be 1000 units moving at the same time, meaning the server would be needing to send the position of 1000 * the amount of clients connected (Maximum 8 players) and the corresponding action they are performing in order to predict the animation. So it would be 1000 Vector3s * 8 times + a int of the action ID * 8, approx 32000 values per frame, meaning if server is running at 90 FPS we would have 2,880,000 values per second. Sounds like a great number to me but assuming we have a 1MBps minimum requirement bandwidth to play the game, would it be way too much data to be sent, or would it work?