com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

NetworkBehaviour.IsSpawned and Enter Play Mode Options: Reload Scene

Open wlwl2 opened this issue 3 years ago • 4 comments

Description

I'm already amazed with the progress on Scene handling.

See this for context (Boss Room issue): https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop/issues/710

There seems to be a problem with Enter Play Mode Options: Reload Scene unchecked when trying to change scene. Reload Domain unchecked was fine (that is usually a source of problems). For performance reasons (in Unity documentation as well) I usually have Enter Play Mode Options checked and the rest of the options unchecked.

I had narrowed down the issue to a NetworkBehaviour.IsSpawned condition in SceneLoaderWrapper.cs.

I'd also like a clarification: does IsSpawned simply mean that the object is spawned on the server?

I also had a look at the RFC 'NetworkSceneManager Robustness and Additive Scene Loading'. It's kind of related but not sure if it will help.

Reproduce Steps

These are already in the Boss Room issue (to prevent duplication).

Actual Outcome

With Enter Play Mode Options: Reload Scene unchecked, it does not allow you to get to the character select screen, unless you enter Play mode again (after stopping play mode at the loading spinner where it got stuck).

Expected Outcome

You get to the CharSelect scene immediately (like you would with 'Enter Play Mode Options' unchecked).

Screenshots

Already in the Boss Room issue (to prevent duplication).

Environment

  • OS: Windows 10
  • Unity Version: 2021.3.2f1
  • Netcode Version: 1.0.0-pre.10 for Boss Room (happens on the latest 1.0.0 as well)
  • Netcode Commit: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/bc23a35a86f15d1e680930670b4dfd5ea8f3dca5 (latest one right now, has nothing to do with this commit in particular)

Additional Context

I think you can run these steps on the latest version of Boss Room.

wlwl2 avatar Aug 12 '22 07:08 wlwl2

This NetworkBehaviour.IsSpawned property is also causing other issues I think. https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/2117

wlwl2 avatar Aug 12 '22 07:08 wlwl2

Currently, we do not support having the Reload Scene unchecked as that will break part of the GlobalObjectIdHash generation process that is required for NGO to function properly.

NoelStephensUnity avatar Aug 16 '22 21:08 NoelStephensUnity

@NoelStephensUnity Should we leave this issue open just as a reminder for Enter Play Mode Options? The official (non-Netcode and/or Netcode) docs could also be changed to account for this?

wlwl2 avatar Aug 16 '22 23:08 wlwl2

@wlwl2 We sure can for the time being. I am planning on adding some additional documentation in the appropriate areas as well as add an entry in the troubleshooting section of the documentation.

NoelStephensUnity avatar Aug 17 '22 02:08 NoelStephensUnity