Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Discussion Are Authorative servers actually necessary for browser based games?

Discussion in 'Multiplayer' started by Rafael-Barbosa, Sep 9, 2023.

?

Would you use an authorative server for a browser based PvP game ?

  1. Yes, while it increases scope, it is a requirement for games like these

    0 vote(s)
    0.0%
  2. No, the added scope isn't worth it and the game can work just fine without it

    0 vote(s)
    0.0%
  1. Rafael-Barbosa

    Rafael-Barbosa

    Joined:
    Apr 14, 2013
    Posts:
    288
    Hey everyone,

    So I develop browser based games for websites like Crazygames, Poki, Kongregate and a few others. I've been wanting to create a multiplayer game but had to cut the main PvP part because I was afraid that an authorative server would be too much scope for me at the moment, but I've been thinking a lot about this and have been considering that maybe I am over reacting.

    I was wondering if this is actually a requirement for browser based fps games like that. These games usually have relatively small playtime compared to Steam games and I suspect that the userbase isn't as technical meaning that a very small portion of the playerbase would be a possible threat.

    What do you think? If you have any experience to share, that would be a giant help!
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    No experience but just one thing to call out first in case you weren't aware: you do have to have a dedicated server for Web-based multiplayer games regardless. You cannot have a player host a game from within the WebGL app.

    I guess with this audience and considering casual play you may actually do better with client authoritative actions because for local players this will feel more reactive. And I agree with the less technical players but also specifically because of the tech stack (you cannot simply analyze the executable of a WebGL app as you could with a desktop app) cheating on that level shouldn't be a big issue.

    However with client authoritative actions come some issues in regards to physics: every client would have to simulate physics locally, and the local physics world state synchronizing to other players will cause weird physics behaviour in their world. Objects may snap back, jitter, teleport back and forth, push other objects with extreme force, missed collisions and so on. This is so bad, at least for current NGO versions, that you cannot use client authoritative physics unless you keep the physics totally local for effects (eg turn-to-ragdoll upon death).
     
  3. Ikik

    Ikik

    Joined:
    Oct 19, 2012
    Posts:
    22
    You can do client hosting w/ webGL now. I don't know when it changed but I was running a test project using relay and webgl and it worked fine w/ the latest experimental packages.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    You have to be using relay for this to work though, I assume. Since there‘s no way to directly connect to a browser app for security reasons.
     
  5. Rafael-Barbosa

    Rafael-Barbosa

    Joined:
    Apr 14, 2013
    Posts:
    288
    How did you setup a relay server? I did quite a few searches about this a few years back but couldn't find any easy to follow source.