🎉 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!

Network synchronization for FPS style game

Started by
1 comment, last by Ploppy_ 7 years, 5 months ago

Hello,

First of all I'm not English, so please, forgive me.

I'm pretty new to multiplayer games. I've read tons of documents about it but I still have questions.

The latest topic was on this forum, and had many answers for me (https://www.gamedev.net/topic/683580-server-client-ticks-lag-compensation-game-state-etc/).

My current project is designed this way:

  • When a player connects, he receives the current tick from the server.
  • Server then receives commands from this new player and ask him to adjust his current tick so that the server receive his commands 'just in time'.
  • In my current project, the server asks a client to sync again as soon as the tick received from the client's command is different than serverTick + 1.

This seems to work pretty well.

But what can I do when user's commands are too late ? If I simply discard them, I'll probably run into problems.

Someone on the Discord chat told me to simply execute the outdated commands when they arrive.

In order to interpolate the positions of my entities I have a renderTick variable. How do I calculate this renderTick variable ? Should I simply adjust it as the time goes on similarly to the client tick ?

I've read in many places that the only solution for an authoritative server to know if a player shot another player is to recreate the game from the player's perspective to see if he actually shot the other player. So... Should the server know about the renderTick of the clients ?

Thank you very much.

Advertisement

watch this

http://www.gdcvault.com/play/1014345/I-Shot-You-First-Networking

Thx, I'll look into this.

This topic is closed to new replies.

Advertisement