Search Unity

Question What is the best option for WebGL Multiplayer?

Discussion in 'Web' started by PixCave, Nov 3, 2023.

  1. PixCave

    PixCave

    Joined:
    Oct 4, 2018
    Posts:
    35
    Hello everyone, I'm making a 2D fighting game. I will publish only for WebGL. I used Photon PUN2 and Fusion, but their WebGL performance is terrible. Characters move by teleporting in WebGL. I researched Quantum but didn't understand anything. What is the best option for Multiplayer in WebGL with matchmaking system?
     
    Last edited: Nov 3, 2023
  2. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    I use PUN since 10+ years and with WEBGL since many years and it work fine.
    You should try to check if it's not your game that need to be optimized before claiming that service is not working.
    I know also a lot of games that use Photon services with WEBGL and it's working fine .....
     
  3. PixCave

    PixCave

    Joined:
    Oct 4, 2018
    Posts:
    35
    It works fluently on all platforms except WebGL with Photon Fusion. In WebGL, there is a problem with the synchronization of transform.positions. The characters move forward as if teleporting. There is no problem with the optimization of the game. If there is a 2D sample project that works smoothly in WebGL, I would appreciate it if you could send me the Github link.
     
  4. PixCave

    PixCave

    Joined:
    Oct 4, 2018
    Posts:
    35
    Mirror vs Fishnet vs Other? What is the best for WebGL?
     
  5. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    You could try contacting the authors of PUN2 to see if they might be able to offer profiling tools to help figure out what causes the bad performance.

    Maybe they'll be able to offer tooling to tell if it might be a limitation caused by web browsers, or their plugin, or a problem of attempting to transferring too much data over the wire.

    I believe the current set of networking plugins essentially all utilize WebSockets as the transport layer. (WebRTC is considered very complex to be worth it, and WebTransport is not yet 100% widely supported by all browsers). So it could be a performance issue between WebSockets (which builds on top of TCP) vs native UDP, for example.

    But hard to say, maybe profiling tooling from the vendor might help there.