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

Question Unity Multiplayer 120+ms ping two builds on the same computer.

Discussion in 'Multiplayer' started by IntoTheSoul, Jun 16, 2023.

  1. IntoTheSoul

    IntoTheSoul

    Joined:
    Oct 31, 2018
    Posts:
    29
    Title says it all.
    computation for ping:
    Code (CSharp):
    1.  
    2. NetworkManager.Singleton.LocalTime.TimeAsFloat - NetworkManager.Singleton.ServerTime.TimeAsFloat
    3.  
    Server/Host: 0ms
    Client: 120+ ms
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    Not sure if this is a true measure of ping.

    And the background app might be purposefully slowed down since it's in the background. It does happen with the editor playmode for example.
     
    IntoTheSoul likes this.
  3. IntoTheSoul

    IntoTheSoul

    Joined:
    Oct 31, 2018
    Posts:
    29
    Thanks for the reply. Both instances of the game ran on two builds. Editor was closed while running (this is what i suspected at first). the game feels like it had 120ms ping.
     
  4. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    327
    IntoTheSoul likes this.
  5. IntoTheSoul

    IntoTheSoul

    Joined:
    Oct 31, 2018
    Posts:
    29
    Hi there! thank you for the reply.

    Our current tick rate is at 30. I will be experimenting on checking my ping in a new scene with bare network objects. I suspect the amount of network objects in the scene might have something to do with the delay. Otherwise, i cannot think of any other reason as to why this is happening.

    However, if you don't mind me asking, I am quite curious. how much of an impact does network prediction provide for a game in comparison to setting up a dedicated server? My friend and I argued about this. I told him that, he should not worry too much about doing network prediction to enhance player experience from the massive ping as we have not yet setup a dedicated server. I find it unnecessary at the moment. I would love to hear your profession thoughts on the matter.
     
  6. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    327
    I suppose it really matters what you are trying to predict. If you are creating a combat game and important elements of your gameplay are behind based on user ping, I'd say that is probably a deal breaker as a player.

    If you mean prediction for little things like picking up a piece of fruit on the ground and waiting for the server to remove the object, who really cares if it's immediate or takes 100ms.

    The scenario matters a whole lot to be honest; ideally fake as much as you can only using prediction where you really need it. This will create a much easier to work with code base and less burden on the client/server.

    Not sure what you mean by this though sorry, "how much of an impact does network prediction provide for a game in comparison to setting up a dedicated server"