Jump to content
  • Advertisement
Sign in to follow this  
MikeDee

Lag and shooting

This topic is 3327 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, I'm working on a online FPS. I'm having a problem with lag, whenever the server lags and the player shoots at the enemy but the enemy is already somewhere else, it will still cause damage. How do I avoid this ?

Share this post


Link to post
Share on other sites
Advertisement
Network programming, and in particular lag compensation, is really more art than science. The fact is, the nature of the internet, or any network, is unpredictable. You can't create a system where the player has to compensate not only for their delayed (and possibly incomplete) perception of the world, while simultaneously trying to compensate for an unpredictable network.

In an online shooter, the way things really work are somewhere between "perfect" accuracy, and what the player perceives. The server basically has to somehow take into account the picture of the world that the player has when deciding whether their shot was accurate. A little fudging is common, if not necessary. You have to also balance that with the "reality" of what the server knows. If you allow too much fudging on accuracy, then its not fair to the player being shot at (who might think he's hidden behind a rock), but if you don't fudge it a little bit, no shooter will be able to anticipate the correct lead, and all your players will be frustrated.

Here's an article that tells a little bit (high-level) about how Halo 2, which supports internet play, works, and how it differs from Halo 1, which only supports LAN play.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!