3 ms·
It's not that networking is really hard, it's that development of synchronized games that run over unreliable links is really hard. If you want a simple soluti
by Animats 11y ago
It's not that networking is really hard, it's that development of synchronized games that run over unreliable links is really hard.
If you want a simple solution for a simple game, here's one. Use a fixed-format UDP packet to pass current location and orientation of the player and whatever else changes rapidly. This should be stateless; if you lose a packet, the next one has a full state update. This is enough for a simple FPS game.
Anything else goes over one or more TCP connections. If you have to load assets (level maps, textures, etc.) just use HTTP over TCP, which means you get to use standard servers and client software for that stuff.
If your game is too complex for that model, you're probably going to have to do some serious thinking about distributed synchronization.
- jstimpfle 11y ago> This should be stateless; if you lose a packet, the next one has a full state update. This is enough for a simple FPS game. Also enough considering packet reordering? And corruption?
- Animats 11y agoIf you get a bad packet, the problem will disappear when the next one comes in.
- callesgg 11y agothe next packet should come within a few milliseconds so yes. but I see your point adding a simple counter might be somewhat useful ignore any packet that has a Lower counter value. coruption there is generaly enogh checksums in earlier layers so that it is neglisheble.