4 ms·
This is a random question, slightly off topic, but I was looking at the No Man's Sky videos and wondered how video game programming worked with regard to a serv
by emehrkay 11y ago
This is a random question, slightly off topic, but I was looking at the No Man's Sky videos and wondered how video game programming worked with regard to a server and interfacing with multiple users at once. Does the team design the game to run on the console and also a version to run on the server or is it two separate applications each with its own set of business rules?
- aaronjb 11y agoIt will vary based on the game but generally servers would simply store data and verify inputs to make sure the clients are in sync and haven't been hacked for example. The clients get sent data like all of the players positions and update their internal state based on it. No Man's sky probably does a lot more server side, as the world is persistent for everyone.
- hacker_9 11y agoDepends on the architecture. If the game has dedicated servers, then they will built 2 separate pieces: 1. The game they ship to the client and 2. The server software which receives messages from the client and propagates world changes to all clients in the same game session. If the game is PvP (like most xbox games), the there is only the single game, and a 'host' is chosen to act like the server above. This can lead to problems though like host advantage [1], so the networking logic has to be carefully designed in order to mitigate this effect. [1] http://gamedev.stackexchange.com/questions/73302/is-host-advantage-real http://gamedev.stackexchange.com/questions/73302/is-host-adv...
- clevernickname 11y agoPretty sure you meant P2P, not PvP. You can further split the first option into two approaches. You can have a glorified dumb client, in which case most of the logic is in the server. This works well for turn based games. For action games, however, there is a lot of undesirable latency in this design, so these games replicate most of the logic in the client so that the client can predict how the game state will advance in time. This makes it appear to the player that there is no latency. There is still one authoritative server, however, be it a dedicated server or a "host" player. As you can imagine, programming a system that can handle prediction errors and juggle multiple out-of-sync clients is challenging.