Jelajahi Sumber

Wip: Adding network player spawners to AutomatedTesting. Scripts aren't working and not sure why. Pushing this and switching back to my windows machine to debug.

Signed-off-by: Gene Walters <[email protected]>
Gene Walters 3 tahun lalu
induk
melakukan
2a3e2548db

+ 1 - 0
AutomatedTesting/Gem/Code/CMakeLists.txt

@@ -18,6 +18,7 @@ ly_add_target(
     INCLUDE_DIRECTORIES
         PRIVATE
             Source
+            .
         PUBLIC
             Include
     BUILD_DEPENDENCIES

+ 18 - 0
AutomatedTesting/Gem/Code/Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+
+<Component
+    Name="NetworkPlayerSpawnerComponent" 
+    Namespace="AutomatedTesting" 
+    OverrideComponent="true" 
+    OverrideController="false" 
+    OverrideInclude="Source/Components/NetworkPlayerSpawnerComponent.h"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+    <Include File="AzCore/Asset/AssetSerializer.h"/>
+    <Include File="AzFramework/Spawnable/Spawnable.h"/>
+	
+    <ComponentRelation Constraint="Weak" HasController="false" Name="TransformComponent" Namespace="AzFramework" Include="AzFramework/Components/TransformComponent.h" />
+
+    <ArchetypeProperty Type="bool" Name="SnapToGround" Init="false" ExposeToEditor="true" />
+    <ArchetypeProperty Type="AZ::Data::Asset&lt;AzFramework::Spawnable&gt;" Name="SpawnableAsset" Init="" ExposeToEditor="true" />
+</Component>

+ 16 - 0
AutomatedTesting/Gem/Code/Source/AutoGen/SimpleScriptPlayerComponent.AutoComponent.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+
+<Component
+    Name="SimpleScriptPlayerComponent"
+    Namespace="AutomatedTesting"
+    OverrideComponent="false"
+    OverrideController="false"
+    OverrideInclude=""
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    
+    <ComponentRelation Constraint="Required" HasController="true" Name="NetworkTransformComponent" Namespace="Multiplayer" Include="Multiplayer/Components/NetworkTransformComponent.h" />
+    
+    <NetworkInput Type="float" Name="FwdBack" Init="0.0f" ExposeToScript="true"/>
+    <NetworkInput Type="float" Name="LeftRight" Init="0.0f" ExposeToScript="true"/>
+
+</Component>

+ 44 - 0
AutomatedTesting/Gem/Code/Source/AutomatedTestingSystemComponent.cpp

@@ -10,8 +10,12 @@
 #include <AzCore/Serialization/EditContext.h>
 #include <AzCore/Serialization/EditContextConstants.inl>
 #include <Source/AutoGen/AutoComponentTypes.h>
+#include <Source/Spawners/RoundRobinSpawner.h>
+#include <Multiplayer/IMultiplayer.h>
+#include <AzCore/Console/ILogger.h>
 
 #include <AutomatedTestingSystemComponent.h>
+#include <Multiplayer/ReplicationWindows/IReplicationWindow.h>
 
 namespace AutomatedTesting
 {
@@ -62,10 +66,50 @@ namespace AutomatedTesting
     {
         AutomatedTestingRequestBus::Handler::BusConnect();
         RegisterMultiplayerComponents(); //< Register AutomatedTesting's multiplayer components to assign NetComponentIds
+
+        AZ::Interface<Multiplayer::IMultiplayerSpawner>::Register(this);
+        m_playerSpawner = AZStd::make_unique<RoundRobinSpawner>();
+        AZ::Interface<AutomatedTesting::IPlayerSpawner>::Register(m_playerSpawner.get());
     }
 
     void AutomatedTestingSystemComponent::Deactivate()
     {
+        AZ::Interface<AutomatedTesting::IPlayerSpawner>::Unregister(m_playerSpawner.get());
+        AZ::Interface<Multiplayer::IMultiplayerSpawner>::Unregister(this);
         AutomatedTestingRequestBus::Handler::BusDisconnect();
     }
+
+    Multiplayer::NetworkEntityHandle AutomatedTestingSystemComponent::OnPlayerJoin(uint64_t userId, const Multiplayer::MultiplayerAgentDatum& agentDatum)
+    {
+        AZStd::pair<Multiplayer::PrefabEntityId, AZ::Transform> entityParams = AZ::Interface<IPlayerSpawner>::Get()->GetNextPlayerSpawn();
+
+        Multiplayer::INetworkEntityManager::EntityList entityList =
+            AZ::Interface<Multiplayer::IMultiplayer>::Get()->GetNetworkEntityManager()->CreateEntitiesImmediate(
+            entityParams.first, Multiplayer::NetEntityRole::Authority, entityParams.second, Multiplayer::AutoActivate::DoNotActivate);
+
+        for (Multiplayer::NetworkEntityHandle subEntity : entityList)
+        {
+            subEntity.Activate();
+        }
+
+        Multiplayer::NetworkEntityHandle controlledEntity;
+        if (!entityList.empty())
+        {
+            controlledEntity = entityList[0];
+        }
+        else
+        {
+            AZLOG_WARN("Attempt to spawn prefab %s failed. Check that prefab is network enabled.",
+                entityParams.first.m_prefabName.GetCStr());
+        }
+
+        return controlledEntity;
+    }
+
+    void AutomatedTestingSystemComponent::OnPlayerLeave(Multiplayer::ConstNetworkEntityHandle entityHandle,
+        const Multiplayer::ReplicationSet& replicationSet,
+        AzNetworking::DisconnectReason reason)
+    {
+        
+    }
 }

+ 27 - 0
AutomatedTesting/Gem/Code/Source/AutomatedTestingSystemComponent.h

@@ -10,11 +10,26 @@
 #include <AzCore/Component/Component.h>
 
 #include <AutomatedTesting/AutomatedTestingBus.h>
+#include <Multiplayer/IMultiplayerSpawner.h>
+#include <Source/Spawners/IPlayerSpawner.h>
+
+namespace AzFramework
+{
+    struct PlayerConnectionConfig;
+}
+
+namespace Multiplayer
+{
+    struct EntityReplicationData;
+    using ReplicationSet = AZStd::map<ConstNetworkEntityHandle, EntityReplicationData>;
+    struct MultiplayerAgentDatum;
+}
 
 namespace AutomatedTesting
 {
     class AutomatedTestingSystemComponent
         : public AZ::Component
+        , public Multiplayer::IMultiplayerSpawner
         , protected AutomatedTestingRequestBus::Handler
     {
     public:
@@ -39,5 +54,17 @@ namespace AutomatedTesting
         void Activate() override;
         void Deactivate() override;
         ////////////////////////////////////////////////////////////////////////
+
+        ////////////////////////////////////////////////////////////////////////
+        // Multiplayer::IMultiplayerSpawner interface implementation
+        Multiplayer::NetworkEntityHandle OnPlayerJoin(uint64_t userId, const Multiplayer::MultiplayerAgentDatum& agentDatum) override;
+        void OnPlayerLeave(
+            Multiplayer::ConstNetworkEntityHandle entityHandle,
+            const Multiplayer::ReplicationSet& replicationSet,
+            AzNetworking::DisconnectReason reason) override;
+        ////////////////////////////////////////////////////////////////////////
+        
+        AZStd::unique_ptr<AutomatedTesting::IPlayerSpawner> m_playerSpawner;
+
     };
 }

+ 40 - 0
AutomatedTesting/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.cpp

@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of
+ * this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#include <AzCore/Serialization/SerializeContext.h>
+
+#include <Source/Components/NetworkPlayerSpawnerComponent.h>
+#include <Source/Spawners/IPlayerSpawner.h>
+
+namespace AutomatedTesting
+{
+    void NetworkPlayerSpawnerComponent::NetworkPlayerSpawnerComponent::Reflect(AZ::ReflectContext* context)
+    {
+        AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
+        if (serializeContext)
+        {
+            serializeContext->Class<NetworkPlayerSpawnerComponent, NetworkPlayerSpawnerComponentBase>()->Version(1);
+        }
+        NetworkPlayerSpawnerComponentBase::Reflect(context);
+    }
+
+    void NetworkPlayerSpawnerComponent::OnInit()
+    {
+        ;
+    }
+
+    void NetworkPlayerSpawnerComponent::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
+    {
+        AZ::Interface<IPlayerSpawner>::Get()->RegisterPlayerSpawner(this);
+    }
+
+    void NetworkPlayerSpawnerComponent::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
+    {
+        AZ::Interface<IPlayerSpawner>::Get()->UnregisterPlayerSpawner(this);
+    }
+} // namespace AutomatedTesting

+ 33 - 0
AutomatedTesting/Gem/Code/Source/Components/NetworkPlayerSpawnerComponent.h

@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of
+ * this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#include <Multiplayer/Components/NetBindComponent.h>
+#include <Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.h>
+
+namespace AutomatedTesting
+{
+
+    class NetworkPlayerSpawnerComponent : public NetworkPlayerSpawnerComponentBase
+    {
+    public:
+        AZ_MULTIPLAYER_COMPONENT(
+            NetworkPlayerSpawnerComponent,
+            s_networkPlayerSpawnerComponentConcreteUuid,
+            NetworkPlayerSpawnerComponentBase);
+
+        static void Reflect(AZ::ReflectContext* context);
+
+        NetworkPlayerSpawnerComponent(){};
+
+        void OnInit() override;
+        void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
+        void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
+    };
+} // namespace AutomatedTesting

+ 40 - 0
AutomatedTesting/Gem/Code/Source/Spawners/IPlayerSpawner.h

@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#include <AzCore/RTTI/RTTI.h>
+#include <Multiplayer/NetworkEntity/INetworkEntityManager.h>
+
+namespace AZ
+{
+    class Transform;
+}
+
+namespace AutomatedTesting
+{
+    class NetworkPlayerSpawnerComponent;
+
+    //! @class IPlayerSpawner
+    //! @brief IPlayerSpawner coordinate NetworkPlayerSpawners
+    //!
+    //! IPlayerSpawner is an AZ::Interface<T> that provides a registry for
+    //! NetworkPlayerSpawners which can then be queried when IMultiplayerSpawner
+    //! events fire.
+
+    class IPlayerSpawner
+    {
+    public:
+        AZ_RTTI(IPlayerSpawner, "{48CE4CFF-594B-4C6F-B5E0-8290A72CFEF9}");
+        virtual ~IPlayerSpawner() = default;
+
+        virtual bool RegisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) = 0;
+        virtual AZStd::pair<Multiplayer::PrefabEntityId, AZ::Transform> GetNextPlayerSpawn() = 0;
+        virtual bool UnregisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) = 0;
+    };
+} // namespace AutomatedTesting

