Real-time multiplayer mobile game?

I just found that my phone is behind the udp symmetric firewall, which simply means that udp traffic is not possible. My 3g provider is t-mobile, which is one of the largest in my country. I suspect many other 3g mobile providers have udp restrictions.

I plan on developing the game in real time. udb seemed to be the right solution for moving fast, but I can't use udp because then I lose flexibility (playing anywhere, in many places without Wi-Fi) and a large audience (3g providers that block udp).

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

Is there an alternative? Or do you need to abandon the idea of ​​playing in real time through 3g?

+6
source share
2 answers

It is very difficult to achieve real time on the network with satisfactory latency for your game logic (especially if you make the game as a first-person shooter, you can read about overcoming some of the problems with the delay here: network physics ).

Speaking of the mobile network, it becomes even more difficult: Of course, you can make your life easier and use only a WIFI connection, but you will lose all users who want to play via 3G when there is no free WIFI connection (or they just got stuck with 3G -connection because they don’t know how to change to WIFI). If you decide to cover 3G and also welcome operators: no UDP, no sockets, no non-standard ports, no long timeouts and greetings, hello strange headers and hello strange proxies, now multiply them by the number of different operators around the world and Voila, you cover all their problems.

I'm not trying to scare you, just remember this during your implementation:
1. No sockets or the use of non-standard ports - sockets are not allowed by operators for obvious reasons, they don’t want you to take your resources, because during this time they could serve another payment client;) If your game logic allows this, try to implement the protocol without sockets.
2. Challenge your game with a few friends across the seas or use the crowd testing services that can do this for you. You can calibrate the delay through your own protocols.
3. Distributing your servers will greatly help with the latency problem.
4. Make sure that you do not send a lot of data over the network, be smart, be careful with the device’s battery.
5. Data compression!

For full disclosure: I work for Skiller and we provide a multi-user SDK for Android developers (among other things) with free tools such as social level, user management, income generation, etc. We saw a lot of problems with the multi-user network via 3G and we compensate for it with the algorithms that we wrote on the client and server side to simplify the life of the developers. If you want to try us: www.skiller-games.com

+3
source

There are some real-time cloud messaging services designed to adaptively work on many mobile platforms. In games, you often want to publish / subscribe, so you can look at http://pubnub.com They take care of your cloud infrastructure with 14 data centers, delay. Their APIs are ideal for games with secure and accessible APIs designed for this. They have a new API for synchronizing object data in beta, which can reduce encoding.

The key reason I like them is that they have been in business for many years, and therefore their APIs have been tested on most global 3G networks and corporate networks.

Other things you can look for include pusher.com and realtime.co, and the new service https://cloud.google.com/pubsub/ .

0
source

Source: https://habr.com/ru/post/887138/


All Articles