Real Time Multiplayer在Android上推送更新的最佳方式 [英] Real Time Multiplayer Best way for pushing updates on android
问题描述
我目前正在开发一款实时多人自上而下的射手。
多人游戏正在工作,目前我正在努力推动玩家更新,例如位置和开枪射击。 我的第一次尝试是使用服务appWarp,它完美的工作,但不是免费的,只提供了大约200万条消息在免费版本中,我完全填充2周仅有2个设备和2个玩家。 (可能会发送更新消息)
然后,我实施了Google Play游戏服务,并尝试使用它来发送更新:
-
我可以使用sendUnreliableMessage进行位置更新,它比appWarp以前的运行速度更快。我使用插值法来解决包装丢失问题,这里工作正常。
但是这里问题在于射击。 UnreliableMessages的本质是包可能会丢失,这种情况发生了很多。仅拍摄4次只会让其中的1或2个出现在另一台设备上。这意味着2个包裹迷路了。使用sendRealiableMessage我可以实现大约2-3个包,但当然会有更高的延迟。这使得这些镜头在其他设备上出现1秒左右后就会出现。 对于一款快节奏的实时多人游戏,是不是我想达到的目的。
那么有什么更好的方法来做到这一点?我发现了基于网络的解决方案,比如socket.io,但并不知道哪种解决方案最适合我的需求。
我发现这个网站包含了这个问题的每个基于web的解决方案的大列表,但并不知道从哪里开始。
https://www.leggetter.co.uk/real-time-web-technologies-guide/#_hosted-realtime-services
code>
如果有人能够帮助我解决这个问题,我真的非常感谢!
由于您要求提供意见,因此我建议您尝试 Unity中的多人游戏。截至今天,它是领先的游戏引擎,所以您可以期待来自庞大的用户群的巨大支持。
另一个选项是 Photon
一>。希望这些建议有帮助。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!.
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.
这篇关于Real Time Multiplayer在Android上推送更新的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!