+ 52 - 0
AutomatedTesting/Gem/Code/Source/Spawners/RoundRobinSpawner.cpp

@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ * 
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#include <AzCore/Component/TransformBus.h>
+#include <Source/Components/NetworkPlayerSpawnerComponent.h>
+#include <Source/Spawners/RoundRobinSpawner.h>
+
+namespace AutomatedTesting
+{
+    bool RoundRobinSpawner::RegisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner)
+    {
+        if (AZStd::find(m_spawners.begin(), m_spawners.end(), spawner) == m_spawners.end())
+        {
+            m_spawners.push_back(spawner);
+            return true;
+        }
+
+        return false;
+    }
+
+    AZStd::pair<Multiplayer::PrefabEntityId, AZ::Transform> RoundRobinSpawner::GetNextPlayerSpawn()
+    {
+        if (m_spawners.empty())
+        {
+            AZLOG_WARN("No active NetworkPlayerSpawnerComponents were found on player spawn request.")
+            return AZStd::make_pair<Multiplayer::PrefabEntityId, AZ::Transform>(Multiplayer::PrefabEntityId(), AZ::Transform::CreateIdentity());
+        }
+
+        NetworkPlayerSpawnerComponent* spawner = m_spawners[m_spawnIndex];
+        m_spawnIndex = m_spawnIndex + 1 == m_spawners.size() ? 0 : m_spawnIndex + 1;
+        // NetworkEntityManager currently operates against/validates AssetId or Path, opt for Path via Hint
+        Multiplayer::PrefabEntityId prefabEntityId(AZ::Name(spawner->GetSpawnableAsset().GetHint().c_str()));
+
+        return AZStd::make_pair<Multiplayer::PrefabEntityId, AZ::Transform>(
+            prefabEntityId, spawner->GetEntity()->GetTransform()->GetWorldTM());
+    }
+
+    bool RoundRobinSpawner::UnregisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner)
+    {
+        if (AZStd::find(m_spawners.begin(), m_spawners.end(), spawner))
+        {
+            m_spawners.erase(AZStd::remove(m_spawners.begin(), m_spawners.end(), spawner));
+            return true;
+        }
+
+        return false;
+    }
+} // namespace AutomatedTesting

