Search Unity

Authorative movement?

Discussion in 'FPS.Sample Game' started by Defiled, Nov 18, 2018.

  1. Defiled

    Defiled

    Joined:
    Feb 10, 2014
    Posts:
    43
    Does the current alpha have authoritative network movement? aka I can't just modify client to go faster on server / teleport / speed game up, if not is this coming in the future?
     
  2. AggressiveMastery

    AggressiveMastery

    Joined:
    Nov 19, 2018
    Posts:
    206
    I believe so as its said on the fps-sample page :
    "FPS netcode based on an authoritative server architecture"
    https://unity.com/fps-sample

    Which I think, makes the server control all 'network' updated items, such as player models across all connected clients. I think the clients only send movement request data to the host, and the host sends back network-update-able items such as player model locations back to all the clients (then showing you locally the movement you requested, once approved by the server/host.) Anything not needing to be networked (such as lighting data for the environment, particles that do not interact with network items, ect) would be computed locally on the client.

    So from clients POV, when you want to spawn in a new item (shoot a bullet), you use the console to spawn it at the server/host currently.... by clicking the fire button (request to create new item on the host) The host then sends down to all clients the information on the new net-workable item (your bullets.) So that agreement on the action you requested, is your point of anti-hack/authority. As I have read it...

    Here is the current documentation on the new networking tech that the FPS example is supposed to be running on I believe. >>I just found this, it has client and server code examples. So I have not read it yet. But have all this info I'm posting about from reading the other unity posts/documentation with the fps sample.
    https://github.com/Unity-Technologi...er/com.unity.transport/Documentation/index.md

    Now, the hard part about anti-hack, which is where I think you are heading, is that you need to define the limits and what to watch for in the code (how you update client movements, what input you accept/limit from them.) But the bulk lifting to get that communication (network) enabled, the unity gods provided us :D

    You will need to build your server-client rules to accept a limited range of inputs (such as 2 jump requests per second) from the clients, not an open range that would allow them to use a bot to jump faster than humanly possible (60 times a second, aka a flying hack.) The next Unity network update, will hopefully reduce the amount of clients that see one another (limiting wall hack over the whole server/all connected clients.) Right now, all clients get all network data, so at 16 players, the amount of network data shared for all 16 players takes up the bandwidth. The next update unity mentioned working on that issue :excited!:
     
    keeponshading and Defiled like this.
  3. petera_unity

    petera_unity

    Unity Technologies

    Joined:
    May 23, 2016
    Posts:
    41
    Yes the movement and everything else 'of importance' is server authoratatively handled. As AggressiveMastery describes, the clients sends 'commands' to the server which are basically keyboard and mouse input.

    We just recently released a talk I gave at Unite about how this works:
    take a look; I think it will answer some of your questions. Please come back and ask if anything is still unclear.

    Peter
     
    Defiled likes this.
  4. Defiled

    Defiled

    Joined:
    Feb 10, 2014
    Posts:
    43