o3de / o3de

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.
https://o3de.org
Other
7.67k stars 2.19k forks source link

Error printed in the console upon entering Game Mode for a project with Multiplayer gem enabled #13431

Open LB-KacperKapusta opened 1 year ago

LB-KacperKapusta commented 1 year ago

Describe the bug Entering Game Mode in any level for a project with Multiplayer gem enabled results in the following error being printed in the console: [Error] (System) - Attempting to spawn players on level load failed. No IMultiplayerSpawner found. Ensure one is registered. The issue does not occur for project using Default template.

Steps to reproduce

  1. Create a project with Multiplayer gem enabled.
  2. Build the project.
  3. Open the Editor.
  4. Create a new level.
  5. Enter Game Mode.

Expected behavior No errors are present in the console.

Actual behavior The described error is printed in the console.

Screenshots/Video

https://user-images.githubusercontent.com/86953659/204546999-ff2689f8-8ce7-46e0-ba37-93e345c0c57f.mp4

Found in Branch Development (a881574)

Desktop/Device

lmbr-pip commented 1 year ago

Users are expected to provide a default spawner.

Fix:

AMZN-Gene commented 1 year ago

@LB-KacperKapusta a new level component called "Simple Network Player Spawner" has been added to Multiplayer Gem which allows spawning network players without needing to write custom IMultiplayerSpawner c++ code. It's a level component so you must add "Simple Network Player Spawner" to the root entity in the level (not any child entity); this is to keep devs from accidently adding multiple player spawn handlers to the level which would conflict with eachother. The component accepts a network prefab for the player, and a list of spawn points.

Having a fallback player that spawns if one isn't provided would also rock (see #13895)