Multiplayer Playmode doesn't survive changes with Netcode for Gameobjects

Using MPPM 0.2.0 on Unity 2023.1.3f1, with Netcode for Gameobjects 1.5.1, I encountered a situation that demands I restart my MPPM instances… and that wouldn’t be a problem - except this situation is extremely common.

All I had to do to trigger this situation, is to add a network transform component to my ‘player’ netcode gameobject.

Any attempt to enter a playmode session connection after that, results in “[Netcode] NetworkConfig mismatch. The configuration between the server and client does not match”.

I tried to dig deeper and it seems the network manager component in the scene has a
NetworkConfig that compares some hash. However, I have reasons to believe this hash somehow doesn’t get updated on the virtual players made by MPPM despite attempting to save the scene / reopening it.

I also confirmed other changes do pass to the virtual players - such as changing the floor material’s color. It is only this weird hash of Netcode for Gameobjects that fails to transfer.

I also confirmed this happens regardless of whether domain reload is enabled or disabled, which leads me to believe this is some serialized state that is not set to dirty within Netcode for Gameobjects, but I could be wrong?

How can I fix this so the MPPM experience can be smooth and without constant restarts any time I add or change a single component to my networked game using NGO?

Edit: I added a call to NGO’s NetworkManager.NetworkConfig.GetConfig() and the result seems to point to the hash on the virtual players changing when the networktransform is added… but the main player’s hash does not. I don’t know what to make of this, still investigating how this hash is constructed, a lot of things in it seem rather deterministic and cacheless?

Edit2: It appears that “Force same prefabs” fails makes this fail, and even with it off - there seems to be some prefab mismatch for the virtual player versus the main player. If I disable “force same prefabs” and additionally make a prefab list with manual hash number for the player prefab, the issue goes away - though this is far from comfortable or sustainable, and feels like it shouldn’t be an issue in the first place? I still don’t know what in MPPM causes this disparity.

Edit3: I may be wrong but I think I traced this to NetworkObject.GenerateGlobalObjectIdHash returning different hashes between the two players.

2 Likes

After more investigation, I believe this issue has nothing to do with MPPM. It is directly related to Netcode for Gameobjects alone. NetworkObject.GenerateGlobalObjectIdHash generates invalid hashes for gameobjects and prefabs under certain conditions (either in a not-yet-saved scene, or a prefab saved in prefab mode’s scene), and never updates the written-to-disk values afterwards, with direct values changing.

Because the editor will update the running memory value to a valid one once you leave prefab mode, but the disk value is invalid, the virtual players and the primary editor are mismatched. Not MPPM’s fault, but the discrepency is frustrating.

I’ve opened an issue for this on the Netcode for Gameobjects github repository, hopefully this can be soon fixed for everyone.

Thanks for the detailed write-up! We really appreciate you going above and beyond to investigate this issue.

I’ve brought your ticket to the attention of the NGO team. It does seem to be a very annoying issue when working with NGO and MPPM together. Do you know if the same problem occurs if using ParrelSync?

1 Like

I have not verified it, but I have verified that the issue is related to NGO itself and MPPM is not at fault at all. I’d like to say there is nothing for MPPM to fix. I pulled NGO and made a fix for myself, which I’ve posted on the repository’s issue above.

And thank you for the follow ups!

The issue was specific to GlobalObjectIdHash generation and PR-2662 should resolve this issue with MPPM and Parrel Sync. This fix will be the next update (after v1.6.0).

1 Like

Hi, I hate to bump this, but I am having a very similar issue to this using Netcode for Gameobjects v1.9.1, Unity version 6000.0.10f1 on Windows 11, and MPPM 1.2.1.

After making changes, typically to a prefab, running a MPPM Virtual Player as a client leads to the warning “[Netcode] NetworkConfig mismatch. The configuration between the server and client does not match”

I also want to add that, unlike in OP’s case, restarting my Virtual Player doesn’t fix the issue.

I am wondering if there is some update that I missed, since it seems clear you guys are aware of this issue and have already addressed it? It is significantly hindering my ability to develop so any help is appreciated!