+ 43 - 0
AutomatedTesting/Gem/Code/Source/Spawners/RoundRobinSpawner.h

@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of
+ * this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+
+#pragma once
+
+#include <Source/Spawners/IPlayerSpawner.h>
+
+namespace AzFramework
+{
+    struct PlayerConnectionConfig;
+}
+
+namespace Multiplayer
+{
+    struct EntityReplicationData;
+    using ReplicationSet = AZStd::map<ConstNetworkEntityHandle, EntityReplicationData>;
+} // namespace Multiplayer
+
+namespace AutomatedTesting
+{
+    class RoundRobinSpawner
+        : public IPlayerSpawner
+    {
+    public:
+        AZ_RTTI(RoundRobinSpawner, "{C934A204-D6F8-4A44-870B-DFE5B8C7BA6B}");
+
+        ////////////////////////////////////////////////////////////////////////
+        // IPlayerSpawner overrides
+        bool RegisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) override;
+        AZStd::pair<Multiplayer::PrefabEntityId, AZ::Transform> GetNextPlayerSpawn() override;
+        bool UnregisterPlayerSpawner(NetworkPlayerSpawnerComponent* spawner) override;
+        ////////////////////////////////////////////////////////////////////////
+
+    private:
+        AZStd::vector<NetworkPlayerSpawnerComponent*> m_spawners;
+        uint8_t m_spawnIndex = 0;
+    };
+} // namespace AutomatedTesting

