Jump to content
  • Advertisement
Sign in to follow this  
Browser12

Handling client input

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

[top-down real-time RPG] Hey, so I am looking to use UDP for my game wherever applicable. For example, I'll probably do the chat in TCP, but I'd send position updates to the clients via UDP. I'm aware of how/why fire-and-forget is fine for these position updates sent to the clients, but... My question is, do I need to use TCP for something such as players' movement requests to the servers? It's one thing, as a client, to miss a UDP packet that's specifying an absolute position, because you'll get one further down the line and you're probably simulating things yourself in the meantime anyways. But won't it cause ugliness if, say, the server misses the client's requested change in motion and ends up telling the client that its player object is in a position that they didn't ever intend to put it?

Share this post


Link to post
Share on other sites
Advertisement
TCP is one way, custom built protocol over UDP is another way.

If you go with latter, then you need to cover all potential problems yourself, either at network level, or at application level.

Quote:
But won't it cause ugliness if

It could, if designed improperly. There are many ways to tackle this problem, anything from time stamps, duplicated data, retransmit schemes, ... The details depend on which is most suitable.

Unless designing for LAN, I don't think fire-and-forget is viable, there needs to be some validation scheme in there somewhere.

Share this post


Link to post
Share on other sites
Just FYI, I got a cheap server running my multiplayer game and I'm using TCP, ping is about 25-35 milliseconds.
OK, farther away or on a big server load it would get worse but you always has to deal with high ping anyway.

I'd be you I'd go with the easiest protocol (except if you're a big company where others are supposed to do the work).

I don't thing UDP is really necessary for 'non-FPS' (and other twitch) games, but that's just my 2 cents.

HTH

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!