This is a discussion on Re: Multiplayer Game lag Issue - Java-Games ; "L****a" <l****a@l****a.com> writes: > Hello. > > I am interested to know who people handle the lag problem in multiplayer > game. > As near as I can figure, you can do one of two things. 1) Ignore it. People ...
"L****a" <l****a@l****a.com> writes:
> Hello.
>
> I am interested to know who people handle the lag problem in multiplayer
> game.
>
As near as I can figure, you can do one of two things. 1) Ignore it.
People with high bandwidth get to enter more commands, it's a tough
life. 2) Make your game run as slow as the slowest connection. Keep
a tally of how often people are sending in requests for action on your
part, or ping them regularly for statistics, and slow the game down
depending on how slow the players are. Doesn't have to be the lowest
common denominator either: you could make your game go as fast as the
average of all the connection speeds.
Depending on the game, #1 might actually be a valid option. In online
text based games, often trying to synchronize according to bandwidth
is a waste of time. The code I have looked at just synchronized once
a second, which is abhorred and impossible for a FPS game, and not
received without complaint by people playing text games, but for the
most part not worth the trouble of getting rid of.
With #2 it's going to take a little more memory and process time, and
a bit of tricky programming; I would aim for a very rough estimate at
best, since accurately measuring every byte downloaded wouldn't pay
off in the end.
Starling