+ 9 - 2
AutomatedTesting/Gem/Code/automatedtesting_files.cmake

@@ -8,9 +8,16 @@
 
 set(FILES
     Include/AutomatedTesting/AutomatedTestingBus.h
+    Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml
+    Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml
+    Source/AutoGen/SimpleScriptPlayerComponent.AutoComponent.xml
+    Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml
+    Source/Components/NetworkPlayerSpawnerComponent.cpp
+    Source/Components/NetworkPlayerSpawnerComponent.h
+    Source/Spawners/IPlayerSpawner.h
+    Source/Spawners/RoundRobinSpawner.h
+    Source/Spawners/RoundRobinSpawner.cpp
     Source/AutomatedTestingModule.cpp
     Source/AutomatedTestingSystemComponent.cpp
     Source/AutomatedTestingSystemComponent.h
-    Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml
-    Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml
 )

+ 1 - 6
AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py

@@ -148,16 +148,13 @@ class TestHelper:
         Report.critical_result(("Unexpected line not found: " + line, "Unexpected line found: " + line), not TestHelper.find_line(window, line, print_infos))
 
     @staticmethod
-    def multiplayer_enter_game_mode(msgtuple_success_fail: Tuple[str, str], sv_default_player_spawn_asset: str) -> None:
+    def multiplayer_enter_game_mode(msgtuple_success_fail: Tuple[str, str]) -> None:
         """
         :param msgtuple_success_fail: The tuple with the expected/unexpected messages for entering game mode.
-        :param sv_default_player_spawn_asset: The path to the network player prefab that will be automatically spawned upon entering gamemode.  The engine default is "prefabs/player.network.spawnable" 
 
         :return: None
         """
         Report.info("Entering game mode")
-        if sv_default_player_spawn_asset :
-            general.set_cvar("sv_defaultPlayerSpawnAsset", sv_default_player_spawn_asset)
 
         with Tracer() as section_tracer:
             # enter game-mode. 
@@ -178,8 +175,6 @@ class TestHelper:
 
             TestHelper.succeed_if_log_line_found("MultiplayerEditorConnection", "Editor-server ready. Editor has successfully connected to the editor-server's network simulation.", section_tracer.prints, 5.0)
 
-            TestHelper.fail_if_log_line_found("EditorServer", f"MultiplayerSystemComponent: SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '{sv_default_player_spawn_asset.lower()}'.", section_tracer.prints, 0.5)
-
         TestHelper.wait_for_condition(lambda : multiplayer.PythonEditorFuncs_is_in_game_mode(), 5.0)
         Report.critical_result(msgtuple_success_fail, multiplayer.PythonEditorFuncs_is_in_game_mode())
 

+ 2 - 5
AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_NetworkInput.py

@@ -69,9 +69,6 @@ def Multiplayer_AutoComponent_NetworkInput():
     ]
 
     level_name = "AutoComponent_NetworkInput"
-    player_prefab_name = "Player"
-    player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable"
-
     helper.init_idle()
 
 
@@ -80,10 +77,10 @@ def Multiplayer_AutoComponent_NetworkInput():
 
     with Tracer() as section_tracer:
         # 2) Enter game mode
-        helper.multiplayer_enter_game_mode(Tests.enter_game_mode, player_prefab_path.lower())
+        helper.multiplayer_enter_game_mode(Tests.enter_game_mode)
 
         # 3) Make sure the network player was spawned
