Events vs. state dumps (S2C)
Hi all, I am designing the network protocol for a 3D multiplayer space combat game. With regards to movement, client to server, we are sending out event-based information*. But server to client, should the server: a/ calculate the new game state (based upon the events input) and send out a new state-dump^ to every player? or... b/ relay the event information to every player instead? (optionally with an intermittent state-dump, to re-sync, in case the engine isn't as deterministic as we'd like :)) What are the pros and cons to each? Every networking article I've read chooses option B. Why? Does sending out complete state-dumps of every player, to every player, use less bandwidth than "just" relaying their input events? *(left roll, right yaw, etc.) ^(playerID, position, orientation, velocity, etc.)
Quote:
Original post by Viktor
This way the server can enforce the rules. (a client might choose not to process an input from another player, but if it gets a state update then all it can do is update it's own state)
So with option a, the server can enforce the rules better? How? A (presumably hacked) client can ignore a state dump just as easy as an input event, and the real game-state will always be protected on the server anyway.
For a fast game with relatively little state information (eg, an FPS), sending out a state dump, or as Viktor said, a differential state dump, is probably better than sending out an event list, because state-dumps don't require a reliable connection: If a client misses a state message, then it will only be out of sync till the next state arrives, which likely won't be very long (and good client-side prediction can help to mask the effect).
For a game like an FPS, a state-dump can be kept quite small, likely no larger than a set of events (especially since events will occur at a high frequency in a fast action game), so there is little advantage in using an event-based system.
For a slower game with more state information (eg, an RTS), a state-dump would be far too large, so a deterministic engine, and reliable event-sending mechanism must be used.
John B
For a game like an FPS, a state-dump can be kept quite small, likely no larger than a set of events (especially since events will occur at a high frequency in a fast action game), so there is little advantage in using an event-based system.
For a slower game with more state information (eg, an RTS), a state-dump would be far too large, so a deterministic engine, and reliable event-sending mechanism must be used.
John B
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement