Synchronized networking

BlitzMax Forums/BlitzMax Beginners Area/Synchronized networking

ima747(Posted 2011) [#1]
Doing some research on synchronizing a networked game and wondering if anyone has any good references or best would be working examples in bmax I should take a look at.


Oddball(Posted 2011) [#2]
What kind of game is it for? GNet does an ok job with simple action based multiplayer games. There is a GNet example game in the BlitzMax samples.


ima747(Posted 2011) [#3]
Nothing specific, and in fact I will likely be writing network code in other languages for other platforms, but Bmax is always my go-to for learning new concepts because the language never gets in the way (simplicity is bliss when learning).

Looking for something that illustrates concepts, rather than something practical for real world implementation.


Czar Flavius(Posted 2011) [#4]
There are two kinds of multiplayer game. The kind where there is little information to send quickly, such as an arcade game or FPS game. The client sends all data regarding the player (position etc) to the server, which sends all data regarding other clients. The client can extrapolate between updates the movement of other players to make the game seem smooth.

The second is the game with a lot of information that changes slower, such as an RTS game. If you want hundreds of units it's just not practical to send all that data continiously. Instead, you setup all clients on the same initial state (same map, same random seed etc). Each client then runs its own game simulation, and transfers only things that need to change, such giving units orders. So there will be a transfer to the server to order the units to move in a few frames time and the server will relay that order to all clients, confirming it with the source and informing the other clients. Those units then start at the same time on all clients. Each client pathfinds and updates the units carrying out the order in the exact same way, so no other updates need to be sent. Hundreds of units, low bandwidth!


ima747(Posted 2011) [#5]
Thanks, but looking for more nuts and bolts for time sensitive data, example: multiplayer action game, each player can jump and shoot on their own and bullets need to be tracked etc. Would like to see a working examples of various methods for keeping the game world in sync across multiple clients and the server, such as delayed triggering, even key timing, etc. there are plenty of ways to do it, but something between a lib/mod that does it for you, and purely theoretical "you give an execution time buffer for the event sent" would be lovely.

Plenty of theoretical documentation on various methods can be found (e.g. http://www.mine-control.com/zack/timesync/timesync.html) and there are some fantastic mods that do it, but how do you get from the theory to the code inside the mod (without having to tear down a whole mod just to find something related to syncronization...).

Example: how would one go about making a simple light-cycle duel style game without using a network mod. The game itself is very simple, if the player crosses a line they lose, everything is a simple grid, etc. but how do you keep player A and player B in sync, a fraction of a second difference in this type of game is the difference between winning and losing... dead reconing provides a pretty good handle on what happens between updates, but its the updates themselves (such as "hey the other guy just turned right!") that make all the difference...