Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    656
    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:
    656
    I don't know about caching but you could log all those values and see if they differ (
    NetworkManager.Singleton.NetworkConfig.TickRate
    etc).
     
  6. ANLevant

    ANLevant

    Joined:
    Jun 10, 2014
    Posts:
    23
    Hey, this is clearly a bug, you didn't do anything wrong. Press for unity to solve this very very critical bug!
     
  7. ANLevant

    ANLevant

    Joined:
    Jun 10, 2014
    Posts:
    23
    I was having this issue, I added a NetworkVariabke to a NetworkObject and suddenly i was getting this error. Git reverted to stable, restarted, tried building multiple times, nothing works. A workaround to this bug is to uncheck the Force Same Predab option on network management, then it will work, although this may cause other issues if your game has a lot of assets created on the fly. For me it's not the case so it's fine. In any case, this bug needs to be solved, and automated tests done so this doesn't happen again! This has been showing up since 2018 guys!