Search Unity

Question Options for an authoritative server for a physics-based shooter?

Discussion in 'Multiplayer' started by Arrhythmia, Oct 29, 2021.

  1. Arrhythmia

    Arrhythmia

    Joined:
    Mar 1, 2020
    Posts:
    6
    I've been looking for options for days now, what I've found so far is:

    • Mirror can have an authoritative server, but only has TCP support and no UDP, which isn't ideal for a fast paced shooter game.

    • Netcode for GameObjects has so little info for a beginner like me, I don't even know if it supports dedicated servers. (Also it's still in development, and is only recommended for testing purposes.)

    • Most (if not all) Photon solutions that support authoritative servers need you to use their hosting services, which isn't ideal.
    I even tried following a tutorial to make my own dedicated server using raw C#, but I stopped at the point I realised it won't be using any actual physics. I need to use Unity physics for my game, it involves a Rigidbody movement and such.

    I apologise if there was something wrong about what I've found so far, I'm not too experienced in anything related to Networking.
     
  2. DiegoSynth

    DiegoSynth

    Joined:
    May 12, 2019
    Posts:
    8
    Hi! We are both in a similar boat here.

    Very poor, almost non-existent documentation.

    I'm trying to make a separated client-server (not dedicated, but still separated logic) project. Asked for ideas / examples / docs a week ago and not a single answer. I'm also VERY concerned about rigid body / physics, as I've seen in NetCode u basically "tag" functions to execute in server or client, but you can clearly not use that in our case.

    I have read that you can actually write the client and the server in different scenes, or even have independent projects for each, but the prefabs must match. Someone mentioned he/she has also developed the server part in pure C#, and has the client part in an Unity project connecting to it.

    To be honest, I don't expect anything from Unity in order to help with rigidbodies / physics (there's a NetworkRigidBody, but again, I don't think it would work for us). I'm thinking about having the client just sending the controller inputs and the server processing the physics (RigidBody), collisions, transforms, etc. Then sending the new data to the client to update the visuals. Lot of manual work, but I can't see another way out.

    I'm sorry I cannot really be of help, but hopefully you may get some ideas out of what I wrote. I'd love to have some basic examples / tutorials on how to do this in different scenes or projects, but I guess no one will care to share. The pure C# server is doable, but it's kind of a pain / no go.