Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Best 3rd Party solution for real-time multiplayer shooter in WebGL?

Discussion in 'WebGL' started by AnthonyPalma, Nov 22, 2019.

  1. AnthonyPalma

    AnthonyPalma

    Joined:
    Aug 11, 2013
    Posts:
    128
    Hello everyone!

    I'm working on a real-time multiplayer shooter in WebGL, and since web protocols/features change so rapidly, I wanted to ask: what is the best solution in 2019 for building a real-time multiplayer game (probably authoritative server) in WebGL that also has a Unity integration?

    I used PUN in a different project in 2015, but their pretty basic implementation of WebSockets left a significant amount of delay back then. Has PUN gotten better for WebGL builds? Or is there another solution you all would recommend? What about Multiplay, does that work in Unity WebGL?

    I'm not much of a back-end coder, so ideally I'm looking for a 3rd party implementation that doesn't require me to manage my own AWS server stack. PUN, for example, handles server scaling automatically, so that setup is an ideal solution for me if it's somehow cleaned up the latency issues in its WebSockets implementation. WebRTC looks like it's more for P2P networking, unless there's a way to utilize it to build an authoritative server implementation. www.geckos.io seems like a more DIY solution, while HumbleNet and PeerJS are more focused on P2P.

    Thanks in advance!
     
    Last edited: Nov 22, 2019
  2. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    633
    WebRTC data channels is still the theoretical best solution in browsers, since that gives you UDP-like communication without head-of-line blocking that WebSockets as a reliable ordered channel suffers from. WebRTC does not strictly need to be P2P, although it is very much focused around P2P in its design, as is HumbleNet. It looks like HumbleNet has had some recent improvements to it ( https://github.com/HumbleNet/HumbleNet/commits/master ), might be worth pinging the author for usage steps.

    There are proposals for bringing UDP-like networking to the web in the future, one prominent draft that is in process is based on QUIC transport (spec draft at https://tools.ietf.org/html/draft-ietf-quic-transport-24 )
     
  3. AnthonyPalma

    AnthonyPalma

    Joined:
    Aug 11, 2013
    Posts:
    128
    Thanks, @jukka_j - I'll keep looking around and see what I can figure out. I did read about QUIC in the past, but even if it rolled out, admittedly I'm pretty green when it comes to netcode, so not sure how well I'd be able to deliver. Might be stuck with either PUN (WebSockets) or geckos.io (DIY stacks) for the time being.
     
unityunity