Sorry to hear you are having this issue… :slightly_frowning_face:
Are you using the default network prefab list or did you create one specific to your project?
If you are using the default network prefab list I would suggest making a new network prefab list and assigning that to the NetworkManager (replace the default network prefab list with the one you create).

If you continue to have issues or you are already using a network prefab list other than the default one, then please submit a bug to the NGO Github Repository with the exact steps to replicate the issue (the more details the better) and/or submit an issue via the Unity editor and include your project with the steps to replicate and then post the ticket number emailed to you here so I can get it transferred directly to me faster (having a project to replicate will help expedite me finding the issue).

Hi, sorry for the delay on my reply. I wanted to test out your fix before responding, and was out of town all this weekend.

I was initially using the DefaultNetworkPrefabs SO, and switching it seemed to have fixed some cases, but not all cases where this would happen.

When it comes to submitting the bug report, how specific do I need to be in replicating the steps? Do I need to include the exact code and such? Also, how do I submit an issue via the unity editor?

To submit a bug in the editor, navigate to the Help->Report a bug menu option.
image

This should invoke the Unity Bug Reporter that will include your project files so we can replicate the issue on our side. Make sure to provide your email address as you will get a response about the bug submitted with a ticket id that you will want to post here so I can expedite it getting assigned to me.

Make sure when providing details that you walk through the steps starting with loading your project that you run through to get the bug to occur. Once you reach the last step where the bug occurs, provide what kind of error message (or lack of) you are getting, what actually happens, and then what you expected to happen.

When submitting through the editor, it includes your project so you don’t need to include scripts or the like (and it helps me track down the issue much faster).

Let me know if you need any additional assistance with this or if you received confirmation on submitting the bug with the identifier included in the email.

1 Like

Hey Noel,

Sorry to keep you in the dark on this for so long, I haven’t had the chance to work on my project as much. I recently haven’t ran into the issue since switching from the default network prefab list. If it does happen again, I’ll be sure to follow the steps you’ve outlined above and send a message here.

I appreciate you being so willing to help!

@kjowak
No worries. You should also look for an MPPM package update soon (v1.2.2) that resolves an issue where an MPPM instance’s AssetDatabase can get set to read only mode and not unset while the VM is enable/active. So, it could also be that you experienced that issue where a change in the editor would not sync properly with any active/enabled MPPM instances.

I know the fix for that is merged and so it shouldn’t be long before the new package is available.

2 Likes

Ok, it happened again and I’ve submitted a bug report through the Unity Editor. The issue code is: IN-82467.

Let me know if you need me to clarify anything else about the project. Thank you in advance!

I hope the update with the fix releases soon. This issue happens everytime I make any change to any of the network prefabs, which is very often.

The only way to resolve this that I’ve found is to restart the unity editor. If anyone knows a quicker workaround, please let me know.

MPPM package (v1.2.2) has been released earlier today and should indeed solve the issue.

1 Like

I cannot find an MPPM 1.2.2, but I’ve tried with 1.2.0 and 1.3.0-pre.2 and I still have this issue. Am running Unity 6000.16f1 and NGO 2.0.0-pre.4.

Every single time I modify a prefab or some other asset, the virtual editor gets out of sync and I get the error:

[Netcode] NetworkConfig mismatch. The configuration between the server and client does not match

The only way to resolve it is to restart the Unity Editor. Meaning, every single time I make a change to a prefab I have to restart Unity before I’m able to test again :confused:

1.3.1 and ngo 2.1 and its still broken. Every change requires restart. Just to add on too the past 4 versions have promised to fix the mppm not being able to be muted. yet we all still have this issue.

1 Like

The issue still persists on me.

Issue still exists on latest everything as the time of writing.

I have created another thread (before finding this one) with details steps on how to reproduce: [Multiplayer Play Mode] Error when connecting from/to Virtual Player after editing networked prefab

Very frustrating. It basically makes it impossible to work on a game via MPPM.

1 Like