• Advertisement
Sign in to follow this  

For casual multiplayer mobile game which protocol to chose UDP , WEBSOCKETS , TCP? please from experience. No problem in implementing

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

i want to implement simple casual MMO game like the io games .
only from mobile , using native engines .
now i have all framework setup using websockets . BUT
as we all know websockets are TCP and not much Efficient comparing to UDP datagram but i have no knowledge how about UDP and networks and firewalls .
is it more restricted then websockets do i expected to have problems with WIFI?
there are trade off should i stay with websockets ?

Share this post


Link to post
Share on other sites
Advertisement

TCP is perfectly fine for a casual MMO game. You don't need UDP. Stay with websockets until you have proof that you have a problem.

Edited by Kylotan

Share this post


Link to post
Share on other sites

Thanks for answering , i know that udp is the fastest , but i worried about casual users Those that play games while in the toilet at work or in hotel vacation and using hotel wifi , you know super casual . the question is can i stay with websockets ? or use TCP 

Share this post


Link to post
Share on other sites

nowdays a lot of providers and routers simply filter the udp out.


That is not true.

However, TCP can be fine for an MMO. IIRC, both EverQuest and WoW use TCP.

It's more important that you make efficient use of bandwidth, and group messages into packets that you schedule a few times per second.

Share this post


Link to post
Share on other sites

TCP and not much Efficient comparing to UDP

On a reliable network, the difference in efficiency between UDP and TCP is generally negligible.

If you expect severe packet loss, TCP can end up in a situation where it isn't making much forward progress. Which is where UDP can be preferable. But, whatever reliable UDP layer you build is going to run into similar problems delivering your control messages (even though many game packets can be sent in unreliable mode, some will still require acknowledgement) - UDP protocol design is a pretty advanced topic.

To obtain the best performance from TCP, make sure you disable Nagle's algorithm (the TCP_NODELAY socket option). This one setting is usually to blame for most of the apparent performance difference between TCP and UDP.

Share this post


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

  • Advertisement