🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Seek advice on a multiplayer text finding game

Started by
0 comments, last by hplus0603 7 years ago

I have developed http://bugwars.xyz/ , a multiplayer word finding game.

The players have snake like structure, who fight each other in a grid based arena. Basically they find words in the grid and grow.
Both snakes move 1 cell in grid every 300 ms. The movement of both snakes is broadcasted to both the players in one message, so that both of them move one cell at a time in a player's screen.

I feel its very important that both the players have knowledge of true position of each other.
What happen is sometimes, player presses a key to turn the snake just before wall/other snake and before it reaches the server, The server marks the player dead.
So player pressed the key before he was dead according to him, but he died the time his message reached the server. Its classic problem of lag compensation.

It seems very complicated to solve this, with providing true position of both the players to each other all the time. Or shall I just ignore it, as snake moves a block every 300 ms, and thats a lot of time.

The server is hosted in Eurpope, please try it on your deskop browser and let me know

Advertisement
If the player snake can collide with the other player snake, there is no way to 100% solve this problem.
However, you should be able to let the player pre-simulate their own snake, and have the server verify the move; this means the local player runs "ahead" of the remote player.
There is still player/player collision problems in this model, especially with the remote player's "head" as opposed to "tail," that you will have to solve somehow.
Typically, this is done through gameplay design, or through re-simulation and letting a player die even when initially it seems like they would live.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement