Jump to content
  • Advertisement
Sign in to follow this  
DanielH

Desync

This topic is 5390 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

So I'm working on my first network game and I'm using TCP. It's a netmaze clone. Netmaze is a game where the players control a tank that moves on a grid. The tanks always moves as long as they doesn't collide with a wall. I send the tanks coordinates everytime they move one square. Before I only sent that data when a tank turned or stopped, but for some reason it all got messed up with diffrent positions on server and clients... The movement is very choppy even on a LAN. I can't understand that... With a constantly low ping I would thought it might jump a little at turns since it would be a little bit off sync with the server but not else.

Share this post


Link to post
Share on other sites
Advertisement
Hi daniel,

From your description, I'm still not sure if your game is turn-based or realtime. If it is realtime, you may want to consider switching protocols (ie. use UDP). This way, you don't have to eat up your bandwidth with all the TCP retransmission stuff.

But, you did say that you tried it on LAN and it still doesn't work. With typical LAN pings, it shouldn't be jerky at all (at least in my tests). Perhaps your code is sending out packets too much and not "every time they move one square". In the past, I've found that odd jerky behaviour on low ping settings is the result of my code flooding the client or server with packets.

btw, how often is it that a tank will move one square?

-j

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!