Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Realtime multiplayer game over mobile network?

I just discovered that my phone is behind a symmetric udp firewall, which simply means that udp traffic is not possible. My 3g provider is t-mobile which is one of the biggest in my country. I suspect that many more mobile 3g providers have udp limitations in place.

I'm planning on developing a realtime game. udb seemed to be the right solution for quick movement, but i can't use udp because then i lose flexibility (play anywhere, many places with no wifi) and a big audience (3g providers which block udp).

Mobile networks like umts and 3g have high latency, so tcp (with resending lost packets, and queuing) is not ideal solution.

Is there a alternative? Or should drop the idea of a realtime game over 3g?

like image 427
T. Akhayo Avatar asked May 02 '11 18:05

T. Akhayo


1 Answers

It is very hard to achieve real time over the network with satisfying latency for your game logic (especially if you are making a game like first person shooter, you can read about overcoming some latency issues here: networked physics).

When talking about mobile network, well, it gets even harder: Of course you can make your life easier and cover only WIFI connection, BUT you will lose all the users that want to play over 3G when no FREE WIFI connection is available (or they simply stuck with 3G connection because they don't know how to change to WIFI). If you chose to cover 3G as well welcome to the operators hell: no UDP, no sockets, no none-standard ports, no long timeouts, and hello disconnections, hello strange headers and hello weird proxies, now multiply it by the number of different operators over the world and Voila' you cover all their issues.

I am not trying to scare you, just remember these things during your implementation:
1. No sockets or usage of none-standard ports - sockets are not allowed by operators from obvious reasons, they don't want you to take their resources because during that time they could serve some other paying customer ;) If your game logic allows it, try implementing the protocol without sockets.
2. Test your game with a couple of friends over the seas or use crowd testing services that can do it for you. You can calibrate the latency through your own protocols.
3. Distributing your servers will greatly help with the latency issue.
4. Make sure you are not sending a lot of data over the network, be smart, be gentle with the device's battery.
5. Compress your data!

For full disclosure: I am working at Skiller and we provide multiplayer SDK for Android developers (among others) with free tools like social layer, user management, revenue generation etc... We saw a lot of issues with multiplayer over 3G and we compensate it with the algorithms we wrote on the client and server side to make developer's lives easier. If you want to try us out: www.skiller-games.com

like image 189
MikeL Avatar answered Sep 22 '22 19:09

MikeL