|
|
Actually, synching-up 2 computers over a network is an old problem, and there are many different approaches to it. However, there is a specific solution for twitch games that I think is interesting; besides, I think that there's really no better way to deal with the problems this solves.
You have to admit that the data won't be transfered instantly no matter how fast the connection is. This delay is a bit inconstant with all the problems involving transfer over wires and stuff, and inconstant delays are what annoys players so much - in a twitch game you're supposed to be accurate to the milisecond. So it's wise to introduce a constant delay for every action that a player takes. If this time compensates for most fluctuations in transfer time, you have a pretty solid system - the players will feel like the game is not so responsive but it's generally easier to get used to than inconstant lag. The implementation is simple, whenever you send a packet, it should contain a timestamp for when to activate it, 200ms from then or so. I've seen some docs from the creators of Age of Empires and Age of Mythology, they used this in their games, and I'm surprised it wasn't used much in other games. These are strategy games but you can see its benefits for twitch games, like I pointed above. There's more to this, and I'd like to see some discussion of this technique... I hope it helps!
|