Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Reduce Server-Client latency and game fluidity

Discussion in 'Netcode for GameObjects' started by Padrox_, Aug 19, 2023.

  1. Padrox_

    Padrox_

    Joined:
    Jun 12, 2021
    Posts:
    20
    Hey there,

    I'm learning NGO seems approximately one month and I'm making a remake of Pong.
    I already made the game for Singleplayer against an AI and I started over to make it work with Multiplayer.
    I have the PlayerPrefab with client-authorative movement: I use its Rigidbody2D.velocity to move the player and the Client Network Transform from Network Tools to sync the position of the player with the Server.

    It works fine but it seems there is so lag, because in my game the velocity doesn't build momentum, it is instant.
    The issue I'm encountering is that I have the ball, and it is Server-Authorative, meaning that when you're the host, the game works well but as a client there is a terrible delay.

    Honestly, I'm not sure how to reduce this delay as much as possible to make it enjoyable as a client.
    I thought of different ideas such as making the movement Server-authorative, spawn a ball for every client that handles itself, or even making a ball per client and verify with the server that it is where it should be (to avoid having the ball at the total wrong place for one client).
    I wanted to ask it on the forum because I lost a bunch of time trying solutions, I haven't tried the last one I talked about at the end of the post. If you have any suggestion I would be pleased to hear them.

    If you need any further information, don't hesitate to ask me,
    See you soon,
    Padrox