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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[Netcode] Network Config mismatch error but nothing have changed

Discussion in 'Netcode for GameObjects' started by adibnafisudin, Mar 29, 2023.

  1. adibnafisudin

    adibnafisudin

    Joined:
    Sep 3, 2021
    Posts:
    4
    Hello, I have this error where the game network via Unity Relay have network config mismatch when yesterday this error have not appear and the networking run just fine. I'm following tutorial from code monkey unity relay to setup the Unity Relay other than that, no other script that changes Network Manager.
     
  2. HarambeIsAlive

    HarambeIsAlive

    Joined:
    May 17, 2017
    Posts:
    2
    Same issue here, using the exact same project (and network manager) for server and client, but once I try to connect with the client, but cant because the same reason.

    Just to note that I'm not on localhost, just deployed the dedicated server on its own address (it worked on the beginning, so it makes no sense to not work now since there is no changes on the network manager or transport).

    If there is anyone that can define exactly what causes this issue WHEN having exactly the same network manager (same project basically) because it makes no sense at all.
     
  3. cerestorm

    cerestorm

    Joined:
    Apr 16, 2020
    Posts:
    610
    Normally you get that message when there's a mismatch in the following between server and client:
    Code (CSharp):
    1.              writer.WriteValueSafe(TickRate);
    2.                 writer.WriteValueSafe(ConnectionApproval);
    3.                 writer.WriteValueSafe(ForceSamePrefabs);
    4.                 writer.WriteValueSafe(EnableSceneManagement);
    5.                 writer.WriteValueSafe(EnsureNetworkVariableLengthSafety);
    6.                 writer.WriteValueSafe(RpcHashSize);
    That's from Netcode's NetworkConfig.cs source file, if you want to check the whole method it's
    GetConfig(bool cache = true)
    and starts at line 224 or thereabouts.
     
  4. HarambeIsAlive

    HarambeIsAlive

    Joined:
    May 17, 2017
    Posts:
    2
    Thanks for pointing that out @cerestorm, I still don't see why I still get that error even if I'm compiling the server and then the client with the exact same project, network manager and so on (it shouldn't pop with "network mismatch" since all these values that is comparing later are the exact same)

    Do you know if there is someway to set the cache to false to see if that helps?
     
  5. cerestorm

    cerestorm

    Joined:
    Apr 16, 2020
    Posts:
    610
    I don't know about caching but you could log all those values and see if they differ (
    NetworkManager.Singleton.NetworkConfig.TickRate
    etc).