Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

1.1.0

Issue ID

N4EBUG-69

Regression

No

Ghost Hash from the Server side doesn't match the Ghost Hash on Client side

Package: Unity Netcode

-

Reproduction steps:
1. Open the attached project “CharacterControllerTest”
2. Open the “Assets/Scenes/Game” Scene
3. In the Project window select the “Assets/Feature/Netcode/Netcode.prefab/Netcode” Prefab
4. In the Inspector window, in the “Netcode Authoring” Component, set the “IP Address” field to “127.0.0.1”
5. Build the Project (File > Build And Run)
6. When the Player opens after building, in the Editor enter the Play mode
7. In the Player window open the custom Console window

Expected result: There are no errors in the Console
Actual result: Multiple Errors are printed to the Console window saying “Received a ghost - {GameObject_Name} - from the server which has a different hash on the client (got {RECEIVED_HASH} but expected {EXPECTED_HASH}). GhostPrefab: Unity.Entities.Entity ('').”

Reproducible with: 1.0.8, 1.1.0-exp.1, 1.1.0-pre.3 (2022.3.13f1)
Couldn’t test with: 1.2.0-exp.3 (2022.3.13f1) - Couldn’t upgrade the project

Reproducible on: macOS 13.5.2, Windows 10
Not reproducible on: No other environment tested

  1. Resolution Note:

    An assembly is excluded from the build which is causing some ghost variants to also be excluded. This is then stopping the source generator from building out the correct components/systems to support those types causing their serializers to not be available in the built version but to still exist in the editor version.
    The hash uses the component layout to form the full hash so having these differ will not only cause a hash mismatch but also means the two versions won't be able to correctly share data.
    If you remove the UNITY_EDITOR 'Define Constraint' from the Ghost.Variant.Authoring assembly or move the GhostComponentVariations contained within to an assembly which is included in the build this will fix the issue.
    Youmay also need to clean the build to get the source generators to pick everything up properly once this change is made.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.