How to create smooth network for real time action game ?

My previos attempt was to synchronize all the clients, so each client program won’t progress to the next game frame unless
they received a message from the server. It worked in Lan computers, but it became unplayble when I tried with my firend overseas
(had about 5 frames per second).

I guess the synchroniztion method i used really sucked, but I can’t think of any other way to do this. Anybody got better idea?

Hi,

I tried a different approach here which worked pretty well over the internet:

http://www.java-gaming.org/index.php/topic,18019.0.html

Also, search the posts of Kev Glass and his Mootox game which used a nifty approach to smooth network sync’ing. It’s a pretty hard topic, by the way :slight_smile:

Keith

It also makes sense to put the client’s actions into a list, so that whenever they try to do something their action gets added to this list, which gets sent to the server periodically. Because of the nature of lag spikes, the server will receive the list irregularly, and as a result must intelligently decide how many queued actions it should execute based upon how long the latest lag spike was, as well as the client’s fps vs. the server’s fps (if the client is going twice as fast, then only half of their movement should be considered by the server).

This approach is typically good for movement, whereas it might get hokey for bullet firing and the like. It is usually okay however if you restrict less common actions (like jumping, or bullets, or whatever) until the server has received the message and sent it back, and the lag won’t seem too bad.

Hi Keith I looked at your post, and I didn’t quite get the conept, it is indeed a complicated topic. However the game application looks awsome,
I wonder if all the client are synchronized such that they all see the same world in every game frame?

Yeah I found that keeping an event list was a good idea too.

Thanks!
Unfortunately it’s impossible to sync every client every frame when there’s lag, that’s what makes things so tricky

If you want to make an FPS, try searching the way quake does it, that seems to be a popular method. I’ve read how they do it a few times but it never stuck in my head. it’s something about sending acknowledgements all the time and I believe they use UDP rather than TCP.

If you’re interested in the way I’ve done my little game, i’d happily try and explain. One day I’d like to make a little simple example game out of that project.