I got some questions regarding the networking architecture on a game like this. I'm going to use RakNet and I'm pretty sure I will use a client-server approach. I got two different methods I'm considiring
- The only task the server has is to inform all clients when a client does something. The server don't have any World class, it just forwards the events to the client and let them update their own World.
- A client right clicks on the map to add a target to move to. The client then sends a package to the server containing the event id, client id and the target position. The server then only sends the package to all connected clients and let them handle it.
- The server contains a World class that gets updated when clients perform actions. This World then gets broadcasted to all clients frequently (how often?) and the clients then set the objects positions so they are the same as the servers.
- A client right clicks on the map to add a target to move to. It sends the event to the server who then updates it's World. The server does nothing more in this stage, the changes will get broadcasted to all clients in X ms.
This is just what I came up with after 1 day of researching and I would love if you could share things I should think about and general suggestion. How would you do something like this?