-        player_id = general.find_game_entity(player_prefab_name)
+        player_id = general.find_game_entity("Player")
         Report.critical_result(Tests.find_network_player, player_id.IsValid())
 
         # 4) Check the editor logs for expected and unexpected log output

+ 2 - 4
AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py

@@ -45,8 +45,6 @@ def Multiplayer_AutoComponent_RPC():
     from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole
 
     level_name = "AutoComponent_RPC"
-    player_prefab_name = "Player"
-    player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable"
 
     helper.init_idle()
 
@@ -55,10 +53,10 @@ def Multiplayer_AutoComponent_RPC():
 
     with Tracer() as section_tracer:
         # 2) Enter game mode
-        helper.multiplayer_enter_game_mode(TestSuccessFailTuples.enter_game_mode, player_prefab_path.lower())
+        helper.multiplayer_enter_game_mode(TestSuccessFailTuples.enter_game_mode)
 
         # 3) Make sure the network player was spawned
-        player_id = general.find_game_entity(player_prefab_name)
+        player_id = general.find_game_entity("Player")
         Report.critical_result(TestSuccessFailTuples.find_network_player, player_id.IsValid())
 
         # 4) Check the editor logs for expected and unexpected log output

+ 2 - 5
AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_BasicConnectivity_Connects.py

@@ -41,9 +41,6 @@ def Multiplayer_BasicConnectivity_Connects():
 
 
     level_name = "BasicConnectivity_Connects"
-    player_prefab_name = "Player"
-    player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable"
-
     helper.init_idle()
 
     # 1) Open Level
@@ -51,10 +48,10 @@ def Multiplayer_BasicConnectivity_Connects():
 
     with Tracer() as section_tracer:
         # 2) Enter game mode
-        helper.multiplayer_enter_game_mode(TestConstants.enter_game_mode, player_prefab_path.lower())
+        helper.multiplayer_enter_game_mode(TestConstants.enter_game_mode)
 
         # 3) Make sure the network player was spawned
-        player_id = general.find_game_entity(player_prefab_name)
+        player_id = general.find_game_entity("Player")
         Report.critical_result(TestConstants.find_network_player, player_id.IsValid())
     
     # Exit game mode

+ 2 - 4
AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py

@@ -41,8 +41,6 @@ def Multiplayer_SimpleNetworkLevelEntity():
     from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole
 
     level_name = "SimpleNetworkLevelEntity"
-    player_prefab_name = "Player"
-    player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable"
 
     helper.init_idle()
 
@@ -51,10 +49,10 @@ def Multiplayer_SimpleNetworkLevelEntity():
 
     with Tracer() as section_tracer:
         # 2) Enter game mode
-        helper.multiplayer_enter_game_mode(TestSuccessFailTuples.enter_game_mode, player_prefab_path.lower())
+        helper.multiplayer_enter_game_mode(TestSuccessFailTuples.enter_game_mode)
 
         # 3) Make sure the network player was spawned
-        player_id = general.find_game_entity(player_prefab_name)
+        player_id = general.find_game_entity("Player")
         Report.critical_result(TestSuccessFailTuples.find_network_player, player_id.IsValid())
 
         # 4) Check the editor logs for network spawnable errors

+ 1 - 10
Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp

@@ -221,20 +221,11 @@ namespace Multiplayer
         }
 
         const auto console = AZ::Interface<AZ::IConsole>::Get();
-        AZ::CVarFixedString sv_defaultPlayerSpawnAsset;
-
-        if (console->GetCvarValue("sv_defaultPlayerSpawnAsset", sv_defaultPlayerSpawnAsset) != AZ::GetValueResult::Success)
-        {
-            AZ_Assert( false,
-                "MultiplayerEditorSystemComponent::LaunchEditorServer failed! Could not find the sv_defaultPlayerSpawnAsset cvar; the editor-server "
-                "will fall back to using some other default player! Please update this code to use a valid cvar!")
-        }
         
         processLaunchInfo.m_commandlineParameters = AZStd::string::format(
-            R"("%s" --project-path "%s" --editorsv_isDedicated true --sv_defaultPlayerSpawnAsset "%s" --rhi "%s")",
+            R"("%s" --project-path "%s" --editorsv_isDedicated true --rhi "%s")",
             serverPath.c_str(),
             AZ::Utils::GetProjectPath().c_str(),
-            sv_defaultPlayerSpawnAsset.c_str(),
             server_rhi.GetCStr()
         );
         processLaunchInfo.m_showWindow = true;