com.unity.multiplayer.samples.coop icon indicating copy to clipboard operation
com.unity.multiplayer.samples.coop copied to clipboard

With 'Enter Play Mode Options' checked, the CharSelect scene is not loaded immediately when the host is started for the first time in the editor.

Open wlwl2 opened this issue 3 years ago • 3 comments

Describe the bug Not high priority but the fix could be quick. With 'Enter Play Mode Options' checked, the CharSelect scene is not loaded immediately when the host is started for the first time in the editor. Reload Domain and Reload Scene are unchecked.

Having Reload Scene checked only, can kind of resolve this issue. The problem is not with Reload Domain as I've tried to reset some static fields and methods already in ServerGameNetPortal, ClientGameNetPortal, SessionManager etc.

I've narrowed down the issue to SceneLoaderWrapper.cs LoadScene method.

if (
     IsSpawned && // <<< THIS
     IsNetworkSceneManagementEnabled &&
     !NetworkManager.ShutdownInProgress
) {
   ...
}

IsSpawned is false on the first Play. When it is true, you get to the CharSelect scene correctly. I'm not sure why this condition is there.

To Reproduce Steps to reproduce the behavior:

  1. With 'Enter Play Mode Options' checked, click on 'Start with Direct IP'.
  2. Get to the 'Host With IP' (localhost) tab in the Main Menu scene.
  3. With the default localhost IP address and port, click on the start 'Host' button.
  4. The loading spinner spins and 'RecvConnectFinished Got status: Success' is logged in the console. You don't get to the CharSelect scene on the first Play mode.
  5. Stop the Play mode.
  6. Try steps 1 to 3 again without changing anything else.
  7. You can now get to the CharSelect scene immediately.

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

Screenshots bug

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2021.3.2f1
  • BossRoom Version: v1.3.0-pre

Additional context Not sure if removing IsSpawned condition will be an adequate fix. Also not sure if Reload Domain and Reload Scene being unchecked is intended to be supported by NetCode.

wlwl2 avatar Aug 10 '22 19:08 wlwl2

Hey @wlwl2 Setting this as a feature request, as we never used playmode options in boss room. If you think IsSpawned isn't getting reset properly between play sessions, can you log this as an NGO bug please? NGO and UTP should support playmode options already.

SamuelBellomo avatar Aug 10 '22 21:08 SamuelBellomo

You can add NGO issues here https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues

SamuelBellomo avatar Aug 10 '22 21:08 SamuelBellomo

Submitted the bug report. Good job with having scenes in Boss Room! I forgot to mention that earlier.

wlwl2 avatar Aug 12 '22 07:08 wlwl2

Thanks!

SamuelBellomo avatar Aug 24 '22 15:08 SamuelBellomo