Getting different hash error while connecting to the dedicated server after switching platform to tvOS or Android

Hello,

I have developed my game for the iOS platform with Netcode for Entities, and I am now adding support for the tvOS and Android platforms.

When I attempt to connect to the dedicated server using the iOS platform, everything works perfectly. However, when I try to join the server using the tvOS or Android platform, I receive an error indicating a different hash. Everything else is the same; I simply switched platforms, and it no longer works. I created a new project and opened the project directly with the tvOS and Android platform but still no luck.

The error message also points to a player prefab with a hash that does not match. I have verified that all values are identical, so I’m unsure why the hash differs. Is there a way to identify which specific value is causing the hash discrepancy? Alternatively, is there a method to regenerate the hash or resolve this issue?

Error:
“Received a ghost - ThirdPersonCharacter_Soldier_Main - from the server which has a different hash on the client (got 613709009234365805 but expected 12094298565353847355). GhostPrefab: Unity.Entities.Entity (‘’).”

I’m experiencing the same issue. Can anyone explain how I can find the exact hash values at runtime or determine which hash is currently being used compared to the one coming from the server? The error log provides some numeric values indicating what is being used and what is received, but I haven’t been able to locate the current hash values for the ghost prefab anywhere.

Do you have any component or buffer or other tags that are added only for IOS or TvOS or Android that aren’t for other platforms?
Do you have any fields that are platform specific for replicated components (doubt) ?

Are you using or including any systems that inherits from DefaultVariantSystemBase and that define what variant to use that are specific for a certain platform (I doubt, but just in case) ?

The hash for the ghosts is constructed at runtime and it is based on the ghosts replicated components and their settings.
It is unfortunate we are missing more logs to help tracking this down.

You can check what it is going on by looking at the GhostCollectionSystem.ProcessPrefab and GhostCollectionSystem.AddComponents that is where the hash is built by combining all the code-generated hashes for the component serializers (that depend on the selected variants).

We can also further help if you can share you project or setup or report an issue. In that case we can look at the project and improve our logging to help track these problems down.

Hello @CMarastoni,

Thank you for your suggestions.

To narrow down the issue, I removed the systems and features that I had implemented in the game.

For animation, we are using the Rukhanka animation system. I found that when I removed all components related to character animation, my client successfully connected to the server.

Given that Rukhanka has a large codebase, I am considering ways to identify which specific element within the Rukhanka animation system is causing the problem.

I found that In the ghost authoring inspection component, in the IOS And Dedicated server I can see the AnimatorControllerLayerComponent and AnimatorControllerParameterComponent.

But with the same project, if I convert it to Android or tvOS, I don’t find those components.

Do you think this could be the problem? How does the ghost authoring inspection component generate those fields? Is that something we can control?

Yeah! this is defintiively the problem. The ghost prefab will have different serializer on the server and clients, based on the platform. That will make the ghost non compatible, because to deserialize them the client need to know how to parse and extract the AnimatorControllerLayerComponent and AnimatorControllerParameterComponent data.

Investigate why the components are removed and try to get them correctly in all build.

Found the issue here, I forgot to include all the script-defined symbols in the Android and AppleTV platforms. After adding those ghost authoring inspection components was same server was connecting properly.

Thank You!

1 Like