Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributed authority isn't synchronizing all players #3129

Open
afarchy opened this issue Nov 19, 2024 · 3 comments
Open

Distributed authority isn't synchronizing all players #3129

afarchy opened this issue Nov 19, 2024 · 3 comments
Assignees
Labels
type:bug Bug Report type:support Questions or other support

Comments

@afarchy
Copy link

afarchy commented Nov 19, 2024

Description

See repro steps for a very simple way to reproduce this issue on the 2.1.1 release with the social hub sample.

I'm testing distributed authority on the latest version of NGO (develop-2.0.0 - d218b29) and I seem to be hitting a bug where players aren't showing up for everyone. The second player to join the session sees the first player, but the first player doesn't see the second player (or the opposite). This was working correctly on the 2.0.0 release version.

I've pinpointed the regression to these changes:

0bef65c#diff-a2f5ce32109de67feb6d19e873648504db771b6639787844b854b7cfc2dbd0e0R38

5f7441c#diff-a2f5ce32109de67feb6d19e873648504db771b6639787844b854b7cfc2dbd0e0R35

I logged the messages sent and received to see what's going on. The second player sends the NetworkMessageTypes.CreateObject message, but the first player doesn't receive it. The first player does receive the NetworkMessageTypes.NetworkTransformMessages that comes after this, so I don't know why only CreateObject gets dropped.

The reason I'm working on the latest NGO version is that I'm trying to add code to synchronize my scenes which are preloaded from addressables. But I've been testing without my changes and with scene management disabled to rule out my code.

Reproduce Steps

  1. Open social hub distributed authority sample (I'm on main, commit 022594f453adf5bd26f7cc40dd3ee27b06002738)
  2. Disable scene management on the Network Manager. I realize that other features will not work without scene management, but this is the easiest way to reproduce the issue.
  3. Duplicate the project and open in a second editor.
  4. Play both editors and join the same session

Actual Outcome

Player 1 sees player 2, but player 2 doesn't see player 1 (or the opposite).

Expected Outcome

Players can see each other.

Screenshots

Image
Image

Environment

  • OS: Windows 10
  • Unity Version: 6000.0.23f1
  • Netcode Version: 2.1.1 or newer
  • Netcode Commit: Latest tested is 022594f453adf5bd26f7cc40dd3ee27b06002738
@afarchy afarchy added stat:awaiting triage Status - Awaiting triage from the Netcode team. type:bug Bug Report labels Nov 19, 2024
@afarchy afarchy changed the title Distributed authority isn't synchronize all players Distributed authority isn't synchronizing all players Nov 19, 2024
@afarchy
Copy link
Author

afarchy commented Nov 21, 2024

We figured out that the issue in our project was due to our own bug. This is when using scene management.

However, without scene management enabled, the repro steps in this issue still result in synchronization failure. We are unblocked, but leaving the bug open for that reason.

@NoelStephensUnity
Copy link
Collaborator

It is a known issue that a distributed authority session would not synchronize properly when scene management is disabled.
This was fixed in PR #3135 and will be included in the next update of NGO v2.
For the time being, you can always point your manifest file to use the develop-2.0.0 branch:

"com.unity.netcode.gameobjects": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#develop-2.0.0",

@NoelStephensUnity NoelStephensUnity added type:support Questions or other support and removed stat:awaiting triage Status - Awaiting triage from the Netcode team. labels Dec 2, 2024
@NoelStephensUnity NoelStephensUnity self-assigned this Dec 2, 2024
@afarchy
Copy link
Author

afarchy commented Dec 3, 2024

It is a known issue that a distributed authority session would not synchronize properly when scene management is disabled. This was fixed in PR #3135 and will be included in the next update of NGO v2. For the time being, you can always point your manifest file to use the develop-2.0.0 branch:

"com.unity.netcode.gameobjects": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#develop-2.0.0",

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Bug Report type:support Questions or other support
Projects
None yet
Development

No branches or pull requests

2 participants