Real Time Multiplayer Best way for pushing updates on android

五迷三道 提交于 2019-12-14 03:28:31

问题


I'm currently developing a Real-Time Multiplayer top down shooter. The Multiplayer is "working" and I'm currently struggling with pushing the player updates such as position and fired shots.

My first try was using the service "appWarp" which worked perfectly but isn't free and only provided around 2 Million Messages in the free version which i completely filled in around 2 weeks with only 2 devices and 2 players. ( Maybe way to much updates send )

Then I implemented Google Play Game Services and tried using this to send the updates:

  • I'm able to use "sendUnreliableMessage" for Position updates, which works faster than appWarp used to. I use interpolation to get over the package loss issue here which works alright.

  • But here the problem is with firing shots. The nature of UnreliableMessages is that packages can get lost, which happens a lot. Shooting 4 times only makes around 1 or 2 of them appear on the other device. Which means that 2 packages are getting lost. Using "sendRealiableMessage" i can achieve around 2-3 packages getting through but with, of course a higher latency. Which makes the shots appear after around 1 second on the other device.

For a fast paced real time multiplayer game this is not what i wanted to achieve.

So what is a better way to do this ? I found web based solutions like socket.io but don't really know which fits the best for my needs.

I found this website which contains a big list of every web based solution for this problem but don't really know where to start.

https://www.leggetter.co.uk/real-time-web-technologies-guide/#_hosted-realtime-services

I am really really thankful if someone could help me with this problem!.


回答1:


Since you're asking for opinion, I can suggest you try Multiplayer in Unity. It is the leading game engine as of today, so you can expect a huge support from a stupendous user-base.

Another option would be Photon. Hope these suggestions helps.



来源:https://stackoverflow.com/questions/39417074/real-time-multiplayer-best-way-for-pushing-updates-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!