From 82d99aa1ebd8fac9e63508cec71363287fdc8a92 Mon Sep 17 00:00:00 2001 From: Pip Potter <61438964+lmbr-pip@users.noreply.github.com> Date: Thu, 21 Apr 2022 21:35:19 -0700 Subject: [PATCH 01/34] Add instructions about null renderer (#140) Signed-off-by: Pip Potter <61438964+lmbr-pip@users.noreply.github.com> --- README.md | 10 ++++++++++ README_LINUX.md | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/README.md b/README.md index 325b6252d..b28608025 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,16 @@ A server can be run as follows MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg ``` +#### (Optional) Running the Server Headless + +If you do not need to see rendered output on your servers, you can reduce resource usage by using the null renderer. + +Note: Parameters to use null renderer must be passed on the command line as the console-command-file is parsed after rendering is configured. + +```shell +MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg -rhi=null -NullRenderer +``` + #### Running the Server in the Editor By default, launching a local server from the editor during Play Mode is enabled. To disable this behavior, update the `editorsv_enabled` value in the `editor.cfg` file to `false`. diff --git a/README_LINUX.md b/README_LINUX.md index 2d4e42d02..e23d5cbae 100644 --- a/README_LINUX.md +++ b/README_LINUX.md @@ -103,6 +103,7 @@ LoadLevel Levels/SampleBase/SampleBase.spawnable ### Step 6. Run a Server and a Client +#### Running the Server A server can be run as follows: @@ -110,7 +111,19 @@ A server can be run as follows: > cd ~/git/o3de-multiplayersample/build > ./bin/profile/MultiplayerSample.ServerLauncher --console-command-file=server.cfg ``` + +#### (Optional) Running the Server Headless +If you do not need to see rendered output on your servers, you can reduce resource usage by using the null renderer. + +Note: Parameters to use null renderer must be passed on the commandline as the console-command-file is parsed after rendering is configured. + +```shell +> cd ~/git/o3de-multiplayersample/build +> ./bin/profile/MultiplayerSample.ServerLauncher --console-command-file=server.cfg -rhi=null -NullRenderer +``` + +#### Running the Client A client can be run with: ```shell From dcc1613ef82df985df96aeecc4f04cb0e5dfe6d3 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 30 Apr 2022 10:21:19 -0700 Subject: [PATCH 02/34] Fix SpawnIfAuthority script canvas so it can open. Not sure what it should spawn though; it appears to have spawned the player before but we have NetworkPlayerSpawnerComponent for doing that Signed-off-by: Gene Walters --- scriptcanvas/SpawnIfAuthority.scriptcanvas | 170 ++++++++++----------- 1 file changed, 81 insertions(+), 89 deletions(-) mode change 100644 => 100755 scriptcanvas/SpawnIfAuthority.scriptcanvas diff --git a/scriptcanvas/SpawnIfAuthority.scriptcanvas b/scriptcanvas/SpawnIfAuthority.scriptcanvas old mode 100644 new mode 100755 index 9770c150d..817fc8715 --- a/scriptcanvas/SpawnIfAuthority.scriptcanvas +++ b/scriptcanvas/SpawnIfAuthority.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 744312986674 + "id": 1339966905530 }, "Name": "SpawnIfAuthority", "Components": { @@ -25,21 +25,13 @@ "m_azType": "{A96A5037-AD0D-43B6-9948-ED63438C4A52}" }, "isNullPointer": false, - "$type": "SpawnableAsset", - "value": { - "Asset": { - "assetId": { - "guid": "{13BAFCBF-6669-5E4E-B3B0-8610349B2C01}", - "subId": 1084915735 - }, - "assetHint": "prefabs/player.spawnable" - } - } + "$type": "AzFramework::Scripts::SpawnableScriptAssetRef" }, "VariableId": { "m_id": "{DA8B04C5-A23C-40E0-8577-56A74B6B2086}" }, - "VariableName": "Player" + "VariableName": "Prefab", + "InitialValueSource": 1 } } ] @@ -52,7 +44,7 @@ "m_nodes": [ { "Id": { - "id": 770082790450 + "id": 1361441742010 }, "Name": "EBusEventHandler", "Components": { @@ -293,7 +285,7 @@ }, { "Id": { - "id": 765787823154 + "id": 1352851807418 }, "Name": "SC-Node(SpawnNodeableNode)", "Components": { @@ -470,7 +462,7 @@ "toolTip": "Ticket instance of the spawn result.", "DisplayDataType": { "m_type": 4, - "m_azType": "{2B5EB938-8962-4A43-A97B-112F398C604B}" + "m_azType": "{BA62FF9A-A01E-4FEB-84C6-200881DF2B2B}" }, "DisplayGroup": { "Value": 3165055374 @@ -510,10 +502,10 @@ { "scriptCanvasType": { "m_type": 4, - "m_azType": "{2B5EB938-8962-4A43-A97B-112F398C604B}" + "m_azType": "{BA62FF9A-A01E-4FEB-84C6-200881DF2B2B}" }, "isNullPointer": false, - "$type": "SpawnTicketInstance", + "$type": "AzFramework::EntitySpawnTicket", "label": "SpawnTicket" }, { @@ -635,7 +627,7 @@ }, { "Id": { - "id": 761492855858 + "id": 1348556840122 }, "Name": "SC-Node(Gate)", "Components": { @@ -726,7 +718,7 @@ }, { "Id": { - "id": 757197888562 + "id": 1357146774714 }, "Name": "SC-Node(CreateSpawnTicketNodeableNode)", "Components": { @@ -806,7 +798,7 @@ "slotName": "SpawnTicket", "DisplayDataType": { "m_type": 4, - "m_azType": "{2B5EB938-8962-4A43-A97B-112F398C604B}" + "m_azType": "{BA62FF9A-A01E-4FEB-84C6-200881DF2B2B}" }, "DisplayGroup": { "Value": 3070342103 @@ -825,7 +817,7 @@ "m_azType": "{A96A5037-AD0D-43B6-9948-ED63438C4A52}" }, "isNullPointer": false, - "$type": "SpawnableAsset", + "$type": "AzFramework::Scripts::SpawnableScriptAssetRef", "label": "Prefab" } ], @@ -867,7 +859,7 @@ }, { "Id": { - "id": 752902921266 + "id": 1365736709306 }, "Name": "SC-Node(IsNetEntityRoleAuthority)", "Components": { @@ -967,7 +959,7 @@ }, { "Id": { - "id": 748607953970 + "id": 1344261872826 }, "Name": "SC-Node(GetWorldTranslation)", "Components": { @@ -1069,7 +1061,7 @@ "m_connections": [ { "Id": { - "id": 774377757746 + "id": 1370031676602 }, "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(IsNetEntityRoleAuthority: In)", "Components": { @@ -1078,7 +1070,7 @@ "Id": 623912724610228967, "sourceEndpoint": { "nodeId": { - "id": 770082790450 + "id": 1361441742010 }, "slotId": { "m_id": "{FCEA454C-727C-4D5E-BC15-AB56BA5A39AE}" @@ -1086,7 +1078,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 752902921266 + "id": 1365736709306 }, "slotId": { "m_id": "{FD0F08BD-2B4C-49F8-84E0-A60CF854D157}" @@ -1097,7 +1089,7 @@ }, { "Id": { - "id": 778672725042 + "id": 1374326643898 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", "Components": { @@ -1106,7 +1098,7 @@ "Id": 15117390462186534323, "sourceEndpoint": { "nodeId": { - "id": 752902921266 + "id": 1365736709306 }, "slotId": { "m_id": "{25AA7A16-F5D8-4014-B829-0BD0EEA6B555}" @@ -1114,7 +1106,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 761492855858 + "id": 1348556840122 }, "slotId": { "m_id": "{FC311D8E-B2BA-4E16-8E0C-04077CE752D1}" @@ -1125,7 +1117,7 @@ }, { "Id": { - "id": 782967692338 + "id": 1378621611194 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Result: Boolean), destEndpoint=(If: Condition)", "Components": { @@ -1134,7 +1126,7 @@ "Id": 11157494866445858874, "sourceEndpoint": { "nodeId": { - "id": 752902921266 + "id": 1365736709306 }, "slotId": { "m_id": "{ABAE4BDB-E6F7-44DE-814F-838208D47892}" @@ -1142,7 +1134,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 761492855858 + "id": 1348556840122 }, "slotId": { "m_id": "{CACFB235-8553-4A31-8595-779028A50CA1}" @@ -1153,7 +1145,7 @@ }, { "Id": { - "id": 787262659634 + "id": 1382916578490 }, "Name": "srcEndpoint=(If: True), destEndpoint=(GetWorldTranslation: In)", "Components": { @@ -1162,7 +1154,7 @@ "Id": 8173811067217743380, "sourceEndpoint": { "nodeId": { - "id": 761492855858 + "id": 1348556840122 }, "slotId": { "m_id": "{3CDC2B4A-25B9-4CAD-9F7D-38C3D212F40F}" @@ -1170,7 +1162,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 748607953970 + "id": 1344261872826 }, "slotId": { "m_id": "{65AD80A5-A210-42D6-895B-160DF013A626}" @@ -1181,7 +1173,7 @@ }, { "Id": { - "id": 791557626930 + "id": 1387211545786 }, "Name": "srcEndpoint=(CreateSpawnTicket: Ticket Created), destEndpoint=(Spawn: Request Spawn)", "Components": { @@ -1190,7 +1182,7 @@ "Id": 6427710639037589106, "sourceEndpoint": { "nodeId": { - "id": 757197888562 + "id": 1357146774714 }, "slotId": { "m_id": "{F4DF48F9-8707-4067-BF70-E6240EF7DD2F}" @@ -1198,7 +1190,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 765787823154 + "id": 1352851807418 }, "slotId": { "m_id": "{69AD9BD3-9556-414B-BC97-C487EA487ABC}" @@ -1209,7 +1201,7 @@ }, { "Id": { - "id": 795852594226 + "id": 1391506513082 }, "Name": "srcEndpoint=(CreateSpawnTicket: SpawnTicket), destEndpoint=(Spawn: SpawnTicket)", "Components": { @@ -1218,7 +1210,7 @@ "Id": 767872420311571744, "sourceEndpoint": { "nodeId": { - "id": 757197888562 + "id": 1357146774714 }, "slotId": { "m_id": "{73DE083D-0C34-48C5-93A3-05E05A84B2DE}" @@ -1226,7 +1218,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 765787823154 + "id": 1352851807418 }, "slotId": { "m_id": "{96A2379F-1147-4A20-B843-ED1621A32A4C}" @@ -1237,7 +1229,7 @@ }, { "Id": { - "id": 800147561522 + "id": 1395801480378 }, "Name": "srcEndpoint=(GetWorldTranslation: Out), destEndpoint=(CreateSpawnTicket: Create Ticket)", "Components": { @@ -1246,7 +1238,7 @@ "Id": 12817578276561072748, "sourceEndpoint": { "nodeId": { - "id": 748607953970 + "id": 1344261872826 }, "slotId": { "m_id": "{F17998D4-1F55-4C29-B7EC-493804BB3BB5}" @@ -1254,7 +1246,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 757197888562 + "id": 1357146774714 }, "slotId": { "m_id": "{828860F9-BB5B-4909-BB68-E125DAED686A}" @@ -1265,7 +1257,7 @@ }, { "Id": { - "id": 804442528818 + "id": 1400096447674 }, "Name": "srcEndpoint=(GetWorldTranslation: Result: Vector3), destEndpoint=(Spawn: Local Translation)", "Components": { @@ -1274,7 +1266,7 @@ "Id": 12001439484058061595, "sourceEndpoint": { "nodeId": { - "id": 748607953970 + "id": 1344261872826 }, "slotId": { "m_id": "{A9DEC503-1141-44C2-9BA6-E740B716CB92}" @@ -1282,7 +1274,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 765787823154 + "id": 1352851807418 }, "slotId": { "m_id": "{411AC6D8-74DF-4CF5-AFE5-32F716F733F9}" @@ -1303,16 +1295,16 @@ "GraphCanvasData": [ { "Key": { - "id": 744312986674 + "id": 1339966905530 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "Scale": 0.6287510700734436, - "AnchorX": 206.75909423828125, - "AnchorY": -79.5227279663086 + "Scale": 0.8898687848736365, + "AnchorX": 1064.2017822265625, + "AnchorY": -189.91563415527344 } } } @@ -1320,7 +1312,7 @@ }, { "Key": { - "id": 748607953970 + "id": 1344261872826 }, "Value": { "ComponentData": { @@ -1351,7 +1343,7 @@ }, { "Key": { - "id": 752902921266 + "id": 1348556840122 }, "Value": { "ComponentData": { @@ -1360,29 +1352,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "LogicNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 380.0, - 140.0 + 860.0, + 160.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{98476AAD-4352-4408-BBBC-FDDA49B35675}" + "PersistentId": "{8784A9E8-C08C-4833-8707-522A51518804}" } } } }, { "Key": { - "id": 757197888562 + "id": 1352851807418 }, "Value": { "ComponentData": { @@ -1396,8 +1387,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1620.0, - 80.0 + 2060.0, + 100.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1405,14 +1396,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{A4F278B3-739C-41FD-B86E-C595CDE7B724}" + "PersistentId": "{D6CB7292-715A-4087-826E-CA637D30FDFA}" } } } }, { "Key": { - "id": 761492855858 + "id": 1357146774714 }, "Value": { "ComponentData": { @@ -1421,13 +1412,13 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "LogicNodeTitlePalette" + "PaletteOverride": "DefaultNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 860.0, - 160.0 + 1620.0, + 80.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1435,29 +1426,33 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{8784A9E8-C08C-4833-8707-522A51518804}" + "PersistentId": "{A4F278B3-739C-41FD-B86E-C595CDE7B724}" } } } }, { "Key": { - "id": 765787823154 + "id": 1361441742010 }, "Value": { "ComponentData": { "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { "$type": "NodeSaveData" }, - "{328FF15C-C302-458F-A43D-E1794DE0904E}": { - "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "DefaultNodeTitlePalette" - }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 2060.0, - 100.0 + 40.0, + 80.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 245425936 + } ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1465,41 +1460,38 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{D6CB7292-715A-4087-826E-CA637D30FDFA}" + "PersistentId": "{856AC888-5242-45FE-98C8-9551CDF90181}" } } } }, { "Key": { - "id": 770082790450 + "id": 1365736709306 }, "Value": { "ComponentData": { "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { "$type": "NodeSaveData" }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 40.0, - 80.0 - ] - }, - "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { - "$type": "EBusHandlerNodeDescriptorSaveData", - "EventIds": [ - { - "Value": 245425936 - } + 380.0, + 140.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{856AC888-5242-45FE-98C8-9551CDF90181}" + "PersistentId": "{98476AAD-4352-4408-BBBC-FDDA49B35675}" } } } From ac9f52c8a5d0baba6fb2d13a5622e602ea51cd11 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 2 May 2022 12:32:48 -0700 Subject: [PATCH 03/34] Using 'SpawnOnServer' script to spawn the filter.prefab Signed-off-by: Gene Walters --- Levels/SampleBase/SampleBase.prefab | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index 09f612501..1bccc5550 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -143,7 +143,9 @@ "$type": "GenericComponentWrapper", "Id": 7492029015899717881, "m_template": { - "$type": "MultiplayerSample::NetworkStressTestComponent" + "$type": "MultiplayerSample::NetworkStressTestComponent", + "AutoSpawnIntervalMs": 94320322519752, + "MaxSpawns": 2806761648 } } } @@ -163,11 +165,11 @@ "Component_[12802329719955739455]": { "$type": "EditorScriptCanvasComponent", "Id": 12802329719955739455, - "m_name": "SpawnIfAuthority", - "runtimeDataIsValid": true, - "sourceHandle": { - "id": "{B605AD71-0689-5650-B3F5-558D471B6351}", - "path": "C:/Git/Spectra/o3de/MultiplayerSample/scriptcanvas/SpawnIfAuthority.scriptcanvas" + "configuration": { + "sourceHandle": { + "id": "{B605AD71-0689-5650-B3F5-558D471B6351}", + "path": "C:/Git/Spectra/o3de/MultiplayerSample/scriptcanvas/SpawnIfAuthority.scriptcanvas" + } } }, "Component_[15194128185768259769]": { @@ -194,7 +196,7 @@ "Translate": [ 0.0, 0.0, - 12.253546714782715 + 9.633794784545898 ] } }, From b7e842026fda39b8ce6a18abfe66971cc31e14e6 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 3 May 2022 12:05:30 -0700 Subject: [PATCH 04/34] Resaving level and script after grabbing latest dev Signed-off-by: Gene Walters --- Levels/SampleBase/SampleBase.prefab | 54 +++++++- scriptcanvas/SpawnIfAuthority.scriptcanvas | 140 ++++++++++----------- 2 files changed, 123 insertions(+), 71 deletions(-) diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index 1bccc5550..5f8ec5492 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -168,7 +168,59 @@ "configuration": { "sourceHandle": { "id": "{B605AD71-0689-5650-B3F5-558D471B6351}", - "path": "C:/Git/Spectra/o3de/MultiplayerSample/scriptcanvas/SpawnIfAuthority.scriptcanvas" + "path": "home/gene/prj/MultiplayerSample/scriptcanvas/SpawnIfAuthority.scriptcanvas" + }, + "propertyOverrides": { + "source": { + "id": "{B605AD71-0689-5650-B3F5-558D471B6351}", + "path": "home/gene/prj/MultiplayerSample/scriptcanvas/SpawnIfAuthority.scriptcanvas" + }, + "variables": [ + { + "Datum": { + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{A96A5037-AD0D-43B6-9948-ED63438C4A52}" + }, + "isNullPointer": false, + "$type": "AzFramework::Scripts::SpawnableScriptAssetRef" + }, + "VariableId": { + "m_id": "{DA8B04C5-A23C-40E0-8577-56A74B6B2086}" + }, + "VariableName": "Prefab", + "InitialValueSource": 1 + } + ], + "overrides": [ + { + "Datum": { + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{A96A5037-AD0D-43B6-9948-ED63438C4A52}" + }, + "isNullPointer": false, + "$type": "AzFramework::Scripts::SpawnableScriptAssetRef", + "value": { + "asset": { + "assetId": { + "guid": "{F6990C4F-540A-56EF-8C07-3ECECB09BBE7}", + "subId": 2960582392 + }, + "assetHint": "prefabs/filteredgroup.spawnable" + } + } + }, + "InputControlVisibility": { + "Value": 850104567 + }, + "VariableId": { + "m_id": "{DA8B04C5-A23C-40E0-8577-56A74B6B2086}" + }, + "VariableName": "Prefab", + "InitialValueSource": 1 + } + ] } } }, diff --git a/scriptcanvas/SpawnIfAuthority.scriptcanvas b/scriptcanvas/SpawnIfAuthority.scriptcanvas index 817fc8715..f66ff881e 100755 --- a/scriptcanvas/SpawnIfAuthority.scriptcanvas +++ b/scriptcanvas/SpawnIfAuthority.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 1339966905530 + "id": 749423085365 }, "Name": "SpawnIfAuthority", "Components": { @@ -44,7 +44,7 @@ "m_nodes": [ { "Id": { - "id": 1361441742010 + "id": 775192889141 }, "Name": "EBusEventHandler", "Components": { @@ -285,7 +285,7 @@ }, { "Id": { - "id": 1352851807418 + "id": 770897921845 }, "Name": "SC-Node(SpawnNodeableNode)", "Components": { @@ -627,7 +627,7 @@ }, { "Id": { - "id": 1348556840122 + "id": 766602954549 }, "Name": "SC-Node(Gate)", "Components": { @@ -718,7 +718,7 @@ }, { "Id": { - "id": 1357146774714 + "id": 762307987253 }, "Name": "SC-Node(CreateSpawnTicketNodeableNode)", "Components": { @@ -859,7 +859,7 @@ }, { "Id": { - "id": 1365736709306 + "id": 758013019957 }, "Name": "SC-Node(IsNetEntityRoleAuthority)", "Components": { @@ -959,7 +959,7 @@ }, { "Id": { - "id": 1344261872826 + "id": 753718052661 }, "Name": "SC-Node(GetWorldTranslation)", "Components": { @@ -1061,7 +1061,7 @@ "m_connections": [ { "Id": { - "id": 1370031676602 + "id": 779487856437 }, "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(IsNetEntityRoleAuthority: In)", "Components": { @@ -1070,7 +1070,7 @@ "Id": 623912724610228967, "sourceEndpoint": { "nodeId": { - "id": 1361441742010 + "id": 775192889141 }, "slotId": { "m_id": "{FCEA454C-727C-4D5E-BC15-AB56BA5A39AE}" @@ -1078,7 +1078,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 1365736709306 + "id": 758013019957 }, "slotId": { "m_id": "{FD0F08BD-2B4C-49F8-84E0-A60CF854D157}" @@ -1089,7 +1089,7 @@ }, { "Id": { - "id": 1374326643898 + "id": 783782823733 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", "Components": { @@ -1098,7 +1098,7 @@ "Id": 15117390462186534323, "sourceEndpoint": { "nodeId": { - "id": 1365736709306 + "id": 758013019957 }, "slotId": { "m_id": "{25AA7A16-F5D8-4014-B829-0BD0EEA6B555}" @@ -1106,7 +1106,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 1348556840122 + "id": 766602954549 }, "slotId": { "m_id": "{FC311D8E-B2BA-4E16-8E0C-04077CE752D1}" @@ -1117,7 +1117,7 @@ }, { "Id": { - "id": 1378621611194 + "id": 788077791029 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Result: Boolean), destEndpoint=(If: Condition)", "Components": { @@ -1126,7 +1126,7 @@ "Id": 11157494866445858874, "sourceEndpoint": { "nodeId": { - "id": 1365736709306 + "id": 758013019957 }, "slotId": { "m_id": "{ABAE4BDB-E6F7-44DE-814F-838208D47892}" @@ -1134,7 +1134,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 1348556840122 + "id": 766602954549 }, "slotId": { "m_id": "{CACFB235-8553-4A31-8595-779028A50CA1}" @@ -1145,7 +1145,7 @@ }, { "Id": { - "id": 1382916578490 + "id": 792372758325 }, "Name": "srcEndpoint=(If: True), destEndpoint=(GetWorldTranslation: In)", "Components": { @@ -1154,7 +1154,7 @@ "Id": 8173811067217743380, "sourceEndpoint": { "nodeId": { - "id": 1348556840122 + "id": 766602954549 }, "slotId": { "m_id": "{3CDC2B4A-25B9-4CAD-9F7D-38C3D212F40F}" @@ -1162,7 +1162,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 1344261872826 + "id": 753718052661 }, "slotId": { "m_id": "{65AD80A5-A210-42D6-895B-160DF013A626}" @@ -1173,7 +1173,7 @@ }, { "Id": { - "id": 1387211545786 + "id": 796667725621 }, "Name": "srcEndpoint=(CreateSpawnTicket: Ticket Created), destEndpoint=(Spawn: Request Spawn)", "Components": { @@ -1182,7 +1182,7 @@ "Id": 6427710639037589106, "sourceEndpoint": { "nodeId": { - "id": 1357146774714 + "id": 762307987253 }, "slotId": { "m_id": "{F4DF48F9-8707-4067-BF70-E6240EF7DD2F}" @@ -1190,7 +1190,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 1352851807418 + "id": 770897921845 }, "slotId": { "m_id": "{69AD9BD3-9556-414B-BC97-C487EA487ABC}" @@ -1201,7 +1201,7 @@ }, { "Id": { - "id": 1391506513082 + "id": 800962692917 }, "Name": "srcEndpoint=(CreateSpawnTicket: SpawnTicket), destEndpoint=(Spawn: SpawnTicket)", "Components": { @@ -1210,7 +1210,7 @@ "Id": 767872420311571744, "sourceEndpoint": { "nodeId": { - "id": 1357146774714 + "id": 762307987253 }, "slotId": { "m_id": "{73DE083D-0C34-48C5-93A3-05E05A84B2DE}" @@ -1218,7 +1218,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 1352851807418 + "id": 770897921845 }, "slotId": { "m_id": "{96A2379F-1147-4A20-B843-ED1621A32A4C}" @@ -1229,7 +1229,7 @@ }, { "Id": { - "id": 1395801480378 + "id": 805257660213 }, "Name": "srcEndpoint=(GetWorldTranslation: Out), destEndpoint=(CreateSpawnTicket: Create Ticket)", "Components": { @@ -1238,7 +1238,7 @@ "Id": 12817578276561072748, "sourceEndpoint": { "nodeId": { - "id": 1344261872826 + "id": 753718052661 }, "slotId": { "m_id": "{F17998D4-1F55-4C29-B7EC-493804BB3BB5}" @@ -1246,7 +1246,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 1357146774714 + "id": 762307987253 }, "slotId": { "m_id": "{828860F9-BB5B-4909-BB68-E125DAED686A}" @@ -1257,7 +1257,7 @@ }, { "Id": { - "id": 1400096447674 + "id": 809552627509 }, "Name": "srcEndpoint=(GetWorldTranslation: Result: Vector3), destEndpoint=(Spawn: Local Translation)", "Components": { @@ -1266,7 +1266,7 @@ "Id": 12001439484058061595, "sourceEndpoint": { "nodeId": { - "id": 1344261872826 + "id": 753718052661 }, "slotId": { "m_id": "{A9DEC503-1141-44C2-9BA6-E740B716CB92}" @@ -1274,7 +1274,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 1352851807418 + "id": 770897921845 }, "slotId": { "m_id": "{411AC6D8-74DF-4CF5-AFE5-32F716F733F9}" @@ -1295,7 +1295,7 @@ "GraphCanvasData": [ { "Key": { - "id": 1339966905530 + "id": 749423085365 }, "Value": { "ComponentData": { @@ -1312,7 +1312,7 @@ }, { "Key": { - "id": 1344261872826 + "id": 753718052661 }, "Value": { "ComponentData": { @@ -1343,7 +1343,7 @@ }, { "Key": { - "id": 1348556840122 + "id": 758013019957 }, "Value": { "ComponentData": { @@ -1352,28 +1352,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "LogicNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 860.0, - 160.0 + 380.0, + 140.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{8784A9E8-C08C-4833-8707-522A51518804}" + "PersistentId": "{98476AAD-4352-4408-BBBC-FDDA49B35675}" } } } }, { "Key": { - "id": 1352851807418 + "id": 762307987253 }, "Value": { "ComponentData": { @@ -1387,8 +1388,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 2060.0, - 100.0 + 1620.0, + 80.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1396,14 +1397,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{D6CB7292-715A-4087-826E-CA637D30FDFA}" + "PersistentId": "{A4F278B3-739C-41FD-B86E-C595CDE7B724}" } } } }, { "Key": { - "id": 1357146774714 + "id": 766602954549 }, "Value": { "ComponentData": { @@ -1412,13 +1413,13 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "DefaultNodeTitlePalette" + "PaletteOverride": "LogicNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1620.0, - 80.0 + 860.0, + 160.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1426,33 +1427,29 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{A4F278B3-739C-41FD-B86E-C595CDE7B724}" + "PersistentId": "{8784A9E8-C08C-4833-8707-522A51518804}" } } } }, { "Key": { - "id": 1361441742010 + "id": 770897921845 }, "Value": { "ComponentData": { "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { "$type": "NodeSaveData" }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "DefaultNodeTitlePalette" + }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 40.0, - 80.0 - ] - }, - "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { - "$type": "EBusHandlerNodeDescriptorSaveData", - "EventIds": [ - { - "Value": 245425936 - } + 2060.0, + 100.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1460,38 +1457,41 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{856AC888-5242-45FE-98C8-9551CDF90181}" + "PersistentId": "{D6CB7292-715A-4087-826E-CA637D30FDFA}" } } } }, { "Key": { - "id": 1365736709306 + "id": 775192889141 }, "Value": { "ComponentData": { "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { "$type": "NodeSaveData" }, - "{328FF15C-C302-458F-A43D-E1794DE0904E}": { - "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" - }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 380.0, - 140.0 + 40.0, + 80.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 245425936 + } ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{98476AAD-4352-4408-BBBC-FDDA49B35675}" + "PersistentId": "{856AC888-5242-45FE-98C8-9551CDF90181}" } } } From 59f91135669fb00d57f73d7bbe1b32485eff7854 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Fri, 13 May 2022 15:00:36 -0700 Subject: [PATCH 05/34] Move SetSyncAimImmediate call to Autonomous to prevent desync Signed-off-by: puvvadar --- .../Source/Components/NetworkSimplePlayerCameraComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp index 5681028ed..e887210f6 100644 --- a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp +++ b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp @@ -27,13 +27,13 @@ namespace MultiplayerSample // Synchronize aim angles with initial transform AZ::Vector3& aimAngles = ModifyAimAngles(); aimAngles.SetZ(GetEntity()->GetTransform()->GetLocalRotation().GetZ()); - SetSyncAimImmediate(true); if (IsAutonomous()) { m_aiEnabled = FindComponent()->GetEnabled(); if (!m_aiEnabled) { + SetSyncAimImmediate(true); AZ::EntityId activeCameraId; Camera::CameraSystemRequestBus::BroadcastResult(activeCameraId, &Camera::CameraSystemRequestBus::Events::GetActiveCamera); m_activeCameraEntity = AZ::Interface::Get()->FindEntity(activeCameraId); From 2c0959fccdb0309cdd4e5c537f271a424a81880b Mon Sep 17 00:00:00 2001 From: puvvadar Date: Fri, 13 May 2022 15:05:58 -0700 Subject: [PATCH 06/34] Update SetSyncAimImmediate to set uniformly across network roles Signed-off-by: puvvadar --- .../Components/NetworkSimplePlayerCameraComponent.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp index e887210f6..2dfdc9493 100644 --- a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp +++ b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp @@ -27,28 +27,25 @@ namespace MultiplayerSample // Synchronize aim angles with initial transform AZ::Vector3& aimAngles = ModifyAimAngles(); aimAngles.SetZ(GetEntity()->GetTransform()->GetLocalRotation().GetZ()); + SetSyncAimImmediate(true); if (IsAutonomous()) { m_aiEnabled = FindComponent()->GetEnabled(); if (!m_aiEnabled) { - SetSyncAimImmediate(true); AZ::EntityId activeCameraId; Camera::CameraSystemRequestBus::BroadcastResult(activeCameraId, &Camera::CameraSystemRequestBus::Events::GetActiveCamera); m_activeCameraEntity = AZ::Interface::Get()->FindEntity(activeCameraId); - - AZ::TickBus::Handler::BusConnect(); } } + + AZ::TickBus::Handler::BusConnect(); } void NetworkSimplePlayerCameraComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) { - if (IsAutonomous() && !m_aiEnabled) - { - AZ::TickBus::Handler::BusDisconnect(); - } + AZ::TickBus::Handler::BusDisconnect(); } float NetworkSimplePlayerCameraComponentController::GetCameraYaw() const From 1da1d582c6e4e82a322a021dc51f188d34b424a7 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Mon, 16 May 2022 09:49:33 -0700 Subject: [PATCH 07/34] Set MPS Editor to update in background Signed-off-by: puvvadar --- editor.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/editor.cfg b/editor.cfg index 798a91574..cd8f74435 100644 --- a/editor.cfg +++ b/editor.cfg @@ -2,3 +2,4 @@ editorsv_enabled=true ed_keepEditorAlive=true editorsv_hidden=true editorsv_rhi_override=null +ed_backgroundUpdatePeriod=-1 \ No newline at end of file From 15e08442d80d5cb79ebc00729acc03ed6155584d Mon Sep 17 00:00:00 2001 From: puvvadar Date: Mon, 6 Jun 2022 13:16:47 -0700 Subject: [PATCH 08/34] Add Player Spawner to perf test level Signed-off-by: puvvadar --- .../SpawningPerfTest/SpawningPerfTest.prefab | 74 ++++++++++++++++++- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/Levels/SpawningPerfTest/SpawningPerfTest.prefab b/Levels/SpawningPerfTest/SpawningPerfTest.prefab index a3fda9f0b..a65094891 100644 --- a/Levels/SpawningPerfTest/SpawningPerfTest.prefab +++ b/Levels/SpawningPerfTest/SpawningPerfTest.prefab @@ -20,7 +20,8 @@ "Id": 14126657869720434043, "Child Entity Order": [ "Entity_[1176639161715]", - "Entity_[947961075516]" + "Entity_[947961075516]", + "Entity_[448371574594]" ] }, "Component_[15230859088967841193]": { @@ -205,7 +206,7 @@ "Controller": { "Configuration": { "Field of View": 55.0, - "EditorEntityId": 9615948867337072083 + "EditorEntityId": 14617233715992192339 } } }, @@ -503,6 +504,75 @@ } } }, + "Entity_[448371574594]": { + "Id": "Entity_[448371574594]", + "Name": "Player Spawn", + "Components": { + "Component_[10530615535325605593]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10530615535325605593 + }, + "Component_[10855051608461697301]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10855051608461697301 + }, + "Component_[15361295135880606727]": { + "$type": "SelectionComponent", + "Id": 15361295135880606727 + }, + "Component_[3346704004848312807]": { + "$type": "GenericComponentWrapper", + "Id": 3346704004848312807, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[3464738006358913673]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3464738006358913673 + }, + "Component_[3475019708768143726]": { + "$type": "EditorInspectorComponent", + "Id": 3475019708768143726 + }, + "Component_[4409150392817723261]": { + "$type": "EditorEntitySortComponent", + "Id": 4409150392817723261 + }, + "Component_[6071936040921528375]": { + "$type": "GenericComponentWrapper", + "Id": 6071936040921528375, + "m_template": { + "$type": "NetworkPlayerSpawnerComponent", + "SnapToGround": true, + "SpawnableAsset": { + "assetId": { + "guid": "{997E5003-6C9F-56BA-BB11-97A228F4B888}", + "subId": 3333583332 + }, + "assetHint": "prefabs/test_net_object.network.spawnable" + } + } + }, + "Component_[692896640486832901]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 692896640486832901, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[7797673296654102123]": { + "$type": "EditorEntityIconComponent", + "Id": 7797673296654102123 + }, + "Component_[8735865813636879623]": { + "$type": "EditorVisibilityComponent", + "Id": 8735865813636879623 + }, + "Component_[9627187347301095278]": { + "$type": "EditorLockComponent", + "Id": 9627187347301095278 + } + } + }, "Entity_[947961075516]": { "Id": "Entity_[947961075516]", "Name": "Test Spawner", From 4304a0ae455bc59d6b474318f8b6b6ead760b841 Mon Sep 17 00:00:00 2001 From: moraaar Date: Wed, 8 Jun 2022 07:59:36 +0100 Subject: [PATCH 09/34] Adapt multiplayersample to new physics materials (#154) - Fixed code using old physics material code. - Multiplayersample had 2 physics material libraries which are not needed anymore because they were copies from PhysX Gem's one. Deleting them. - Multiplayersample always used the default material in their prefabs, so the conversion command didn't have to change any asset. Conversion commands output: ```` [CONSOLE] Executing console command 'ed_physxConvertMaterialLibrariesIntoIndividualMaterials' (PhysXMaterialConversion) - Searching for physics material library assets to convert... (PhysXMaterialConversion) - No physics material library assets found to convert. [CONSOLE] Executing console command 'ed_physxFixAssetsUsingPhysicsLegacyMaterials' (PhysXMaterialConversion) - Searching for converted physics material assets... (PhysXMaterialConversion) - Found 10 converted physics materials. (PhysXMaterialConversion) - (PhysXMaterialConversion) - Searching for prefabs to convert... (PhysXMaterialConversion) - (PhysXMaterialConversion) - Found 19 prefabs to check. (PhysXMaterialConversion) - (PhysXMaterialConversion) - Prefab conversion finished. (PhysXMaterialConversion) - (PhysXMaterialConversion) - Searching for FBX manifests with PhysX mesh assets... (PhysXMaterialConversion) - (PhysXMaterialConversion) - No FBX manifests found. (PhysXMaterialConversion) - (EMFXMaterialConversion) - Searching for FBX manifests with actor assets... (EMFXMaterialConversion) - (EMFXMaterialConversion) - Found 14 FBX manifests to check. (EMFXMaterialConversion) - [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Death_Fall_Back_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Idle_Aim_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Idle_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Strafe_Run_Forwards_Aim_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Strafe_Run_Forwards_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Strafe_Walk_Forwards_Aim_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Strafe_Walk_Forwards_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Turn_Tight_Run_Left_Aim_NoArc_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Turn_Tight_Run_Left_NoArc_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Turn_Tight_Run_Right_Aim_NoArc_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. [Warning] ((null)) - Make sure you use aznew, offers better tracking! (SceneManifest) - Scene Manifest ( Jack_Turn_Tight_Run_Right_NoArc_ZUp.fbx ) is using the deprecated XML file format. It will be upgraded to JSON the next time it is modified. (EMFXMaterialConversion) - FBX manifests conversion finished. (EMFXMaterialConversion) - ```` Signed-off-by: moraaar --- .../SurfaceTypeMaterialLibrary.physmaterial | 158 ------------------ Gem/Code/Source/Weapons/SceneQuery.cpp | 4 +- SurfaceTypeMaterialLibrary.physmaterial | 158 ------------------ 3 files changed, 2 insertions(+), 318 deletions(-) delete mode 100644 Assets/Physics/SurfaceTypeMaterialLibrary.physmaterial delete mode 100644 SurfaceTypeMaterialLibrary.physmaterial diff --git a/Assets/Physics/SurfaceTypeMaterialLibrary.physmaterial b/Assets/Physics/SurfaceTypeMaterialLibrary.physmaterial deleted file mode 100644 index 481cd2fbf..000000000 --- a/Assets/Physics/SurfaceTypeMaterialLibrary.physmaterial +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Gem/Code/Source/Weapons/SceneQuery.cpp b/Gem/Code/Source/Weapons/SceneQuery.cpp index b774141dd..6a170923a 100644 --- a/Gem/Code/Source/Weapons/SceneQuery.cpp +++ b/Gem/Code/Source/Weapons/SceneQuery.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -57,7 +57,7 @@ namespace MultiplayerSample IntersectResult intersectResult; intersectResult.m_position = hit.m_position; intersectResult.m_normal = hit.m_normal; - intersectResult.m_materialName = hit.m_material->GetSurfaceTypeName(); + intersectResult.m_materialName = hit.m_physicsMaterialId.ToString(); intersectResult.m_netEntityId = networkEntityManager->GetNetEntityIdById(hit.m_entityId); outResults.emplace_back(intersectResult); } diff --git a/SurfaceTypeMaterialLibrary.physmaterial b/SurfaceTypeMaterialLibrary.physmaterial deleted file mode 100644 index 481cd2fbf..000000000 --- a/SurfaceTypeMaterialLibrary.physmaterial +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 76ad4e9b059a437f2b74918b1b8e04d65bc0bb80 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Fri, 17 Jun 2022 09:56:49 -0700 Subject: [PATCH 10/34] Add missing spawn ticket ref to SpawnIfAuthority.sc and fix misnamed cfg var Signed-off-by: puvvadar --- editor.cfg | 2 +- scriptcanvas/SpawnIfAuthority.scriptcanvas | 108 +++++++++++++-------- 2 files changed, 67 insertions(+), 43 deletions(-) diff --git a/editor.cfg b/editor.cfg index cd8f74435..f432de409 100644 --- a/editor.cfg +++ b/editor.cfg @@ -1,5 +1,5 @@ editorsv_enabled=true -ed_keepEditorAlive=true +ed_keepEditorActive=true editorsv_hidden=true editorsv_rhi_override=null ed_backgroundUpdatePeriod=-1 \ No newline at end of file diff --git a/scriptcanvas/SpawnIfAuthority.scriptcanvas b/scriptcanvas/SpawnIfAuthority.scriptcanvas index f66ff881e..aa1dc125f 100755 --- a/scriptcanvas/SpawnIfAuthority.scriptcanvas +++ b/scriptcanvas/SpawnIfAuthority.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 749423085365 + "id": 884482011433 }, "Name": "SpawnIfAuthority", "Components": { @@ -14,6 +14,26 @@ "Id": 11160906310313544800, "m_variableData": { "m_nameVariableMap": [ + { + "Key": { + "m_id": "{A21BE260-85C1-4477-8542-4DA26F648B4A}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{BA62FF9A-A01E-4FEB-84C6-200881DF2B2B}" + }, + "isNullPointer": false, + "$type": "AzFramework::EntitySpawnTicket" + }, + "VariableId": { + "m_id": "{A21BE260-85C1-4477-8542-4DA26F648B4A}" + }, + "VariableName": "SpawnTicket" + } + }, { "Key": { "m_id": "{DA8B04C5-A23C-40E0-8577-56A74B6B2086}" @@ -44,7 +64,7 @@ "m_nodes": [ { "Id": { - "id": 775192889141 + "id": 910251815209 }, "Name": "EBusEventHandler", "Components": { @@ -285,7 +305,7 @@ }, { "Id": { - "id": 770897921845 + "id": 905956847913 }, "Name": "SC-Node(SpawnNodeableNode)", "Components": { @@ -471,7 +491,11 @@ "ConnectionType": 2, "SlotType": 2 }, - "DataType": 1 + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{A21BE260-85C1-4477-8542-4DA26F648B4A}" + } }, { "id": { @@ -627,7 +651,7 @@ }, { "Id": { - "id": 766602954549 + "id": 901661880617 }, "Name": "SC-Node(Gate)", "Components": { @@ -718,7 +742,7 @@ }, { "Id": { - "id": 762307987253 + "id": 897366913321 }, "Name": "SC-Node(CreateSpawnTicketNodeableNode)", "Components": { @@ -859,7 +883,7 @@ }, { "Id": { - "id": 758013019957 + "id": 893071946025 }, "Name": "SC-Node(IsNetEntityRoleAuthority)", "Components": { @@ -959,7 +983,7 @@ }, { "Id": { - "id": 753718052661 + "id": 888776978729 }, "Name": "SC-Node(GetWorldTranslation)", "Components": { @@ -1061,7 +1085,7 @@ "m_connections": [ { "Id": { - "id": 779487856437 + "id": 914546782505 }, "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(IsNetEntityRoleAuthority: In)", "Components": { @@ -1070,7 +1094,7 @@ "Id": 623912724610228967, "sourceEndpoint": { "nodeId": { - "id": 775192889141 + "id": 910251815209 }, "slotId": { "m_id": "{FCEA454C-727C-4D5E-BC15-AB56BA5A39AE}" @@ -1078,7 +1102,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 758013019957 + "id": 893071946025 }, "slotId": { "m_id": "{FD0F08BD-2B4C-49F8-84E0-A60CF854D157}" @@ -1089,7 +1113,7 @@ }, { "Id": { - "id": 783782823733 + "id": 918841749801 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", "Components": { @@ -1098,7 +1122,7 @@ "Id": 15117390462186534323, "sourceEndpoint": { "nodeId": { - "id": 758013019957 + "id": 893071946025 }, "slotId": { "m_id": "{25AA7A16-F5D8-4014-B829-0BD0EEA6B555}" @@ -1106,7 +1130,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 766602954549 + "id": 901661880617 }, "slotId": { "m_id": "{FC311D8E-B2BA-4E16-8E0C-04077CE752D1}" @@ -1117,7 +1141,7 @@ }, { "Id": { - "id": 788077791029 + "id": 923136717097 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Result: Boolean), destEndpoint=(If: Condition)", "Components": { @@ -1126,7 +1150,7 @@ "Id": 11157494866445858874, "sourceEndpoint": { "nodeId": { - "id": 758013019957 + "id": 893071946025 }, "slotId": { "m_id": "{ABAE4BDB-E6F7-44DE-814F-838208D47892}" @@ -1134,7 +1158,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 766602954549 + "id": 901661880617 }, "slotId": { "m_id": "{CACFB235-8553-4A31-8595-779028A50CA1}" @@ -1145,7 +1169,7 @@ }, { "Id": { - "id": 792372758325 + "id": 927431684393 }, "Name": "srcEndpoint=(If: True), destEndpoint=(GetWorldTranslation: In)", "Components": { @@ -1154,7 +1178,7 @@ "Id": 8173811067217743380, "sourceEndpoint": { "nodeId": { - "id": 766602954549 + "id": 901661880617 }, "slotId": { "m_id": "{3CDC2B4A-25B9-4CAD-9F7D-38C3D212F40F}" @@ -1162,7 +1186,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 753718052661 + "id": 888776978729 }, "slotId": { "m_id": "{65AD80A5-A210-42D6-895B-160DF013A626}" @@ -1173,7 +1197,7 @@ }, { "Id": { - "id": 796667725621 + "id": 931726651689 }, "Name": "srcEndpoint=(CreateSpawnTicket: Ticket Created), destEndpoint=(Spawn: Request Spawn)", "Components": { @@ -1182,7 +1206,7 @@ "Id": 6427710639037589106, "sourceEndpoint": { "nodeId": { - "id": 762307987253 + "id": 897366913321 }, "slotId": { "m_id": "{F4DF48F9-8707-4067-BF70-E6240EF7DD2F}" @@ -1190,7 +1214,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 770897921845 + "id": 905956847913 }, "slotId": { "m_id": "{69AD9BD3-9556-414B-BC97-C487EA487ABC}" @@ -1201,7 +1225,7 @@ }, { "Id": { - "id": 800962692917 + "id": 936021618985 }, "Name": "srcEndpoint=(CreateSpawnTicket: SpawnTicket), destEndpoint=(Spawn: SpawnTicket)", "Components": { @@ -1210,7 +1234,7 @@ "Id": 767872420311571744, "sourceEndpoint": { "nodeId": { - "id": 762307987253 + "id": 897366913321 }, "slotId": { "m_id": "{73DE083D-0C34-48C5-93A3-05E05A84B2DE}" @@ -1218,7 +1242,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 770897921845 + "id": 905956847913 }, "slotId": { "m_id": "{96A2379F-1147-4A20-B843-ED1621A32A4C}" @@ -1229,7 +1253,7 @@ }, { "Id": { - "id": 805257660213 + "id": 940316586281 }, "Name": "srcEndpoint=(GetWorldTranslation: Out), destEndpoint=(CreateSpawnTicket: Create Ticket)", "Components": { @@ -1238,7 +1262,7 @@ "Id": 12817578276561072748, "sourceEndpoint": { "nodeId": { - "id": 753718052661 + "id": 888776978729 }, "slotId": { "m_id": "{F17998D4-1F55-4C29-B7EC-493804BB3BB5}" @@ -1246,7 +1270,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 762307987253 + "id": 897366913321 }, "slotId": { "m_id": "{828860F9-BB5B-4909-BB68-E125DAED686A}" @@ -1257,7 +1281,7 @@ }, { "Id": { - "id": 809552627509 + "id": 944611553577 }, "Name": "srcEndpoint=(GetWorldTranslation: Result: Vector3), destEndpoint=(Spawn: Local Translation)", "Components": { @@ -1266,7 +1290,7 @@ "Id": 12001439484058061595, "sourceEndpoint": { "nodeId": { - "id": 753718052661 + "id": 888776978729 }, "slotId": { "m_id": "{A9DEC503-1141-44C2-9BA6-E740B716CB92}" @@ -1274,7 +1298,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 770897921845 + "id": 905956847913 }, "slotId": { "m_id": "{411AC6D8-74DF-4CF5-AFE5-32F716F733F9}" @@ -1291,11 +1315,11 @@ "_runtimeVersion": 1, "_fileVersion": 1 }, - "m_variableCounter": 2, + "m_variableCounter": 3, "GraphCanvasData": [ { "Key": { - "id": 749423085365 + "id": 884482011433 }, "Value": { "ComponentData": { @@ -1303,8 +1327,8 @@ "$type": "SceneComponentSaveData", "ViewParams": { "Scale": 0.8898687848736365, - "AnchorX": 1064.2017822265625, - "AnchorY": -189.91563415527344 + "AnchorX": 1478.8697509765625, + "AnchorY": -177.55426025390625 } } } @@ -1312,7 +1336,7 @@ }, { "Key": { - "id": 753718052661 + "id": 888776978729 }, "Value": { "ComponentData": { @@ -1343,7 +1367,7 @@ }, { "Key": { - "id": 758013019957 + "id": 893071946025 }, "Value": { "ComponentData": { @@ -1374,7 +1398,7 @@ }, { "Key": { - "id": 762307987253 + "id": 897366913321 }, "Value": { "ComponentData": { @@ -1404,7 +1428,7 @@ }, { "Key": { - "id": 766602954549 + "id": 901661880617 }, "Value": { "ComponentData": { @@ -1434,7 +1458,7 @@ }, { "Key": { - "id": 770897921845 + "id": 905956847913 }, "Value": { "ComponentData": { @@ -1464,7 +1488,7 @@ }, { "Key": { - "id": 775192889141 + "id": 910251815209 }, "Value": { "ComponentData": { From ae15f18d511ebe671a1db71854e611f541fc1806 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 27 Jun 2022 18:56:03 -0700 Subject: [PATCH 11/34] Fixing SpawningPerfTest by adding the new player spawner component to the SpawningPerfTest. Applying ranom movements to the test boxes over time instead of using physX because physX had a performance bug. Signed-off-by: Gene Walters --- ...RandomTranslateComponent.AutoComponent.xml | 16 ++ .../NetworkRandomTranslateComponent.cpp | 52 ++++++ .../NetworkRandomTranslateComponent.h | 43 +++++ Gem/Code/multiplayersample_files.cmake | 3 + .../Player_SpawningPerfTest.prefab | 172 ++++++++++++++++++ .../SpawningPerfTest/SpawningPerfTest.prefab | 14 +- Prefabs/Test_Net_Object.prefab | 56 +----- 7 files changed, 304 insertions(+), 52 deletions(-) create mode 100644 Gem/Code/Source/AutoGen/NetworkRandomTranslateComponent.AutoComponent.xml create mode 100644 Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.cpp create mode 100644 Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.h create mode 100644 Levels/SpawningPerfTest/Player_SpawningPerfTest.prefab diff --git a/Gem/Code/Source/AutoGen/NetworkRandomTranslateComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkRandomTranslateComponent.AutoComponent.xml new file mode 100644 index 000000000..b31c7b558 --- /dev/null +++ b/Gem/Code/Source/AutoGen/NetworkRandomTranslateComponent.AutoComponent.xml @@ -0,0 +1,16 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.cpp new file mode 100644 index 000000000..256c0a68b --- /dev/null +++ b/Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace MultiplayerSample +{ + NetworkRandomTranslateComponentController::NetworkRandomTranslateComponentController(NetworkRandomTranslateComponent& parent) + : NetworkRandomTranslateComponentControllerBase(parent), m_simpleLcgRandom(AZStd::GetTimeUTCMilliSecond()) + { + } + + void NetworkRandomTranslateComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) + { + m_originalPosition = GetParent().GetEntity()->GetTransform()->GetWorldTranslation(); + m_destination = CalculateNextDestination(); + AZ::TickBus::Handler::BusConnect(); + } + + void NetworkRandomTranslateComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) + { + AZ::TickBus::Handler::BusDisconnect(); + } + + void NetworkRandomTranslateComponentController::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) + { + m_travelTime += deltaTime; + + const AZ::Vector3 currentPosition = GetParent().GetEntity()->GetTransform()->GetWorldTranslation(); + const float t = m_travelTime/GetParent().GetMovementDuration(); + const AZ::Vector3 newPosition = currentPosition.Lerp(m_destination, t); + GetParent().GetEntity()->GetTransform()->SetWorldTranslation(newPosition); + + if (m_travelTime > GetParent().GetMovementDuration()) + { + m_travelTime = 0.0f; + m_destination = CalculateNextDestination(); + } + } + + AZ::Vector3 NetworkRandomTranslateComponentController::CalculateNextDestination() + { + AZ::Vector3 random(0.5f - m_simpleLcgRandom.GetRandomFloat(), 0.5f - m_simpleLcgRandom.GetRandomFloat(), 0.5f - m_simpleLcgRandom.GetRandomFloat()); + random = GetParent().GetMaxMoveDistance() * random.GetNormalizedEstimate(); + return m_originalPosition+random; + } +} diff --git a/Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.h b/Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.h new file mode 100644 index 000000000..649b38808 --- /dev/null +++ b/Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +namespace MultiplayerSample +{ + class NetworkRandomTranslateComponentController + : public NetworkRandomTranslateComponentControllerBase, + AZ::TickBus::Handler + { + public: + NetworkRandomTranslateComponentController(NetworkRandomTranslateComponent& parent); + + ////////////////////////////////////////////////////////////////////////// + // NetworkRandomTranslateComponentControllerBase overrides + void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; + void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; + ////////////////////////////////////////////////////////////////////////// + + private: + ////////////////////////////////////////////////////////////////////////// + // AZ::TickBus::Handler overrides + void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; + ////////////////////////////////////////////////////////////////////////// + + AZ::Vector3 CalculateNextDestination(); + + AZ::Vector3 m_originalPosition = AZ::Vector3::CreateZero(); + AZ::Vector3 m_destination = AZ::Vector3::CreateZero(); + float m_travelTime = 0.0f; + AZ::SimpleLcgRandom m_simpleLcgRandom; + }; +} diff --git a/Gem/Code/multiplayersample_files.cmake b/Gem/Code/multiplayersample_files.cmake index cf5e75761..5621db636 100644 --- a/Gem/Code/multiplayersample_files.cmake +++ b/Gem/Code/multiplayersample_files.cmake @@ -18,6 +18,7 @@ set(FILES Source/AutoGen/NetworkPlayerMovementComponent.AutoComponent.xml Source/AutoGen/NetworkTestSpawnerComponent.AutoComponent.xml Source/AutoGen/NetworkRandomImpulseComponent.AutoComponent.xml + Source/AutoGen/NetworkRandomTranslateComponent.AutoComponent.xml Source/Components/ExampleFilteredEntityComponent.h Source/Components/ExampleFilteredEntityComponent.cpp Source/Components/NetworkAiComponent.cpp @@ -40,6 +41,8 @@ set(FILES Source/Components/PerfTest/NetworkRandomImpulseComponent.h Source/Components/PerfTest/NetworkTestSpawnerComponent.cpp Source/Components/PerfTest/NetworkTestSpawnerComponent.h + Source/Components/PerfTest/NetworkRandomTranslateComponent.cpp + Source/Components/PerfTest/NetworkRandomTranslateComponent.h Source/Components/NetworkStressTestComponent.cpp Source/Components/NetworkStressTestComponent.h Source/Components/NetworkPlayerMovementComponent.cpp diff --git a/Levels/SpawningPerfTest/Player_SpawningPerfTest.prefab b/Levels/SpawningPerfTest/Player_SpawningPerfTest.prefab new file mode 100644 index 000000000..4d96ac27f --- /dev/null +++ b/Levels/SpawningPerfTest/Player_SpawningPerfTest.prefab @@ -0,0 +1,172 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "Player_SpawningPerfTest", + "Components": { + "Component_[10596702065635784962]": { + "$type": "EditorEntitySortComponent", + "Id": 10596702065635784962, + "Child Entity Order": [ + "Entity_[481247202459]" + ] + }, + "Component_[12580556714960743299]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12580556714960743299 + }, + "Component_[13688091756673490796]": { + "$type": "EditorLockComponent", + "Id": 13688091756673490796 + }, + "Component_[17606414558060982620]": { + "$type": "EditorPrefabComponent", + "Id": 17606414558060982620 + }, + "Component_[3645633170898125754]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3645633170898125754 + }, + "Component_[376053612567333430]": { + "$type": "EditorEntityIconComponent", + "Id": 376053612567333430 + }, + "Component_[489861869047807566]": { + "$type": "EditorInspectorComponent", + "Id": 489861869047807566 + }, + "Component_[525294303509567484]": { + "$type": "EditorVisibilityComponent", + "Id": 525294303509567484 + }, + "Component_[8292012900030302774]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 8292012900030302774, + "Parent Entity": "" + }, + "Component_[8454252592774193570]": { + "$type": "SelectionComponent", + "Id": 8454252592774193570 + }, + "Component_[8561290942146171464]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8561290942146171464 + } + } + }, + "Entities": { + "Entity_[481247202459]": { + "Id": "Entity_[481247202459]", + "Name": "Player_SpawningPerfTest", + "Components": { + "Component_[11239072220376882582]": { + "$type": "EditorEntitySortComponent", + "Id": 11239072220376882582 + }, + "Component_[1169675617638491795]": { + "$type": "EditorEntityIconComponent", + "Id": 1169675617638491795 + }, + "Component_[1270609048172837707]": { + "$type": "SelectionComponent", + "Id": 1270609048172837707 + }, + "Component_[1430499456156535209]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 1430499456156535209, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0C6BBB76-4EC2-583A-B8C6-1A4C4FD1FE9D}", + "subId": 283109893 + }, + "assetHint": "objects/bunny.azmodel" + } + } + } + }, + "Component_[14719349855833720433]": { + "$type": "GenericComponentWrapper", + "Id": 14719349855833720433, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[15009826499951389033]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15009826499951389033 + }, + "Component_[16801850486357727363]": { + "$type": "EditorInspectorComponent", + "Id": 16801850486357727363, + "ComponentOrderEntryArray": [ + { + "ComponentId": 2222094408678306736 + }, + { + "ComponentId": 14719349855833720433, + "SortIndex": 1 + }, + { + "ComponentId": 18296186361961861976, + "SortIndex": 2 + }, + { + "ComponentId": 1430499456156535209, + "SortIndex": 3 + } + ] + }, + "Component_[18140658598914985021]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18140658598914985021 + }, + "Component_[18268225295801329235]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18268225295801329235 + }, + "Component_[18296186361961861976]": { + "$type": "GenericComponentWrapper", + "Id": 18296186361961861976, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[2222094408678306736]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 2222094408678306736, + "Parent Entity": "ContainerEntity" + }, + "Component_[4269963621511337485]": { + "$type": "EditorLockComponent", + "Id": 4269963621511337485 + }, + "Component_[459447293499378318]": { + "$type": "EditorBoxShapeComponent", + "Id": 459447293499378318, + "BoxShape": { + "Configuration": { + "Dimensions": [ + 10.0, + 10.0, + 5.0 + ] + } + } + }, + "Component_[8428788072393495291]": { + "$type": "GenericComponentWrapper", + "Id": 8428788072393495291, + "m_template": { + "$type": "MultiplayerSample::NetworkRandomTranslateComponent", + "MovementDuration": 2.0 + } + }, + "Component_[9209406762830822090]": { + "$type": "EditorVisibilityComponent", + "Id": 9209406762830822090 + } + } + } + } +} \ No newline at end of file diff --git a/Levels/SpawningPerfTest/SpawningPerfTest.prefab b/Levels/SpawningPerfTest/SpawningPerfTest.prefab index a65094891..eb46680de 100644 --- a/Levels/SpawningPerfTest/SpawningPerfTest.prefab +++ b/Levels/SpawningPerfTest/SpawningPerfTest.prefab @@ -33,6 +33,11 @@ "$type": "EditorDisabledCompositionComponent", "Id": 16239496886950819870 }, + "Component_[5521462106189916225]": { + "$type": "LocalViewBookmarkComponent", + "Id": 5521462106189916225, + "LocalBookmarkFileName": "SpawningPerfTest_6951221139.setreg" + }, "Component_[5688118765544765547]": { "$type": "EditorEntityIconComponent", "Id": 5688118765544765547 @@ -317,6 +322,13 @@ 0.0, -0.5 ], + "MaterialSlots": { + "Slots": [ + { + "Name": "Entire object" + } + ] + }, "MaterialSelection": { "MaterialIds": [ {} @@ -506,7 +518,7 @@ }, "Entity_[448371574594]": { "Id": "Entity_[448371574594]", - "Name": "Player Spawn", + "Name": "Player Spawner", "Components": { "Component_[10530615535325605593]": { "$type": "EditorPendingCompositionComponent", diff --git a/Prefabs/Test_Net_Object.prefab b/Prefabs/Test_Net_Object.prefab index 28a6e52c8..37dbfda46 100644 --- a/Prefabs/Test_Net_Object.prefab +++ b/Prefabs/Test_Net_Object.prefab @@ -70,25 +70,6 @@ "$type": "EditorVisibilityComponent", "Id": 13213110774758686394 }, - "Component_[14022225546352237038]": { - "$type": "EditorRigidBodyComponent", - "Id": 14022225546352237038, - "Configuration": { - "entityId": "", - "Mass": 999.9999389648438, - "Centre of mass offset": [ - 0.0, - 0.0, - 0.5 - ], - "Inertia tensor": { - "roll": 0.0, - "pitch": 0.0, - "yaw": 0.0, - "scale": 0.0059999991208314896 - } - } - }, "Component_[15076020362360634866]": { "$type": "GenericComponentWrapper", "Id": 15076020362360634866, @@ -96,13 +77,6 @@ "$type": "Multiplayer::NetworkTransformComponent" } }, - "Component_[15397597781278882914]": { - "$type": "GenericComponentWrapper", - "Id": 15397597781278882914, - "m_template": { - "$type": "Multiplayer::NetworkRigidBodyComponent" - } - }, "Component_[15646219890037406725]": { "$type": "SelectionComponent", "Id": 15646219890037406725 @@ -140,14 +114,13 @@ } ] }, - "Component_[2176242692874007681]": { + "Component_[2160433012867593070]": { "$type": "GenericComponentWrapper", - "Id": 2176242692874007681, + "Id": 2160433012867593070, "m_template": { - "$type": "MultiplayerSample::NetworkRandomImpulseComponent", - "EnableHopping": true, - "HopPeriod": 4.0, - "HopForce": 10000.0 + "$type": "MultiplayerSample::NetworkRandomTranslateComponent", + "MovementDuration": 5.0, + "MaxMoveDistance": 5.0 } }, "Component_[2286851697353605533]": { @@ -161,25 +134,6 @@ "$type": "NetBindComponent" } }, - "Component_[2512731683353439569]": { - "$type": "EditorColliderComponent", - "Id": 2512731683353439569, - "ColliderConfiguration": { - "Position": [ - 0.0, - 0.0, - 0.5 - ], - "MaterialSelection": { - "MaterialIds": [ - {} - ] - } - }, - "ShapeConfiguration": { - "ShapeType": 1 - } - }, "Component_[307488191766036503]": { "$type": "EditorEntitySortComponent", "Id": 307488191766036503 From 64595f047ea1100da3c00d8e4cdccd405447b753 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 29 Jun 2022 11:14:40 -0700 Subject: [PATCH 12/34] Change MPSample project image so it's not the default Signed-off-by: Gene Walters --- preview.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/preview.png b/preview.png index 82234dbf6..624399eb4 100644 --- a/preview.png +++ b/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1cf8339fb51f82a68d2ab475c0476960e75a79d96d239c5b7cd272fbe4990ffe -size 2770 +oid sha256:d0836b55d450f25f4ca7ff1bc81d266378f65a887c65b7dea4a3c8c65f68d4d9 +size 77570 From 3c4b190fd71d5f4f7e82ce82d763904a964a58d3 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 29 Jun 2022 12:35:24 -0700 Subject: [PATCH 13/34] Updating icon to have 2 players, this is multiplayer after all! Signed-off-by: Gene Walters --- preview.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/preview.png b/preview.png index 624399eb4..fc5d5b076 100644 --- a/preview.png +++ b/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d0836b55d450f25f4ca7ff1bc81d266378f65a887c65b7dea4a3c8c65f68d4d9 -size 77570 +oid sha256:682ecefceef4c154e386cd2dcdca2db7a3357c078777018968b181fd94abe7c8 +size 75685 From b6938a564dc74a0a891c57ebf6f0056d0575de36 Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Thu, 30 Jun 2022 23:47:48 +0100 Subject: [PATCH 14/34] Build fix Signed-off-by: Sergey Pereslavtsev --- .../Components/PerfTest/NetworkRandomTranslateComponent.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.cpp b/Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.cpp index 256c0a68b..949438c9a 100644 --- a/Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.cpp +++ b/Gem/Code/Source/Components/PerfTest/NetworkRandomTranslateComponent.cpp @@ -6,6 +6,7 @@ */ #include +#include #include namespace MultiplayerSample From e64816b9f7040f33e97c8249129dc80ff857beb5 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 30 Jun 2022 22:08:07 -0700 Subject: [PATCH 15/34] Adding placards in SampleBase to show dynamic player spawner, nested network entities, and static level collider. Signed-off-by: Gene Walters --- Gem/Code/CMakeLists.txt | 2 + .../UiCanvasDemoPlacardComponent.cpp | 83 ++ .../Components/UiCanvasDemoPlacardComponent.h | 51 + Gem/Code/Source/MultiplayerSampleModule.cpp | 2 + Gem/Code/multiplayersample_files.cmake | 2 + .../Placard_DynamicSpawn_Player.attimage | 21 + .../Placard_Level_NestedPrefab.attimage | 21 + .../SampleBase/Placard_Level_NonNet.attimage | 21 + Levels/SampleBase/SampleBase.prefab | 624 +++++++++- Materials/UICanvasRenderTarget.material | 20 + UICanvases/WorldSpacePlacard.attimage | 21 + UICanvases/WorldSpacePlacard.uicanvas | 1057 +++++++++++++++++ 12 files changed, 1915 insertions(+), 10 deletions(-) create mode 100644 Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.cpp create mode 100644 Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.h create mode 100644 Levels/SampleBase/Placard_DynamicSpawn_Player.attimage create mode 100644 Levels/SampleBase/Placard_Level_NestedPrefab.attimage create mode 100644 Levels/SampleBase/Placard_Level_NonNet.attimage create mode 100644 Materials/UICanvasRenderTarget.material create mode 100644 UICanvases/WorldSpacePlacard.attimage create mode 100644 UICanvases/WorldSpacePlacard.uicanvas diff --git a/Gem/Code/CMakeLists.txt b/Gem/Code/CMakeLists.txt index e2a470299..b187e9db9 100644 --- a/Gem/Code/CMakeLists.txt +++ b/Gem/Code/CMakeLists.txt @@ -29,12 +29,14 @@ ly_add_target( Gem::PhysX Gem::StartingPointInput Gem::DebugDraw + Gem::LyShine PRIVATE Gem::LmbrCentral.Static Gem::Multiplayer.Static Gem::PhysX.Static Gem::DebugDraw.Static Gem::ImGui.Static + Gem::LyShine.Static AUTOGEN_RULES *.AutoComponent.xml,AutoComponent_Header.jinja,$path/$fileprefix.AutoComponent.h *.AutoComponent.xml,AutoComponent_Source.jinja,$path/$fileprefix.AutoComponent.cpp diff --git a/Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.cpp b/Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.cpp new file mode 100644 index 000000000..6909ce14e --- /dev/null +++ b/Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.cpp @@ -0,0 +1,83 @@ +/* + * 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 + +#include +#include + +#include +#include + +namespace MultiplayerSample +{ + void UiCanvasDemoPlacardComponent::Activate() + { + AZ::EntityId uiCanvasEntityId; + UiCanvasRefBus::EventResult(uiCanvasEntityId, GetEntityId(), &UiCanvasRefBus::Events::GetCanvas); + if (uiCanvasEntityId.IsValid()) + { + SetUiCanvasText(uiCanvasEntityId); + } + else + { + UiCanvasAssetRefNotificationBus::Handler::BusConnect(GetEntityId()); + } + } + + void UiCanvasDemoPlacardComponent::Deactivate() + { + UiCanvasAssetRefNotificationBus::Handler::BusDisconnect(GetEntityId()); + } + + void UiCanvasDemoPlacardComponent::Reflect(AZ::ReflectContext* context) + { + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1) + ->Field("Text", &UiCanvasDemoPlacardComponent::m_placardText) + ->Field("TextboxUiId", &UiCanvasDemoPlacardComponent::m_placardTextboxUiElementId) + ; + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + editContext->Class("UiCanvasDemoPlacardComponent", "Helper component for setting up UI canvases placards on meshes in and around the world. This component can dynamically change the placard text so that we can reuse one UiCanvas for multiple placards.") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Category, "ComponentCategory") + ->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/Component_Placeholder.svg") + ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")) + + ->DataElement(AZ::Edit::UIHandlers::Default, &UiCanvasDemoPlacardComponent::m_placardTextboxUiElementId, "Textbox UIElement Id", "The element id of the textbox you want to change. (Find the id inside the ui canvas)") + ->DataElement(AZ::Edit::UIHandlers::Default, &UiCanvasDemoPlacardComponent::m_placardText, "Placard Text", "Setting this text will change the textbox's text.") + ; + } + } + } + + void UiCanvasDemoPlacardComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required) + { + required.push_back(AZ_CRC("UiCanvasRefService")); + } + + void UiCanvasDemoPlacardComponent::OnCanvasLoadedIntoEntity(AZ::EntityId uiCanvasEntity) + { + SetUiCanvasText(uiCanvasEntity); + } + + void UiCanvasDemoPlacardComponent::SetUiCanvasText(AZ::EntityId uiCanvasEntityId) + { + AZ::Entity* textBoxEntity; + UiCanvasBus::EventResult(textBoxEntity, uiCanvasEntityId, &UiCanvasBus::Events::FindElementById, m_placardTextboxUiElementId); + + if (textBoxEntity != nullptr) + { + UiTextBus::Event(textBoxEntity->GetId(), &UiTextBus::Events::SetText, m_placardText); + } + } +} // namespace MultiplayerSample diff --git a/Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.h b/Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.h new file mode 100644 index 000000000..dad3179a2 --- /dev/null +++ b/Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.h @@ -0,0 +1,51 @@ +/* + * 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 +#include + +namespace MultiplayerSample +{ + class UiCanvasDemoPlacardComponent + : public AZ::Component + , UiCanvasAssetRefNotificationBus::Handler + { + public: + AZ_COMPONENT(MultiplayerSample::UiCanvasDemoPlacardComponent, "{8ED1F410-04CA-4180-BF2F-D24A1BB4BF7D}"); + + /* + * Reflects component data into the reflection contexts, including the serialization, edit, and behavior contexts. + */ + static void Reflect(AZ::ReflectContext* context); + + /* + * Specifies the services that this component requires. + * The system activates the required services before it activates this component. + * It also deactivates the required services after it deactivates this component. + * If a required service is missing before this component is activated, the system + * returns an error and does not activate this component. + */ + static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); + + protected: + void Activate() override; + void Deactivate() override; + + private: + // UiCanvasAssetRefNotificationBus overrides ... + void OnCanvasLoadedIntoEntity(AZ::EntityId uiCanvasEntity) override; + + void SetUiCanvasText(AZ::EntityId uiCanvasEntityId); + + private: + int m_placardTextboxUiElementId = 0; + AZStd::string m_placardText = "Default Placard Text"; + }; +} // namespace MultiplayerSample diff --git a/Gem/Code/Source/MultiplayerSampleModule.cpp b/Gem/Code/Source/MultiplayerSampleModule.cpp index 0473fb572..5fd1aaaa9 100644 --- a/Gem/Code/Source/MultiplayerSampleModule.cpp +++ b/Gem/Code/Source/MultiplayerSampleModule.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "MultiplayerSampleSystemComponent.h" @@ -32,6 +33,7 @@ namespace MultiplayerSample MultiplayerSampleSystemComponent::CreateDescriptor(), ExampleFilteredEntityComponent::CreateDescriptor(), NetworkPrefabSpawnerComponent::CreateDescriptor(), + UiCanvasDemoPlacardComponent::CreateDescriptor() }); CreateComponentDescriptors(m_descriptors); diff --git a/Gem/Code/multiplayersample_files.cmake b/Gem/Code/multiplayersample_files.cmake index 5621db636..6bec21791 100644 --- a/Gem/Code/multiplayersample_files.cmake +++ b/Gem/Code/multiplayersample_files.cmake @@ -47,6 +47,8 @@ set(FILES Source/Components/NetworkStressTestComponent.h Source/Components/NetworkPlayerMovementComponent.cpp Source/Components/NetworkPlayerMovementComponent.h + Source/Components/UiCanvasDemoPlacardComponent.cpp + Source/Components/UiCanvasDemoPlacardComponent.h Source/Spawners/IPlayerSpawner.h Source/Spawners/RoundRobinSpawner.h Source/Spawners/RoundRobinSpawner.cpp diff --git a/Levels/SampleBase/Placard_DynamicSpawn_Player.attimage b/Levels/SampleBase/Placard_DynamicSpawn_Player.attimage new file mode 100644 index 000000000..2c641ab7b --- /dev/null +++ b/Levels/SampleBase/Placard_DynamicSpawn_Player.attimage @@ -0,0 +1,21 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "AttachmentImageAsset", + "ClassData": { + "m_imageDescriptor": { + "BindFlags": [ + "ShaderRead", + "ShaderWrite", + "Color" + ], + "Size": { + "Width": 256, + "Height": 256 + }, + "Format": 19 + }, + "Name": "$Placard_DynamicSpawn_Player", + "IsUniqueName": true + } +} \ No newline at end of file diff --git a/Levels/SampleBase/Placard_Level_NestedPrefab.attimage b/Levels/SampleBase/Placard_Level_NestedPrefab.attimage new file mode 100644 index 000000000..ded878c85 --- /dev/null +++ b/Levels/SampleBase/Placard_Level_NestedPrefab.attimage @@ -0,0 +1,21 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "AttachmentImageAsset", + "ClassData": { + "m_imageDescriptor": { + "BindFlags": [ + "ShaderRead", + "ShaderWrite", + "Color" + ], + "Size": { + "Width": 256, + "Height": 256 + }, + "Format": 19 + }, + "Name": "$Placard_Level_NestedPrefab", + "IsUniqueName": true + } +} \ No newline at end of file diff --git a/Levels/SampleBase/Placard_Level_NonNet.attimage b/Levels/SampleBase/Placard_Level_NonNet.attimage new file mode 100644 index 000000000..9ac341e9e --- /dev/null +++ b/Levels/SampleBase/Placard_Level_NonNet.attimage @@ -0,0 +1,21 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "AttachmentImageAsset", + "ClassData": { + "m_imageDescriptor": { + "BindFlags": [ + "ShaderRead", + "ShaderWrite", + "Color" + ], + "Size": { + "Width": 256, + "Height": 256 + }, + "Format": 19 + }, + "Name": "$Placard_Level_NonNet", + "IsUniqueName": true + } +} \ No newline at end of file diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index 5f8ec5492..fa9b9cda6 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -19,6 +19,11 @@ "$type": "EditorDisabledCompositionComponent", "Id": 12759979290397858955 }, + "Component_[12966497369029307320]": { + "$type": "LocalViewBookmarkComponent", + "Id": 12966497369029307320, + "LocalBookmarkFileName": "SampleBase_85988121320.setreg" + }, "Component_[13524277649697810352]": { "$type": "EditorEntityIconComponent", "Id": 13524277649697810352 @@ -67,12 +72,294 @@ "Entity_[5919988826203]", "Entity_[5924283793499]", "Entity_[5997298237531]", - "Entity_[6070312681563]" + "Entity_[6070312681563]", + "Entity_[527570584484]", + "Entity_[58245980399131]" ] } } }, "Entities": { + "Entity_[115072692692507]": { + "Id": "Entity_[115072692692507]", + "Name": "Placard - Non-Networked Static Collider", + "Components": { + "Component_[11457023573376145491]": { + "$type": "SelectionComponent", + "Id": 11457023573376145491 + }, + "Component_[1221971212384525398]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1221971212384525398, + "Parent Entity": "Entity_[58245980399131]", + "Transform Data": { + "Translate": [ + -5.010808944702148, + 1.7580976486206055, + -1.8031244277954102 + ], + "Rotate": [ + 62.453956604003906, + 47.07986831665039, + 19.72440528869629 + ] + } + }, + "Component_[12521148944687292920]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12521148944687292920 + }, + "Component_[12835321665484227646]": { + "$type": "EditorLockComponent", + "Id": 12835321665484227646 + }, + "Component_[13357275932950081715]": { + "$type": "EditorEntitySortComponent", + "Id": 13357275932950081715 + }, + "Component_[14633572382975316691]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 14633572382975316691, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{767B3209-EDF7-503A-BF3D-6A69DAABC966}", + "subId": 285003870 + }, + "assetHint": "materialeditor/viewportmodels/plane_1x1.azmodel" + } + } + } + }, + "Component_[15400803850908131451]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15400803850908131451 + }, + "Component_[16297437667241749172]": { + "$type": "GenericComponentWrapper", + "Id": 16297437667241749172, + "m_template": { + "$type": "UiCanvasOnMeshComponent", + "AttachmentImageAssetOverride": { + "assetId": { + "guid": "{6A3D30FC-1583-5964-81F9-F1DF6BEEB247}" + }, + "assetHint": "levels/samplebase/placard_level_nonnet.attimage" + } + } + }, + "Component_[16820956745044132717]": { + "$type": "GenericComponentWrapper", + "Id": 16820956745044132717, + "m_template": { + "$type": "UiCanvasAssetRefComponent", + "CanvasAssetRef": { + "AssetPath": "uicanvases/worldspaceplacard.uicanvas" + }, + "IsAutoLoad": true + } + }, + "Component_[17331375054040607466]": { + "$type": "EditorScriptCanvasComponent", + "Id": 17331375054040607466 + }, + "Component_[17461824293227247700]": { + "$type": "GenericComponentWrapper", + "Id": 17461824293227247700, + "m_template": { + "$type": "MultiplayerSample::UiCanvasDemoPlacardComponent", + "Text": "Non-Networked Static Collider in the Level", + "TextboxUiId": 3 + } + }, + "Component_[3637526016639674263]": { + "$type": "EditorInspectorComponent", + "Id": 3637526016639674263 + }, + "Component_[411288956840653761]": { + "$type": "EditorVisibilityComponent", + "Id": 411288956840653761 + }, + "Component_[7478123538122523484]": { + "$type": "EditorMaterialComponent", + "Id": 7478123538122523484, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 1803671422 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{BAFF94C3-ECD8-517A-A3F7-585F56D8519E}" + }, + "assetHint": "materials/uicanvasrendertarget.azmaterial" + }, + "PropertyOverrides": { + "baseColor.textureMap": { + "$type": "AssetId", + "Value": { + "guid": "{6A3D30FC-1583-5964-81F9-F1DF6BEEB247}" + } + } + } + } + } + ] + } + } + }, + "Component_[7814534240752180395]": { + "$type": "EditorEntityIconComponent", + "Id": 7814534240752180395 + }, + "Component_[8328462562183634271]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8328462562183634271 + } + } + }, + "Entity_[1234584512027]": { + "Id": "Entity_[1234584512027]", + "Name": "Placard - Nested Prefab of Network Entities", + "Components": { + "Component_[11457023573376145491]": { + "$type": "SelectionComponent", + "Id": 11457023573376145491 + }, + "Component_[1221971212384525398]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1221971212384525398, + "Parent Entity": "Entity_[58245980399131]", + "Transform Data": { + "Translate": [ + 1.5695266723632813, + -0.6469998359680176, + -1.8681058883666992 + ], + "Rotate": [ + 44.0, + 0.0, + 0.0 + ] + } + }, + "Component_[12521148944687292920]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12521148944687292920 + }, + "Component_[12835321665484227646]": { + "$type": "EditorLockComponent", + "Id": 12835321665484227646 + }, + "Component_[13357275932950081715]": { + "$type": "EditorEntitySortComponent", + "Id": 13357275932950081715 + }, + "Component_[14633572382975316691]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 14633572382975316691, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{767B3209-EDF7-503A-BF3D-6A69DAABC966}", + "subId": 285003870 + }, + "assetHint": "materialeditor/viewportmodels/plane_1x1.azmodel" + } + } + } + }, + "Component_[15400803850908131451]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15400803850908131451 + }, + "Component_[16297437667241749172]": { + "$type": "GenericComponentWrapper", + "Id": 16297437667241749172, + "m_template": { + "$type": "UiCanvasOnMeshComponent", + "AttachmentImageAssetOverride": { + "assetId": { + "guid": "{0EEFDB03-CC93-5EEA-8086-EE73FCA6F91A}" + }, + "assetHint": "levels/samplebase/placard_level_nestedprefab.attimage" + } + } + }, + "Component_[16820956745044132717]": { + "$type": "GenericComponentWrapper", + "Id": 16820956745044132717, + "m_template": { + "$type": "UiCanvasAssetRefComponent", + "CanvasAssetRef": { + "AssetPath": "uicanvases/worldspaceplacard.uicanvas" + }, + "IsAutoLoad": true + } + }, + "Component_[17461824293227247700]": { + "$type": "GenericComponentWrapper", + "Id": 17461824293227247700, + "m_template": { + "$type": "MultiplayerSample::UiCanvasDemoPlacardComponent", + "Text": "Prefab of Nested Network Entities in the Level", + "TextboxUiId": 3 + } + }, + "Component_[3637526016639674263]": { + "$type": "EditorInspectorComponent", + "Id": 3637526016639674263 + }, + "Component_[411288956840653761]": { + "$type": "EditorVisibilityComponent", + "Id": 411288956840653761 + }, + "Component_[7478123538122523484]": { + "$type": "EditorMaterialComponent", + "Id": 7478123538122523484, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 1803671422 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{BAFF94C3-ECD8-517A-A3F7-585F56D8519E}" + }, + "assetHint": "materials/uicanvasrendertarget.azmaterial" + }, + "PropertyOverrides": { + "baseColor.textureMap": { + "$type": "AssetId", + "Value": { + "guid": "{0EEFDB03-CC93-5EEA-8086-EE73FCA6F91A}" + } + } + } + } + } + ] + } + } + }, + "Component_[7814534240752180395]": { + "$type": "EditorEntityIconComponent", + "Id": 7814534240752180395 + }, + "Component_[8328462562183634271]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8328462562183634271 + } + } + }, "Entity_[14030996048227]": { "Id": "Entity_[14030996048227]", "Name": "StressTestEntity", @@ -168,12 +455,13 @@ "configuration": { "sourceHandle": { "id": "{B605AD71-0689-5650-B3F5-558D471B6351}", - "path": "home/gene/prj/MultiplayerSample/scriptcanvas/SpawnIfAuthority.scriptcanvas" + "path": "scriptcanvas/SpawnIfAuthority.scriptcanvas" }, + "sourceName": "SpawnIfAuthority.scriptcanvas", "propertyOverrides": { "source": { "id": "{B605AD71-0689-5650-B3F5-558D471B6351}", - "path": "home/gene/prj/MultiplayerSample/scriptcanvas/SpawnIfAuthority.scriptcanvas" + "path": "scriptcanvas/SpawnIfAuthority.scriptcanvas" }, "variables": [ { @@ -273,6 +561,144 @@ } } }, + "Entity_[32726940402596]": { + "Id": "Entity_[32726940402596]", + "Name": "Placard - Player Spawner", + "Components": { + "Component_[11457023573376145491]": { + "$type": "SelectionComponent", + "Id": 11457023573376145491 + }, + "Component_[1221971212384525398]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1221971212384525398, + "Parent Entity": "Entity_[58245980399131]", + "Transform Data": { + "Translate": [ + 6.656980514526367, + -2.9074654579162598, + -1.861106514930725 + ], + "Rotate": [ + 44.0, + 0.0, + 0.0 + ] + } + }, + "Component_[12521148944687292920]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12521148944687292920 + }, + "Component_[12835321665484227646]": { + "$type": "EditorLockComponent", + "Id": 12835321665484227646 + }, + "Component_[13357275932950081715]": { + "$type": "EditorEntitySortComponent", + "Id": 13357275932950081715 + }, + "Component_[14633572382975316691]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 14633572382975316691, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{767B3209-EDF7-503A-BF3D-6A69DAABC966}", + "subId": 285003870 + }, + "assetHint": "materialeditor/viewportmodels/plane_1x1.azmodel" + } + } + } + }, + "Component_[15400803850908131451]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15400803850908131451 + }, + "Component_[16297437667241749172]": { + "$type": "GenericComponentWrapper", + "Id": 16297437667241749172, + "m_template": { + "$type": "UiCanvasOnMeshComponent", + "AttachmentImageAssetOverride": { + "assetId": { + "guid": "{AF0A7066-3089-51DF-B847-BAB45A9F3BA8}" + }, + "assetHint": "levels/samplebase/placard_dynamicspawn_player.attimage" + } + } + }, + "Component_[16820956745044132717]": { + "$type": "GenericComponentWrapper", + "Id": 16820956745044132717, + "m_template": { + "$type": "UiCanvasAssetRefComponent", + "CanvasAssetRef": { + "AssetPath": "uicanvases/worldspaceplacard.uicanvas" + }, + "IsAutoLoad": true + } + }, + "Component_[17461824293227247700]": { + "$type": "GenericComponentWrapper", + "Id": 17461824293227247700, + "m_template": { + "$type": "MultiplayerSample::UiCanvasDemoPlacardComponent", + "Text": "Player Spawner", + "TextboxUiId": 3 + } + }, + "Component_[3637526016639674263]": { + "$type": "EditorInspectorComponent", + "Id": 3637526016639674263 + }, + "Component_[411288956840653761]": { + "$type": "EditorVisibilityComponent", + "Id": 411288956840653761 + }, + "Component_[7478123538122523484]": { + "$type": "EditorMaterialComponent", + "Id": 7478123538122523484, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 1803671422 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{BAFF94C3-ECD8-517A-A3F7-585F56D8519E}" + }, + "assetHint": "materials/uicanvasrendertarget.azmaterial" + }, + "PropertyOverrides": { + "baseColor.textureMap": { + "$type": "AssetId", + "Value": { + "guid": "{AF0A7066-3089-51DF-B847-BAB45A9F3BA8}" + } + } + } + } + } + ] + } + } + }, + "Component_[7814534240752180395]": { + "$type": "EditorEntityIconComponent", + "Id": 7814534240752180395 + }, + "Component_[8328462562183634271]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8328462562183634271 + } + } + }, "Entity_[412839637138]": { "Id": "Entity_[412839637138]", "Name": "Ground", @@ -286,6 +712,13 @@ 0.0, -0.5 ], + "MaterialSlots": { + "Slots": [ + { + "Name": "Entire object" + } + ] + }, "MaterialSelection": { "MaterialIds": [ {} @@ -389,6 +822,170 @@ } } }, + "Entity_[527570584484]": { + "Id": "Entity_[527570584484]", + "Name": "Non-Networked Collider Cone", + "Components": { + "Component_[11365849032811673334]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 11365849032811673334, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{8E6D29E3-0019-5C5A-9F5D-61656BC02DD7}", + "subId": 284874770 + }, + "assetHint": "materialeditor/viewportmodels/cone.azmodel" + } + } + } + }, + "Component_[11893727649211090220]": { + "$type": "EditorInspectorComponent", + "Id": 11893727649211090220 + }, + "Component_[12666512609188305871]": { + "$type": "EditorEntitySortComponent", + "Id": 12666512609188305871 + }, + "Component_[13123673913682959349]": { + "$type": "SelectionComponent", + "Id": 13123673913682959349 + }, + "Component_[13144559215878829395]": { + "$type": "EditorCapsuleShapeComponent", + "Id": 13144559215878829395, + "CapsuleShape": { + "Configuration": { + "Height": 2.0199995040893555, + "Radius": 0.5099998116493225 + } + } + }, + "Component_[13545070526863732984]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13545070526863732984 + }, + "Component_[2917092960552172245]": { + "$type": "EditorVisibilityComponent", + "Id": 2917092960552172245 + }, + "Component_[314388126526494153]": { + "$type": "EditorLockComponent", + "Id": 314388126526494153 + }, + "Component_[4556394461817145286]": { + "$type": "EditorShapeColliderComponent", + "Id": 4556394461817145286, + "ColliderConfiguration": { + "MaterialSlots": { + "Slots": [ + { + "Name": "Entire object" + } + ] + } + }, + "ShapeConfigs": [ + { + "$type": "CapsuleShapeConfiguration", + "Scale": [ + 5.0, + 5.0, + 5.0 + ], + "Height": 2.0199995040893555, + "Radius": 0.5099998116493225 + } + ] + }, + "Component_[5659232833946237858]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5659232833946237858 + }, + "Component_[5750980930171977015]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5750980930171977015 + }, + "Component_[8183427957295968439]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 8183427957295968439, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + -13.409862518310547, + -4.682985305786133, + -0.057463884353637695 + ], + "UniformScale": 5.0 + } + }, + "Component_[9587580064430300452]": { + "$type": "EditorEntityIconComponent", + "Id": 9587580064430300452 + } + } + }, + "Entity_[58245980399131]": { + "Id": "Entity_[58245980399131]", + "Name": "Placards", + "Components": { + "Component_[10845841516258260476]": { + "$type": "EditorInspectorComponent", + "Id": 10845841516258260476 + }, + "Component_[1124249492795142133]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1124249492795142133 + }, + "Component_[13128272933725231188]": { + "$type": "EditorEntityIconComponent", + "Id": 13128272933725231188 + }, + "Component_[13859939896291816591]": { + "$type": "EditorLockComponent", + "Id": 13859939896291816591 + }, + "Component_[15064289562588327909]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15064289562588327909 + }, + "Component_[16677726473912230180]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16677726473912230180, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + -5.770221710205078, + -7.2389349937438965, + 2.2522220611572266 + ] + } + }, + "Component_[5177580943559829252]": { + "$type": "EditorVisibilityComponent", + "Id": 5177580943559829252 + }, + "Component_[5742617148984903511]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5742617148984903511 + }, + "Component_[6908672858059846726]": { + "$type": "SelectionComponent", + "Id": 6908672858059846726 + }, + "Component_[7244139806392340775]": { + "$type": "EditorEntitySortComponent", + "Id": 7244139806392340775, + "Child Entity Order": [ + "Entity_[32726940402596]", + "Entity_[1234584512027]", + "Entity_[115072692692507]" + ] + } + } + }, "Entity_[5919988826203]": { "Id": "Entity_[5919988826203]", "Name": "Spawner", @@ -831,6 +1428,13 @@ "$type": "EditorInspectorComponent", "Id": 154105298091518109 }, + "Component_[15452140819580244001]": { + "$type": "GenericComponentWrapper", + "Id": 15452140819580244001, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, "Component_[17443734220531699641]": { "$type": "EditorOnlyEntityComponent", "Id": 17443734220531699641 @@ -845,14 +1449,14 @@ "Parent Entity": "Entity_[356758116574]", "Transform Data": { "Translate": [ - 0.06682876497507095, - -24.63435935974121, - 4.558357238769531 + -4.670708179473877, + -12.568869590759277, + 2.5842885971069336 ], "Rotate": [ - 0.0, - 0.0, - -0.7674942016601563 + -15.064143180847168, + -1.8968206644058228, + 7.010972023010254 ] } }, @@ -869,7 +1473,7 @@ "Id": 7092071161962745685, "Controller": { "Configuration": { - "EditorEntityId": 15187897994861804639 + "EditorEntityId": 1156090235889129538 } } }, diff --git a/Materials/UICanvasRenderTarget.material b/Materials/UICanvasRenderTarget.material new file mode 100644 index 000000000..81c06d775 --- /dev/null +++ b/Materials/UICanvasRenderTarget.material @@ -0,0 +1,20 @@ +{ + "materialType": "Materials/Types/StandardPBR.materialtype", + "materialTypeVersion": 5, + "propertyValues": { + "baseColor.color": [ + 0.800000011920929, + 0.800000011920929, + 0.800000011920929, + 1.0 + ], + "baseColor.textureMap": "MaterialEditor/ViewportModels/_dev_shaderball_00_basecolor.png", + "emissive.color": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "opacity.factor": 1.0 + } +} \ No newline at end of file diff --git a/UICanvases/WorldSpacePlacard.attimage b/UICanvases/WorldSpacePlacard.attimage new file mode 100644 index 000000000..bbec94d0d --- /dev/null +++ b/UICanvases/WorldSpacePlacard.attimage @@ -0,0 +1,21 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "AttachmentImageAsset", + "ClassData": { + "m_imageDescriptor": { + "BindFlags": [ + "ShaderRead", + "ShaderWrite", + "Color" + ], + "Size": { + "Width": 256, + "Height": 256 + }, + "Format": 19 + }, + "Name": "$UiCanvasTexture", + "IsUniqueName": true + } +} \ No newline at end of file diff --git a/UICanvases/WorldSpacePlacard.uicanvas b/UICanvases/WorldSpacePlacard.uicanvas new file mode 100644 index 000000000..23b549bc5 --- /dev/null +++ b/UICanvases/WorldSpacePlacard.uicanvas @@ -0,0 +1,1057 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9d4185cb3f7be9a666f2834e5bc9b00466f1e7bb Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 30 Jun 2022 22:43:50 -0700 Subject: [PATCH 16/34] Adding level network entity with non-net child Signed-off-by: Gene Walters --- ..._Level_NetEntity_with_NonNetChild.attimage | 21 + Levels/SampleBase/SampleBase.prefab | 410 +++++++++++++++++- 2 files changed, 425 insertions(+), 6 deletions(-) create mode 100644 Levels/SampleBase/Placard_Level_NetEntity_with_NonNetChild.attimage diff --git a/Levels/SampleBase/Placard_Level_NetEntity_with_NonNetChild.attimage b/Levels/SampleBase/Placard_Level_NetEntity_with_NonNetChild.attimage new file mode 100644 index 000000000..b526014d5 --- /dev/null +++ b/Levels/SampleBase/Placard_Level_NetEntity_with_NonNetChild.attimage @@ -0,0 +1,21 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "AttachmentImageAsset", + "ClassData": { + "m_imageDescriptor": { + "BindFlags": [ + "ShaderRead", + "ShaderWrite", + "Color" + ], + "Size": { + "Width": 256, + "Height": 256 + }, + "Format": 19 + }, + "Name": "$Placard_Level_NetEntity_with_NonNetChild", + "IsUniqueName": true + } +} \ No newline at end of file diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index fa9b9cda6..2c54e4e38 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -74,7 +74,8 @@ "Entity_[5997298237531]", "Entity_[6070312681563]", "Entity_[527570584484]", - "Entity_[58245980399131]" + "Entity_[58245980399131]", + "Entity_[37677838535797]" ] } } @@ -437,6 +438,241 @@ } } }, + "Entity_[150339125677173]": { + "Id": "Entity_[150339125677173]", + "Name": "ParticleFx", + "Components": { + "Component_[1081237748441298056]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1081237748441298056 + }, + "Component_[11216887171796495829]": { + "$type": "EditorOnlyEntityComponent", + "Id": 11216887171796495829 + }, + "Component_[16452504819099518150]": { + "$type": "EditorEntitySortComponent", + "Id": 16452504819099518150 + }, + "Component_[17596114369670733307]": { + "$type": "EditorLockComponent", + "Id": 17596114369670733307 + }, + "Component_[3710752804473727545]": { + "$type": "EditorMaterialComponent", + "Id": 3710752804473727545, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 1803671422 + }, + "Value": { + "PropertyOverrides": { + "baseColor.color": { + "$type": "Color", + "Value": [ + 0.027908751741051674, + 0.48299381136894226, + 0.08099488914012909, + 1.0 + ] + } + } + } + } + ] + } + } + }, + "Component_[4066033160078355562]": { + "$type": "EditorInspectorComponent", + "Id": 4066033160078355562 + }, + "Component_[4536896907644442920]": { + "$type": "EditorEntityIconComponent", + "Id": 4536896907644442920 + }, + "Component_[4608910444563065321]": { + "$type": "SelectionComponent", + "Id": 4608910444563065321 + }, + "Component_[6646359010016832696]": { + "$type": "EditorVisibilityComponent", + "Id": 6646359010016832696 + }, + "Component_[8154059186082421813]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 8154059186082421813, + "Parent Entity": "Entity_[37677838535797]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + -0.42352747917175293 + ] + } + }, + "Component_[9186732160580009404]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 9186732160580009404, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{767B3209-EDF7-503A-BF3D-6A69DAABC966}", + "subId": 285003870 + }, + "assetHint": "materialeditor/viewportmodels/plane_1x1.azmodel" + } + } + } + }, + "Component_[939429558173407653]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 939429558173407653 + } + } + }, + "Entity_[163168192990325]": { + "Id": "Entity_[163168192990325]", + "Name": "Placard - Net-Ball with Non-Net ParticleFx", + "Components": { + "Component_[11457023573376145491]": { + "$type": "SelectionComponent", + "Id": 11457023573376145491 + }, + "Component_[1221971212384525398]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1221971212384525398, + "Parent Entity": "Entity_[58245980399131]", + "Transform Data": { + "Translate": [ + 6.083848476409912, + 1.3854260444641113, + -1.9000980854034424 + ], + "Rotate": [ + 44.0, + 0.0, + 0.0 + ] + } + }, + "Component_[12521148944687292920]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12521148944687292920 + }, + "Component_[12835321665484227646]": { + "$type": "EditorLockComponent", + "Id": 12835321665484227646 + }, + "Component_[13357275932950081715]": { + "$type": "EditorEntitySortComponent", + "Id": 13357275932950081715 + }, + "Component_[14633572382975316691]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 14633572382975316691, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{767B3209-EDF7-503A-BF3D-6A69DAABC966}", + "subId": 285003870 + }, + "assetHint": "materialeditor/viewportmodels/plane_1x1.azmodel" + } + } + } + }, + "Component_[15400803850908131451]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15400803850908131451 + }, + "Component_[16297437667241749172]": { + "$type": "GenericComponentWrapper", + "Id": 16297437667241749172, + "m_template": { + "$type": "UiCanvasOnMeshComponent", + "AttachmentImageAssetOverride": { + "assetId": { + "guid": "{84430B69-B561-51EA-A2C6-04CACE551145}" + }, + "assetHint": "levels/samplebase/placard_level_netentity_with_nonnetchild.attimage" + } + } + }, + "Component_[16820956745044132717]": { + "$type": "GenericComponentWrapper", + "Id": 16820956745044132717, + "m_template": { + "$type": "UiCanvasAssetRefComponent", + "CanvasAssetRef": { + "AssetPath": "uicanvases/worldspaceplacard.uicanvas" + }, + "IsAutoLoad": true + } + }, + "Component_[17461824293227247700]": { + "$type": "GenericComponentWrapper", + "Id": 17461824293227247700, + "m_template": { + "$type": "MultiplayerSample::UiCanvasDemoPlacardComponent", + "Text": "Network Ball with Non-Net ParticleFx", + "TextboxUiId": 3 + } + }, + "Component_[3637526016639674263]": { + "$type": "EditorInspectorComponent", + "Id": 3637526016639674263 + }, + "Component_[411288956840653761]": { + "$type": "EditorVisibilityComponent", + "Id": 411288956840653761 + }, + "Component_[7478123538122523484]": { + "$type": "EditorMaterialComponent", + "Id": 7478123538122523484, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 1803671422 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{BAFF94C3-ECD8-517A-A3F7-585F56D8519E}" + }, + "assetHint": "materials/uicanvasrendertarget.azmaterial" + }, + "PropertyOverrides": { + "baseColor.textureMap": { + "$type": "AssetId", + "Value": { + "guid": "{84430B69-B561-51EA-A2C6-04CACE551145}" + } + } + } + } + } + ] + } + } + }, + "Component_[7814534240752180395]": { + "$type": "EditorEntityIconComponent", + "Id": 7814534240752180395 + }, + "Component_[8328462562183634271]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8328462562183634271 + } + } + }, "Entity_[1863191303392]": { "Id": "Entity_[1863191303392]", "Name": "Spawn On Server", @@ -699,6 +935,139 @@ } } }, + "Entity_[37677838535797]": { + "Id": "Entity_[37677838535797]", + "Name": "Ball Net-Entity with Non-Net Child", + "Components": { + "Component_[11735870288175062181]": { + "$type": "SelectionComponent", + "Id": 11735870288175062181 + }, + "Component_[12367515919186104091]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12367515919186104091, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{8CC9B575-39D7-5914-AC42-92A77833E63A}", + "subId": 268692035 + }, + "assetHint": "models/diffuseprobesphere.azmodel" + } + } + } + }, + "Component_[13027672609292727721]": { + "$type": "EditorSphereShapeComponent", + "Id": 13027672609292727721, + "SphereShape": { + "Configuration": { + "Radius": 0.550000011920929 + } + } + }, + "Component_[14720166059315733780]": { + "$type": "EditorRigidBodyComponent", + "Id": 14720166059315733780, + "Configuration": { + "entityId": "", + "Linear damping": 5.0, + "Mass": 523.5988159179688, + "Inertia tensor": { + "roll": 0.0, + "pitch": 0.0, + "yaw": 0.0, + "scale": 52.35987854003906 + } + } + }, + "Component_[1480501426020384086]": { + "$type": "EditorVisibilityComponent", + "Id": 1480501426020384086 + }, + "Component_[14875568387651782137]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14875568387651782137 + }, + "Component_[16377420513017824424]": { + "$type": "EditorEntityIconComponent", + "Id": 16377420513017824424 + }, + "Component_[1775496397764089233]": { + "$type": "EditorLockComponent", + "Id": 1775496397764089233 + }, + "Component_[18210194396034179368]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18210194396034179368, + "Parent Entity": "Entity_[356758116574]", + "Transform Data": { + "Translate": [ + -0.7649859189987183, + -5.974349498748779, + 0.439389705657959 + ] + } + }, + "Component_[3919011340731659607]": { + "$type": "GenericComponentWrapper", + "Id": 3919011340731659607, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[4912773530096322309]": { + "$type": "EditorInspectorComponent", + "Id": 4912773530096322309 + }, + "Component_[5057386170116920896]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5057386170116920896 + }, + "Component_[6029021062967785129]": { + "$type": "GenericComponentWrapper", + "Id": 6029021062967785129, + "m_template": { + "$type": "Multiplayer::NetworkRigidBodyComponent" + } + }, + "Component_[725984638850969331]": { + "$type": "GenericComponentWrapper", + "Id": 725984638850969331, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[7757820644470971111]": { + "$type": "EditorColliderComponent", + "Id": 7757820644470971111, + "ColliderConfiguration": { + "MaterialSlots": { + "Slots": [ + { + "Name": "Entire object" + } + ] + } + }, + "ShapeConfiguration": { + "ShapeType": 0 + } + }, + "Component_[9717622753391867483]": { + "$type": "EditorEntitySortComponent", + "Id": 9717622753391867483, + "Child Entity Order": [ + "Entity_[150339125677173]" + ] + }, + "Component_[981514129882235647]": { + "$type": "EditorPendingCompositionComponent", + "Id": 981514129882235647 + } + } + }, "Entity_[412839637138]": { "Id": "Entity_[412839637138]", "Name": "Ground", @@ -849,6 +1218,34 @@ "$type": "EditorEntitySortComponent", "Id": 12666512609188305871 }, + "Component_[12759718584319174873]": { + "$type": "EditorMaterialComponent", + "Id": 12759718584319174873, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 1803671422 + }, + "Value": { + "PropertyOverrides": { + "baseColor.color": { + "$type": "Color", + "Value": [ + 1.0, + 0.07110704481601715, + 0.07110704481601715, + 1.0 + ] + } + } + } + } + ] + } + } + }, "Component_[13123673913682959349]": { "$type": "SelectionComponent", "Id": 13123673913682959349 @@ -980,6 +1377,7 @@ "Id": 7244139806392340775, "Child Entity Order": [ "Entity_[32726940402596]", + "Entity_[163168192990325]", "Entity_[1234584512027]", "Entity_[115072692692507]" ] @@ -988,7 +1386,7 @@ }, "Entity_[5919988826203]": { "Id": "Entity_[5919988826203]", - "Name": "Spawner", + "Name": "Player Spawner 1", "Components": { "Component_[12821202692257528540]": { "$type": "EditorPendingCompositionComponent", @@ -1064,7 +1462,7 @@ }, "Entity_[5924283793499]": { "Id": "Entity_[5924283793499]", - "Name": "Spawner", + "Name": "Player Spawner 2", "Components": { "Component_[12821202692257528540]": { "$type": "EditorPendingCompositionComponent", @@ -1145,7 +1543,7 @@ }, "Entity_[5997298237531]": { "Id": "Entity_[5997298237531]", - "Name": "Spawner", + "Name": "Player Spawner 3", "Components": { "Component_[10353920187632550272]": { "$type": "GenericComponentWrapper", @@ -1226,7 +1624,7 @@ }, "Entity_[6070312681563]": { "Id": "Entity_[6070312681563]", - "Name": "Spawner", + "Name": "Player Spawner 4", "Components": { "Component_[12821202692257528540]": { "$type": "EditorPendingCompositionComponent", @@ -1473,7 +1871,7 @@ "Id": 7092071161962745685, "Controller": { "Configuration": { - "EditorEntityId": 1156090235889129538 + "EditorEntityId": 8580879564549214021 } } }, From 976e150f9ca0d8ec34be842de9e061634c145790 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 30 Jun 2022 22:49:10 -0700 Subject: [PATCH 17/34] Minor fix to make 'particle fx' double sided Signed-off-by: Gene Walters --- Levels/SampleBase/SampleBase.prefab | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index 2c54e4e38..deb82126a 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -505,14 +505,7 @@ "Component_[8154059186082421813]": { "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", "Id": 8154059186082421813, - "Parent Entity": "Entity_[37677838535797]", - "Transform Data": { - "Translate": [ - 0.0, - 0.0, - -0.42352747917175293 - ] - } + "Parent Entity": "Entity_[37677838535797]" }, "Component_[9186732160580009404]": { "$type": "AZ::Render::EditorMeshComponent", From ca1a9b6b4da371fb60341f6ab14c2e19ce85db95 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 1 Jul 2022 15:00:56 -0700 Subject: [PATCH 18/34] Moving placard components to sub folder called UI folder since these really arent related to the other components which are mostly networking/gameplay related. Signed-off-by: Gene Walters --- .../{ => UI}/UiCanvasDemoPlacardComponent.cpp | 2 +- .../{ => UI}/UiCanvasDemoPlacardComponent.h | 0 Gem/Code/Source/MultiplayerSampleModule.cpp | 2 +- Gem/Code/multiplayersample_files.cmake | 4 +- Levels/SampleBase/SampleBase.prefab | 112 +++++++++++++++++- 5 files changed, 113 insertions(+), 7 deletions(-) rename Gem/Code/Source/Components/{ => UI}/UiCanvasDemoPlacardComponent.cpp (98%) rename Gem/Code/Source/Components/{ => UI}/UiCanvasDemoPlacardComponent.h (100%) diff --git a/Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.cpp b/Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.cpp similarity index 98% rename from Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.cpp rename to Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.cpp index 6909ce14e..03493da24 100644 --- a/Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.cpp +++ b/Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.cpp @@ -6,7 +6,7 @@ * */ -#include +#include #include #include diff --git a/Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.h b/Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.h similarity index 100% rename from Gem/Code/Source/Components/UiCanvasDemoPlacardComponent.h rename to Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.h diff --git a/Gem/Code/Source/MultiplayerSampleModule.cpp b/Gem/Code/Source/MultiplayerSampleModule.cpp index 5fd1aaaa9..03ac2cb64 100644 --- a/Gem/Code/Source/MultiplayerSampleModule.cpp +++ b/Gem/Code/Source/MultiplayerSampleModule.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include "MultiplayerSampleSystemComponent.h" diff --git a/Gem/Code/multiplayersample_files.cmake b/Gem/Code/multiplayersample_files.cmake index 6bec21791..a60573adb 100644 --- a/Gem/Code/multiplayersample_files.cmake +++ b/Gem/Code/multiplayersample_files.cmake @@ -47,8 +47,8 @@ set(FILES Source/Components/NetworkStressTestComponent.h Source/Components/NetworkPlayerMovementComponent.cpp Source/Components/NetworkPlayerMovementComponent.h - Source/Components/UiCanvasDemoPlacardComponent.cpp - Source/Components/UiCanvasDemoPlacardComponent.h + Source/Components/UI/UiCanvasDemoPlacardComponent.cpp + Source/Components/UI/UiCanvasDemoPlacardComponent.h Source/Spawners/IPlayerSpawner.h Source/Spawners/RoundRobinSpawner.h Source/Spawners/RoundRobinSpawner.cpp diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index deb82126a..c0652de7b 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -170,7 +170,7 @@ "Id": 17461824293227247700, "m_template": { "$type": "MultiplayerSample::UiCanvasDemoPlacardComponent", - "Text": "Non-Networked Static Collider in the Level", + "Text": "Non-Networked Static Collider", "TextboxUiId": 3 } }, @@ -308,7 +308,7 @@ "Id": 17461824293227247700, "m_template": { "$type": "MultiplayerSample::UiCanvasDemoPlacardComponent", - "Text": "Prefab of Nested Network Entities in the Level", + "Text": "Prefab of Nested Network Entities", "TextboxUiId": 3 } }, @@ -478,6 +478,10 @@ 0.08099488914012909, 1.0 ] + }, + "general.doubleSided": { + "$type": "bool", + "Value": true } } } @@ -790,6 +794,107 @@ } } }, + "Entity_[218912573525109]": { + "Id": "Entity_[218912573525109]", + "Name": "ParticleFx", + "Components": { + "Component_[1081237748441298056]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1081237748441298056 + }, + "Component_[11216887171796495829]": { + "$type": "EditorOnlyEntityComponent", + "Id": 11216887171796495829 + }, + "Component_[16452504819099518150]": { + "$type": "EditorEntitySortComponent", + "Id": 16452504819099518150 + }, + "Component_[17596114369670733307]": { + "$type": "EditorLockComponent", + "Id": 17596114369670733307 + }, + "Component_[3710752804473727545]": { + "$type": "EditorMaterialComponent", + "Id": 3710752804473727545, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 1803671422 + }, + "Value": { + "PropertyOverrides": { + "baseColor.color": { + "$type": "Color", + "Value": [ + 0.027908751741051674, + 0.48299381136894226, + 0.08099488914012909, + 1.0 + ] + }, + "general.doubleSided": { + "$type": "bool", + "Value": true + } + } + } + } + ] + } + } + }, + "Component_[4066033160078355562]": { + "$type": "EditorInspectorComponent", + "Id": 4066033160078355562 + }, + "Component_[4536896907644442920]": { + "$type": "EditorEntityIconComponent", + "Id": 4536896907644442920 + }, + "Component_[4608910444563065321]": { + "$type": "SelectionComponent", + "Id": 4608910444563065321 + }, + "Component_[6646359010016832696]": { + "$type": "EditorVisibilityComponent", + "Id": 6646359010016832696 + }, + "Component_[8154059186082421813]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 8154059186082421813, + "Parent Entity": "Entity_[37677838535797]", + "Transform Data": { + "Rotate": [ + 0.0, + -86.88057708740234, + 0.0 + ] + } + }, + "Component_[9186732160580009404]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 9186732160580009404, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{767B3209-EDF7-503A-BF3D-6A69DAABC966}", + "subId": 285003870 + }, + "assetHint": "materialeditor/viewportmodels/plane_1x1.azmodel" + } + } + } + }, + "Component_[939429558173407653]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 939429558173407653 + } + } + }, "Entity_[32726940402596]": { "Id": "Entity_[32726940402596]", "Name": "Placard - Player Spawner", @@ -1052,7 +1157,8 @@ "$type": "EditorEntitySortComponent", "Id": 9717622753391867483, "Child Entity Order": [ - "Entity_[150339125677173]" + "Entity_[150339125677173]", + "Entity_[218912573525109]" ] }, "Component_[981514129882235647]": { From 47ece4fb083499f632db906557da2402ac7c74d2 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Tue, 12 Jul 2022 15:00:46 -0700 Subject: [PATCH 19/34] Remove FlyCameraComponent and update SimplePlayerCamera interpolation Signed-off-by: puvvadar --- .../NetworkSimplePlayerCameraComponent.cpp | 34 ++++++++++++++----- .../NetworkSimplePlayerCameraComponent.h | 4 +++ Levels/SampleBase/SampleBase.prefab | 7 ---- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp index 2dfdc9493..bd91e7a03 100644 --- a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp +++ b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp @@ -10,11 +10,11 @@ #include #include #include +#include namespace MultiplayerSample { AZ_CVAR(AZ::Vector3, cl_cameraOffset, AZ::Vector3(0.0f, -5.0f, 3.0f), nullptr, AZ::ConsoleFunctorFlags::Null, "Offset to use for the player camera"); - AZ_CVAR(float, cl_cameraBlendSpeed, 0.25f, nullptr, AZ::ConsoleFunctorFlags::Null, "Rate to blend camera to latest transform"); NetworkSimplePlayerCameraComponentController::NetworkSimplePlayerCameraComponentController(NetworkSimplePlayerCameraComponent& parent) : NetworkSimplePlayerCameraComponentControllerBase(parent) @@ -63,20 +63,36 @@ namespace MultiplayerSample return GetAimAngles().GetY(); } + float NetworkSimplePlayerCameraComponentController::GetCameraYawPrevious() const + { + return GetAimAnglesPrevious().GetZ(); + } + + float NetworkSimplePlayerCameraComponentController::GetCameraPitchPrevious() const + { + return GetAimAnglesPrevious().GetX(); + } + + float NetworkSimplePlayerCameraComponentController::GetCameraRollPrevious() const + { + return GetAimAnglesPrevious().GetY(); + } + void NetworkSimplePlayerCameraComponentController::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { if (m_activeCameraEntity != nullptr && m_activeCameraEntity->GetState() == AZ::Entity::State::Active) { const AZ::Quaternion targetRotation = AZ::Quaternion::CreateRotationZ(GetCameraYaw()) * AZ::Quaternion::CreateRotationX(GetCameraPitch()); - const AZ::Quaternion currentRotation = m_activeCameraEntity->GetTransform()->GetWorldTM().GetRotation(); - AZ::Quaternion aimRotation; - if(GetSyncAimImmediate()) - { - aimRotation = targetRotation; - } - else + const float blendFactor = Multiplayer::GetMultiplayer()->GetCurrentBlendFactor(); + + AZ::Quaternion aimRotation = targetRotation; + if (!GetSyncAimImmediate() && !AZ::IsClose(blendFactor, 1.0f)) { - aimRotation = currentRotation.Slerp(targetRotation, cl_cameraBlendSpeed).GetNormalized(); + const AZ::Quaternion prevRotation = AZ::Quaternion::CreateRotationZ(GetCameraYawPrevious()) * AZ::Quaternion::CreateRotationX(GetCameraPitchPrevious()); + if (!prevRotation.IsClose(targetRotation)) + { + aimRotation = prevRotation.Slerp(targetRotation, blendFactor).GetNormalized(); + } } const AZ::Vector3 targetTranslation = GetEntity()->GetTransform()->GetWorldTM().GetTranslation(); const AZ::Vector3 cameraOffset = aimRotation.TransformVector(cl_cameraOffset); diff --git a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h index a1e885895..7caf6d297 100644 --- a/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h +++ b/Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.h @@ -26,6 +26,10 @@ namespace MultiplayerSample float GetCameraPitch() const; float GetCameraRoll() const; + float GetCameraYawPrevious() const; + float GetCameraPitchPrevious() const; + float GetCameraRollPrevious() const; + private: //! AZ::TickBus interface //! @{ diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index c0652de7b..6c1734b17 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -1925,13 +1925,6 @@ "$type": "EditorInspectorComponent", "Id": 154105298091518109 }, - "Component_[15452140819580244001]": { - "$type": "GenericComponentWrapper", - "Id": 15452140819580244001, - "m_template": { - "$type": "FlyCameraInputComponent" - } - }, "Component_[17443734220531699641]": { "$type": "EditorOnlyEntityComponent", "Id": 17443734220531699641 From 24a50960978d8ff60de7ef435ffcf276fc22c1e1 Mon Sep 17 00:00:00 2001 From: gene-walt Date: Tue, 26 Jul 2022 19:15:12 -0700 Subject: [PATCH 20/34] Misc cfg cleanup to help prevent workflow-6 (multiplayer) confusion. Removed unused autoexec.cfg, we can bring this back as needed for autolaunching a starter level for releases, but it wasnt being used and still using old cry map commands. Moved as many cvars out of Editor.cfg into the proper commands.editor.setreg; note we still need Editor.cfg to load the legacy cry cvars. Added cmd's to partner up with the server/client cfg so users know those cfg's arn't automatically loaded and instead need to be used in a commandline Signed-off-by: gene-walt --- Registry/commands.editor.setreg | 18 ++++++++++++++++++ autoexec.cfg | 1 - editor.cfg | 3 --- client.cfg => launch_client.cfg | 0 launch_client.cmd | 1 + server.cfg => launch_server.cfg | 0 launch_server.cmd | 1 + 7 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 Registry/commands.editor.setreg delete mode 100644 autoexec.cfg rename client.cfg => launch_client.cfg (100%) create mode 100644 launch_client.cmd rename server.cfg => launch_server.cfg (100%) create mode 100644 launch_server.cmd diff --git a/Registry/commands.editor.setreg b/Registry/commands.editor.setreg new file mode 100644 index 000000000..44c9b717f --- /dev/null +++ b/Registry/commands.editor.setreg @@ -0,0 +1,18 @@ +{ + "Amazon": + { + "AzCore": + { + "Runtime": + { + "ConsoleCommands": + { + "editorsv_enabled": true, + "editorsv_launch": true, + "editorsv_hidden": true, + "editorsv_rhi_override": "null" + } + } + } + } +} \ No newline at end of file diff --git a/autoexec.cfg b/autoexec.cfg deleted file mode 100644 index c6647fc14..000000000 --- a/autoexec.cfg +++ /dev/null @@ -1 +0,0 @@ -map default \ No newline at end of file diff --git a/editor.cfg b/editor.cfg index f432de409..f4294f47f 100644 --- a/editor.cfg +++ b/editor.cfg @@ -1,5 +1,2 @@ -editorsv_enabled=true ed_keepEditorActive=true -editorsv_hidden=true -editorsv_rhi_override=null ed_backgroundUpdatePeriod=-1 \ No newline at end of file diff --git a/client.cfg b/launch_client.cfg similarity index 100% rename from client.cfg rename to launch_client.cfg diff --git a/launch_client.cmd b/launch_client.cmd new file mode 100644 index 000000000..db79cfba0 --- /dev/null +++ b/launch_client.cmd @@ -0,0 +1 @@ +.\build\windows\bin\profile\MultiplayerSample.GameLauncher.exe --console-command-file=launch_client.cfg \ No newline at end of file diff --git a/server.cfg b/launch_server.cfg similarity index 100% rename from server.cfg rename to launch_server.cfg diff --git a/launch_server.cmd b/launch_server.cmd new file mode 100644 index 000000000..e4fdc27ee --- /dev/null +++ b/launch_server.cmd @@ -0,0 +1 @@ +.\build\windows\bin\profile\MultiplayerSample.ServerLauncher.exe --console-command-file=launch_server.cfg \ No newline at end of file From 8d0c76608b19c85ff8d4ead7bd6189e615d795c9 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 26 Jul 2022 20:44:01 -0700 Subject: [PATCH 21/34] Updating demo placards to use textures instead of rendering them out with LyShine rendertargets so that they can also appear on server. Removing old placard tech since it isn't needed Signed-off-by: Gene Walters --- .../UI/UiCanvasDemoPlacardComponent.cpp | 83 -- .../UI/UiCanvasDemoPlacardComponent.h | 51 - Gem/Code/multiplayersample_files.cmake | 2 - .../PlacardImages/NetParent_NonNetChild.png | 3 + .../PlacardImages/NonNet_StaticCollider.png | 3 + .../PlacardImages/PlayerSpawner.png | 3 + .../Prefab_NestedNetEntities.png | 3 + Levels/SampleBase/SampleBase.prefab | 181 +-- ...erTarget.material => DemoPlacard.material} | 0 UICanvases/WorldSpacePlacard.attimage | 21 - UICanvases/WorldSpacePlacard.uicanvas | 1057 ----------------- 11 files changed, 39 insertions(+), 1368 deletions(-) delete mode 100644 Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.cpp delete mode 100644 Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.h create mode 100644 Levels/SampleBase/PlacardImages/NetParent_NonNetChild.png create mode 100644 Levels/SampleBase/PlacardImages/NonNet_StaticCollider.png create mode 100644 Levels/SampleBase/PlacardImages/PlayerSpawner.png create mode 100644 Levels/SampleBase/PlacardImages/Prefab_NestedNetEntities.png rename Materials/{UICanvasRenderTarget.material => DemoPlacard.material} (100%) delete mode 100644 UICanvases/WorldSpacePlacard.attimage delete mode 100644 UICanvases/WorldSpacePlacard.uicanvas diff --git a/Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.cpp b/Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.cpp deleted file mode 100644 index 03493da24..000000000 --- a/Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 - -#include -#include - -#include -#include - -namespace MultiplayerSample -{ - void UiCanvasDemoPlacardComponent::Activate() - { - AZ::EntityId uiCanvasEntityId; - UiCanvasRefBus::EventResult(uiCanvasEntityId, GetEntityId(), &UiCanvasRefBus::Events::GetCanvas); - if (uiCanvasEntityId.IsValid()) - { - SetUiCanvasText(uiCanvasEntityId); - } - else - { - UiCanvasAssetRefNotificationBus::Handler::BusConnect(GetEntityId()); - } - } - - void UiCanvasDemoPlacardComponent::Deactivate() - { - UiCanvasAssetRefNotificationBus::Handler::BusDisconnect(GetEntityId()); - } - - void UiCanvasDemoPlacardComponent::Reflect(AZ::ReflectContext* context) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1) - ->Field("Text", &UiCanvasDemoPlacardComponent::m_placardText) - ->Field("TextboxUiId", &UiCanvasDemoPlacardComponent::m_placardTextboxUiElementId) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("UiCanvasDemoPlacardComponent", "Helper component for setting up UI canvases placards on meshes in and around the world. This component can dynamically change the placard text so that we can reuse one UiCanvas for multiple placards.") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Category, "ComponentCategory") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/Component_Placeholder.svg") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")) - - ->DataElement(AZ::Edit::UIHandlers::Default, &UiCanvasDemoPlacardComponent::m_placardTextboxUiElementId, "Textbox UIElement Id", "The element id of the textbox you want to change. (Find the id inside the ui canvas)") - ->DataElement(AZ::Edit::UIHandlers::Default, &UiCanvasDemoPlacardComponent::m_placardText, "Placard Text", "Setting this text will change the textbox's text.") - ; - } - } - } - - void UiCanvasDemoPlacardComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required) - { - required.push_back(AZ_CRC("UiCanvasRefService")); - } - - void UiCanvasDemoPlacardComponent::OnCanvasLoadedIntoEntity(AZ::EntityId uiCanvasEntity) - { - SetUiCanvasText(uiCanvasEntity); - } - - void UiCanvasDemoPlacardComponent::SetUiCanvasText(AZ::EntityId uiCanvasEntityId) - { - AZ::Entity* textBoxEntity; - UiCanvasBus::EventResult(textBoxEntity, uiCanvasEntityId, &UiCanvasBus::Events::FindElementById, m_placardTextboxUiElementId); - - if (textBoxEntity != nullptr) - { - UiTextBus::Event(textBoxEntity->GetId(), &UiTextBus::Events::SetText, m_placardText); - } - } -} // namespace MultiplayerSample diff --git a/Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.h b/Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.h deleted file mode 100644 index dad3179a2..000000000 --- a/Gem/Code/Source/Components/UI/UiCanvasDemoPlacardComponent.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 -#include - -namespace MultiplayerSample -{ - class UiCanvasDemoPlacardComponent - : public AZ::Component - , UiCanvasAssetRefNotificationBus::Handler - { - public: - AZ_COMPONENT(MultiplayerSample::UiCanvasDemoPlacardComponent, "{8ED1F410-04CA-4180-BF2F-D24A1BB4BF7D}"); - - /* - * Reflects component data into the reflection contexts, including the serialization, edit, and behavior contexts. - */ - static void Reflect(AZ::ReflectContext* context); - - /* - * Specifies the services that this component requires. - * The system activates the required services before it activates this component. - * It also deactivates the required services after it deactivates this component. - * If a required service is missing before this component is activated, the system - * returns an error and does not activate this component. - */ - static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); - - protected: - void Activate() override; - void Deactivate() override; - - private: - // UiCanvasAssetRefNotificationBus overrides ... - void OnCanvasLoadedIntoEntity(AZ::EntityId uiCanvasEntity) override; - - void SetUiCanvasText(AZ::EntityId uiCanvasEntityId); - - private: - int m_placardTextboxUiElementId = 0; - AZStd::string m_placardText = "Default Placard Text"; - }; -} // namespace MultiplayerSample diff --git a/Gem/Code/multiplayersample_files.cmake b/Gem/Code/multiplayersample_files.cmake index a60573adb..5621db636 100644 --- a/Gem/Code/multiplayersample_files.cmake +++ b/Gem/Code/multiplayersample_files.cmake @@ -47,8 +47,6 @@ set(FILES Source/Components/NetworkStressTestComponent.h Source/Components/NetworkPlayerMovementComponent.cpp Source/Components/NetworkPlayerMovementComponent.h - Source/Components/UI/UiCanvasDemoPlacardComponent.cpp - Source/Components/UI/UiCanvasDemoPlacardComponent.h Source/Spawners/IPlayerSpawner.h Source/Spawners/RoundRobinSpawner.h Source/Spawners/RoundRobinSpawner.cpp diff --git a/Levels/SampleBase/PlacardImages/NetParent_NonNetChild.png b/Levels/SampleBase/PlacardImages/NetParent_NonNetChild.png new file mode 100644 index 000000000..6377bc4d2 --- /dev/null +++ b/Levels/SampleBase/PlacardImages/NetParent_NonNetChild.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:162bf0c705e09778478751899094d1dc5c8eb479ace725758c3cc1b08b104af3 +size 9868 diff --git a/Levels/SampleBase/PlacardImages/NonNet_StaticCollider.png b/Levels/SampleBase/PlacardImages/NonNet_StaticCollider.png new file mode 100644 index 000000000..c7e46537f --- /dev/null +++ b/Levels/SampleBase/PlacardImages/NonNet_StaticCollider.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d259ae80ebe5aee7611c2403558549864f6b97d0b82946f1e60d207ef9851893 +size 9365 diff --git a/Levels/SampleBase/PlacardImages/PlayerSpawner.png b/Levels/SampleBase/PlacardImages/PlayerSpawner.png new file mode 100644 index 000000000..31db520da --- /dev/null +++ b/Levels/SampleBase/PlacardImages/PlayerSpawner.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e226fe0ad9f4c37a8844b02c1c79d448de2020f03b2b879d51a097d7117dedb2 +size 6365 diff --git a/Levels/SampleBase/PlacardImages/Prefab_NestedNetEntities.png b/Levels/SampleBase/PlacardImages/Prefab_NestedNetEntities.png new file mode 100644 index 000000000..964cf981b --- /dev/null +++ b/Levels/SampleBase/PlacardImages/Prefab_NestedNetEntities.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c0941fcd349693a3ffd84cb8043112aeafbbbb40b17f2affb57f4c414cbeaf5 +size 10370 diff --git a/Levels/SampleBase/SampleBase.prefab b/Levels/SampleBase/SampleBase.prefab index 6c1734b17..42001db1c 100644 --- a/Levels/SampleBase/SampleBase.prefab +++ b/Levels/SampleBase/SampleBase.prefab @@ -137,43 +137,6 @@ "$type": "EditorDisabledCompositionComponent", "Id": 15400803850908131451 }, - "Component_[16297437667241749172]": { - "$type": "GenericComponentWrapper", - "Id": 16297437667241749172, - "m_template": { - "$type": "UiCanvasOnMeshComponent", - "AttachmentImageAssetOverride": { - "assetId": { - "guid": "{6A3D30FC-1583-5964-81F9-F1DF6BEEB247}" - }, - "assetHint": "levels/samplebase/placard_level_nonnet.attimage" - } - } - }, - "Component_[16820956745044132717]": { - "$type": "GenericComponentWrapper", - "Id": 16820956745044132717, - "m_template": { - "$type": "UiCanvasAssetRefComponent", - "CanvasAssetRef": { - "AssetPath": "uicanvases/worldspaceplacard.uicanvas" - }, - "IsAutoLoad": true - } - }, - "Component_[17331375054040607466]": { - "$type": "EditorScriptCanvasComponent", - "Id": 17331375054040607466 - }, - "Component_[17461824293227247700]": { - "$type": "GenericComponentWrapper", - "Id": 17461824293227247700, - "m_template": { - "$type": "MultiplayerSample::UiCanvasDemoPlacardComponent", - "Text": "Non-Networked Static Collider", - "TextboxUiId": 3 - } - }, "Component_[3637526016639674263]": { "$type": "EditorInspectorComponent", "Id": 3637526016639674263 @@ -195,15 +158,16 @@ "Value": { "MaterialAsset": { "assetId": { - "guid": "{BAFF94C3-ECD8-517A-A3F7-585F56D8519E}" + "guid": "{7097621F-8E36-5B9A-A0EB-822F8D5F6C87}" }, - "assetHint": "materials/uicanvasrendertarget.azmaterial" + "assetHint": "materials/demoplacard.azmaterial" }, "PropertyOverrides": { "baseColor.textureMap": { "$type": "AssetId", "Value": { - "guid": "{6A3D30FC-1583-5964-81F9-F1DF6BEEB247}" + "guid": "{EC56C38E-66BD-59E4-8284-35C30520767D}", + "subId": 1000 } } } @@ -279,39 +243,6 @@ "$type": "EditorDisabledCompositionComponent", "Id": 15400803850908131451 }, - "Component_[16297437667241749172]": { - "$type": "GenericComponentWrapper", - "Id": 16297437667241749172, - "m_template": { - "$type": "UiCanvasOnMeshComponent", - "AttachmentImageAssetOverride": { - "assetId": { - "guid": "{0EEFDB03-CC93-5EEA-8086-EE73FCA6F91A}" - }, - "assetHint": "levels/samplebase/placard_level_nestedprefab.attimage" - } - } - }, - "Component_[16820956745044132717]": { - "$type": "GenericComponentWrapper", - "Id": 16820956745044132717, - "m_template": { - "$type": "UiCanvasAssetRefComponent", - "CanvasAssetRef": { - "AssetPath": "uicanvases/worldspaceplacard.uicanvas" - }, - "IsAutoLoad": true - } - }, - "Component_[17461824293227247700]": { - "$type": "GenericComponentWrapper", - "Id": 17461824293227247700, - "m_template": { - "$type": "MultiplayerSample::UiCanvasDemoPlacardComponent", - "Text": "Prefab of Nested Network Entities", - "TextboxUiId": 3 - } - }, "Component_[3637526016639674263]": { "$type": "EditorInspectorComponent", "Id": 3637526016639674263 @@ -333,15 +264,16 @@ "Value": { "MaterialAsset": { "assetId": { - "guid": "{BAFF94C3-ECD8-517A-A3F7-585F56D8519E}" + "guid": "{7097621F-8E36-5B9A-A0EB-822F8D5F6C87}" }, - "assetHint": "materials/uicanvasrendertarget.azmaterial" + "assetHint": "materials/demoplacard.azmaterial" }, "PropertyOverrides": { "baseColor.textureMap": { "$type": "AssetId", "Value": { - "guid": "{0EEFDB03-CC93-5EEA-8086-EE73FCA6F91A}" + "guid": "{EAD9016E-2AB7-5A00-90DD-B869E08671AD}", + "subId": 1000 } } } @@ -588,39 +520,6 @@ "$type": "EditorDisabledCompositionComponent", "Id": 15400803850908131451 }, - "Component_[16297437667241749172]": { - "$type": "GenericComponentWrapper", - "Id": 16297437667241749172, - "m_template": { - "$type": "UiCanvasOnMeshComponent", - "AttachmentImageAssetOverride": { - "assetId": { - "guid": "{84430B69-B561-51EA-A2C6-04CACE551145}" - }, - "assetHint": "levels/samplebase/placard_level_netentity_with_nonnetchild.attimage" - } - } - }, - "Component_[16820956745044132717]": { - "$type": "GenericComponentWrapper", - "Id": 16820956745044132717, - "m_template": { - "$type": "UiCanvasAssetRefComponent", - "CanvasAssetRef": { - "AssetPath": "uicanvases/worldspaceplacard.uicanvas" - }, - "IsAutoLoad": true - } - }, - "Component_[17461824293227247700]": { - "$type": "GenericComponentWrapper", - "Id": 17461824293227247700, - "m_template": { - "$type": "MultiplayerSample::UiCanvasDemoPlacardComponent", - "Text": "Network Ball with Non-Net ParticleFx", - "TextboxUiId": 3 - } - }, "Component_[3637526016639674263]": { "$type": "EditorInspectorComponent", "Id": 3637526016639674263 @@ -642,15 +541,16 @@ "Value": { "MaterialAsset": { "assetId": { - "guid": "{BAFF94C3-ECD8-517A-A3F7-585F56D8519E}" + "guid": "{7097621F-8E36-5B9A-A0EB-822F8D5F6C87}" }, - "assetHint": "materials/uicanvasrendertarget.azmaterial" + "assetHint": "materials/demoplacard.azmaterial" }, "PropertyOverrides": { "baseColor.textureMap": { "$type": "AssetId", "Value": { - "guid": "{84430B69-B561-51EA-A2C6-04CACE551145}" + "guid": "{1DFA38B9-4725-5CC4-8A44-926064180026}", + "subId": 1000 } } } @@ -951,39 +851,6 @@ "$type": "EditorDisabledCompositionComponent", "Id": 15400803850908131451 }, - "Component_[16297437667241749172]": { - "$type": "GenericComponentWrapper", - "Id": 16297437667241749172, - "m_template": { - "$type": "UiCanvasOnMeshComponent", - "AttachmentImageAssetOverride": { - "assetId": { - "guid": "{AF0A7066-3089-51DF-B847-BAB45A9F3BA8}" - }, - "assetHint": "levels/samplebase/placard_dynamicspawn_player.attimage" - } - } - }, - "Component_[16820956745044132717]": { - "$type": "GenericComponentWrapper", - "Id": 16820956745044132717, - "m_template": { - "$type": "UiCanvasAssetRefComponent", - "CanvasAssetRef": { - "AssetPath": "uicanvases/worldspaceplacard.uicanvas" - }, - "IsAutoLoad": true - } - }, - "Component_[17461824293227247700]": { - "$type": "GenericComponentWrapper", - "Id": 17461824293227247700, - "m_template": { - "$type": "MultiplayerSample::UiCanvasDemoPlacardComponent", - "Text": "Player Spawner", - "TextboxUiId": 3 - } - }, "Component_[3637526016639674263]": { "$type": "EditorInspectorComponent", "Id": 3637526016639674263 @@ -1005,15 +872,16 @@ "Value": { "MaterialAsset": { "assetId": { - "guid": "{BAFF94C3-ECD8-517A-A3F7-585F56D8519E}" + "guid": "{7097621F-8E36-5B9A-A0EB-822F8D5F6C87}" }, - "assetHint": "materials/uicanvasrendertarget.azmaterial" + "assetHint": "materials/demoplacard.azmaterial" }, "PropertyOverrides": { "baseColor.textureMap": { "$type": "AssetId", "Value": { - "guid": "{AF0A7066-3089-51DF-B847-BAB45A9F3BA8}" + "guid": "{D71272BE-8D7E-51E7-99DE-81A4473939D4}", + "subId": 1000 } } } @@ -1072,12 +940,17 @@ "entityId": "", "Linear damping": 5.0, "Mass": 523.5988159179688, - "Inertia tensor": { - "roll": 0.0, - "pitch": 0.0, - "yaw": 0.0, - "scale": 52.35987854003906 - } + "Inertia tensor": [ + 52.35987854003906, + 0.0, + 0.0, + 0.0, + 52.35987854003906, + 0.0, + 0.0, + 0.0, + 52.35987854003906 + ] } }, "Component_[1480501426020384086]": { diff --git a/Materials/UICanvasRenderTarget.material b/Materials/DemoPlacard.material similarity index 100% rename from Materials/UICanvasRenderTarget.material rename to Materials/DemoPlacard.material diff --git a/UICanvases/WorldSpacePlacard.attimage b/UICanvases/WorldSpacePlacard.attimage deleted file mode 100644 index bbec94d0d..000000000 --- a/UICanvases/WorldSpacePlacard.attimage +++ /dev/null @@ -1,21 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "AttachmentImageAsset", - "ClassData": { - "m_imageDescriptor": { - "BindFlags": [ - "ShaderRead", - "ShaderWrite", - "Color" - ], - "Size": { - "Width": 256, - "Height": 256 - }, - "Format": 19 - }, - "Name": "$UiCanvasTexture", - "IsUniqueName": true - } -} \ No newline at end of file diff --git a/UICanvases/WorldSpacePlacard.uicanvas b/UICanvases/WorldSpacePlacard.uicanvas deleted file mode 100644 index 23b549bc5..000000000 --- a/UICanvases/WorldSpacePlacard.uicanvas +++ /dev/null @@ -1,1057 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 0e95d42393ae98e325032f5b93362aebef6e6379 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 26 Jul 2022 20:53:31 -0700 Subject: [PATCH 22/34] Minor: adding missing file update Signed-off-by: Gene Walters --- Gem/Code/Source/MultiplayerSampleModule.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Gem/Code/Source/MultiplayerSampleModule.cpp b/Gem/Code/Source/MultiplayerSampleModule.cpp index 03ac2cb64..e8d9a110c 100644 --- a/Gem/Code/Source/MultiplayerSampleModule.cpp +++ b/Gem/Code/Source/MultiplayerSampleModule.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include "MultiplayerSampleSystemComponent.h" @@ -32,8 +31,7 @@ namespace MultiplayerSample m_descriptors.insert(m_descriptors.end(), { MultiplayerSampleSystemComponent::CreateDescriptor(), ExampleFilteredEntityComponent::CreateDescriptor(), - NetworkPrefabSpawnerComponent::CreateDescriptor(), - UiCanvasDemoPlacardComponent::CreateDescriptor() + NetworkPrefabSpawnerComponent::CreateDescriptor() }); CreateComponentDescriptors(m_descriptors); From 89ee91742144cacfd196fe511391e7ad69865335 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 27 Jul 2022 15:10:14 -0700 Subject: [PATCH 23/34] Fixing compile error due to bad archetype property, now that archetypes init values are working Signed-off-by: Gene Walters --- .../Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gem/Code/Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml b/Gem/Code/Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml index bdbf80718..5aad33075 100644 --- a/Gem/Code/Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml +++ b/Gem/Code/Source/AutoGen/NetworkStressTestComponent.AutoComponent.xml @@ -8,7 +8,7 @@ OverrideInclude="Source/Components/NetworkStressTestComponent.h" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + From b20df2b56cd465f268081c172c850c1e5f7e559b Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 27 Jul 2022 16:59:51 -0700 Subject: [PATCH 24/34] reverting editor.cfg and commands.editor.setreg split based on pr feedback Signed-off-by: Gene Walters --- Registry/commands.editor.setreg | 18 ------------------ editor.cfg | 3 +++ 2 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 Registry/commands.editor.setreg diff --git a/Registry/commands.editor.setreg b/Registry/commands.editor.setreg deleted file mode 100644 index 44c9b717f..000000000 --- a/Registry/commands.editor.setreg +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Amazon": - { - "AzCore": - { - "Runtime": - { - "ConsoleCommands": - { - "editorsv_enabled": true, - "editorsv_launch": true, - "editorsv_hidden": true, - "editorsv_rhi_override": "null" - } - } - } - } -} \ No newline at end of file diff --git a/editor.cfg b/editor.cfg index f4294f47f..f432de409 100644 --- a/editor.cfg +++ b/editor.cfg @@ -1,2 +1,5 @@ +editorsv_enabled=true ed_keepEditorActive=true +editorsv_hidden=true +editorsv_rhi_override=null ed_backgroundUpdatePeriod=-1 \ No newline at end of file From 61fffb6b8724f116c83b3223aba9d1184cbec46a Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 28 Jul 2022 14:54:32 -0700 Subject: [PATCH 25/34] Wip. Hack, needed to update spawner to set auton before the player is activated Signed-off-by: Gene Walters --- .../MultiplayerSampleSystemComponent.cpp | 36 +++++++++++++++++++ .../Source/MultiplayerSampleSystemComponent.h | 3 ++ 2 files changed, 39 insertions(+) diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index 3e9d548d5..fcf674d1f 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -108,6 +108,41 @@ namespace MultiplayerSample return AZ::TICK_PLACEMENT + 2; } + void MultiplayerSampleSystemComponent::EnableAutonomousControl(Multiplayer::NetworkEntityHandle entityHandle, AzNetworking::ConnectionId connectionId) + { + if (!entityHandle.Exists()) + { + AZLOG_WARN("Attempting to enable autonomous control for an invalid entity"); + return; + } + + entityHandle.GetNetBindComponent()->SetOwningConnectionId(connectionId); + if (connectionId == InvalidConnectionId) + { + entityHandle.GetNetBindComponent()->SetAllowAutonomy(true); + } + + /*auto* hierarchyComponent = entityHandle.FindComponent(); + if (hierarchyComponent != nullptr) + { + for (AZ::Entity* subEntity : hierarchyComponent->GetHierarchicalEntities()) + { + NetworkEntityHandle subEntityHandle = NetworkEntityHandle(subEntity); + NetBindComponent* subEntityNetBindComponent = subEntityHandle.GetNetBindComponent(); + + if (subEntityNetBindComponent != nullptr) + { + subEntityNetBindComponent->SetOwningConnectionId(connectionId); + if (connectionId == InvalidConnectionId) + { + subEntityNetBindComponent->SetAllowAutonomy(true); + } + } + } + }*/ + } + + Multiplayer::NetworkEntityHandle MultiplayerSampleSystemComponent::OnPlayerJoin( [[maybe_unused]] uint64_t userId, [[maybe_unused]] const Multiplayer::MultiplayerAgentDatum& agentDatum) { @@ -119,6 +154,7 @@ namespace MultiplayerSample for (Multiplayer::NetworkEntityHandle subEntity : entityList) { + EnableAutonomousControl(subEntity, AzNetworking::InvalidConnectionId); subEntity.Activate(); } diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.h b/Gem/Code/Source/MultiplayerSampleSystemComponent.h index 0b22cbe48..a540e2b92 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.h +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.h @@ -64,6 +64,9 @@ namespace MultiplayerSample AzNetworking::DisconnectReason reason) override; //////////////////////////////////////////////////////////////////////// + void EnableAutonomousControl(Multiplayer::NetworkEntityHandle entityHandle, AzNetworking::ConnectionId connectionId); + + AZStd::unique_ptr m_playerSpawner; }; } From 9c00072fad3611317acf791c853b60b32a8b27fa Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 28 Jul 2022 15:58:26 -0700 Subject: [PATCH 26/34] Adding entity preactivation callback to network spawners in order for multiplayer system to edit the network entities before it's activated (used to turn on autonomous role) Signed-off-by: Gene Walters --- .../MultiplayerSampleSystemComponent.cpp | 41 ++----------------- .../Source/MultiplayerSampleSystemComponent.h | 5 +-- 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index fcf674d1f..421f813ee 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -108,43 +108,7 @@ namespace MultiplayerSample return AZ::TICK_PLACEMENT + 2; } - void MultiplayerSampleSystemComponent::EnableAutonomousControl(Multiplayer::NetworkEntityHandle entityHandle, AzNetworking::ConnectionId connectionId) - { - if (!entityHandle.Exists()) - { - AZLOG_WARN("Attempting to enable autonomous control for an invalid entity"); - return; - } - - entityHandle.GetNetBindComponent()->SetOwningConnectionId(connectionId); - if (connectionId == InvalidConnectionId) - { - entityHandle.GetNetBindComponent()->SetAllowAutonomy(true); - } - - /*auto* hierarchyComponent = entityHandle.FindComponent(); - if (hierarchyComponent != nullptr) - { - for (AZ::Entity* subEntity : hierarchyComponent->GetHierarchicalEntities()) - { - NetworkEntityHandle subEntityHandle = NetworkEntityHandle(subEntity); - NetBindComponent* subEntityNetBindComponent = subEntityHandle.GetNetBindComponent(); - - if (subEntityNetBindComponent != nullptr) - { - subEntityNetBindComponent->SetOwningConnectionId(connectionId); - if (connectionId == InvalidConnectionId) - { - subEntityNetBindComponent->SetAllowAutonomy(true); - } - } - } - }*/ - } - - - Multiplayer::NetworkEntityHandle MultiplayerSampleSystemComponent::OnPlayerJoin( - [[maybe_unused]] uint64_t userId, [[maybe_unused]] const Multiplayer::MultiplayerAgentDatum& agentDatum) + Multiplayer::NetworkEntityHandle MultiplayerSampleSystemComponent::OnPlayerJoin([[maybe_unused]] uint64_t userId, [[maybe_unused]] const Multiplayer::MultiplayerAgentDatum& agentDatum, EntityPreActivationCallback preActivationCallback) { AZStd::pair entityParams = AZ::Interface::Get()->GetNextPlayerSpawn(); @@ -152,9 +116,10 @@ namespace MultiplayerSample AZ::Interface::Get()->GetNetworkEntityManager()->CreateEntitiesImmediate( entityParams.first, Multiplayer::NetEntityRole::Authority, entityParams.second, Multiplayer::AutoActivate::DoNotActivate); + preActivationCallback(entityList); + for (Multiplayer::NetworkEntityHandle subEntity : entityList) { - EnableAutonomousControl(subEntity, AzNetworking::InvalidConnectionId); subEntity.Activate(); } diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.h b/Gem/Code/Source/MultiplayerSampleSystemComponent.h index a540e2b92..5cedb0f06 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.h +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.h @@ -57,16 +57,13 @@ namespace MultiplayerSample //////////////////////////////////////////////////////////////////////// // IMultiplayerSpawner overrides - Multiplayer::NetworkEntityHandle OnPlayerJoin(uint64_t userId, const Multiplayer::MultiplayerAgentDatum& agentDatum) override; + Multiplayer::NetworkEntityHandle OnPlayerJoin(uint64_t userId, const Multiplayer::MultiplayerAgentDatum& agentDatum, EntityPreActivationCallback preActivationCallback) override; void OnPlayerLeave( Multiplayer::ConstNetworkEntityHandle entityHandle, const Multiplayer::ReplicationSet& replicationSet, AzNetworking::DisconnectReason reason) override; //////////////////////////////////////////////////////////////////////// - void EnableAutonomousControl(Multiplayer::NetworkEntityHandle entityHandle, AzNetworking::ConnectionId connectionId); - - AZStd::unique_ptr m_playerSpawner; }; } From b108a2a1bf7f797fbb82b113c3cd9b6187c837f6 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 3 Aug 2022 20:55:46 -0700 Subject: [PATCH 27/34] Update OnPlayerJoin to call the NetworkEntityMananger::CreateAutonomousPlayer helper method Signed-off-by: Gene Walters --- .../Source/MultiplayerSampleSystemComponent.cpp | 16 ++++------------ .../Source/MultiplayerSampleSystemComponent.h | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index 421f813ee..6c2171b4d 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -108,20 +108,12 @@ namespace MultiplayerSample return AZ::TICK_PLACEMENT + 2; } - Multiplayer::NetworkEntityHandle MultiplayerSampleSystemComponent::OnPlayerJoin([[maybe_unused]] uint64_t userId, [[maybe_unused]] const Multiplayer::MultiplayerAgentDatum& agentDatum, EntityPreActivationCallback preActivationCallback) + Multiplayer::NetworkEntityHandle MultiplayerSampleSystemComponent::OnPlayerJoin([[maybe_unused]] uint64_t userId, const Multiplayer::MultiplayerAgentDatum& agentDatum) { - AZStd::pair entityParams = AZ::Interface::Get()->GetNextPlayerSpawn(); + const AZStd::pair entityParams = AZ::Interface::Get()->GetNextPlayerSpawn(); - Multiplayer::INetworkEntityManager::EntityList entityList = - AZ::Interface::Get()->GetNetworkEntityManager()->CreateEntitiesImmediate( - entityParams.first, Multiplayer::NetEntityRole::Authority, entityParams.second, Multiplayer::AutoActivate::DoNotActivate); - - preActivationCallback(entityList); - - for (Multiplayer::NetworkEntityHandle subEntity : entityList) - { - subEntity.Activate(); - } + Multiplayer::INetworkEntityManager::EntityList entityList = Multiplayer::GetNetworkEntityManager()->CreateAutomonousPlayerImmediate( + entityParams.first, entityParams.second, agentDatum.m_id, Multiplayer::AutoActivate::Activate); Multiplayer::NetworkEntityHandle controlledEntity; if (!entityList.empty()) diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.h b/Gem/Code/Source/MultiplayerSampleSystemComponent.h index 5cedb0f06..0b22cbe48 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.h +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.h @@ -57,7 +57,7 @@ namespace MultiplayerSample //////////////////////////////////////////////////////////////////////// // IMultiplayerSpawner overrides - Multiplayer::NetworkEntityHandle OnPlayerJoin(uint64_t userId, const Multiplayer::MultiplayerAgentDatum& agentDatum, EntityPreActivationCallback preActivationCallback) override; + Multiplayer::NetworkEntityHandle OnPlayerJoin(uint64_t userId, const Multiplayer::MultiplayerAgentDatum& agentDatum) override; void OnPlayerLeave( Multiplayer::ConstNetworkEntityHandle entityHandle, const Multiplayer::ReplicationSet& replicationSet, From bb8d465f66de3d98f570351c2a72efd0238ad30b Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 4 Aug 2022 16:42:42 -0700 Subject: [PATCH 28/34] Minor clean up for OnPlayerJoin; updating to use new NetBindMethod for allowing autonomy Signed-off-by: Gene Walters --- Gem/Code/Source/Components/NetworkStressTestComponent.cpp | 2 +- Gem/Code/Source/MultiplayerSampleSystemComponent.cpp | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Gem/Code/Source/Components/NetworkStressTestComponent.cpp b/Gem/Code/Source/Components/NetworkStressTestComponent.cpp index 7d004c352..b71ca791e 100644 --- a/Gem/Code/Source/Components/NetworkStressTestComponent.cpp +++ b/Gem/Code/Source/Components/NetworkStressTestComponent.cpp @@ -176,7 +176,7 @@ namespace MultiplayerSample for (const Multiplayer::NetworkEntityHandle& entityItem : entityList) { - entityItem.GetNetBindComponent()->SetAllowAutonomy(true); + entityItem.GetNetBindComponent()->EnablePlayerHostAutonomy(true); } Multiplayer::NetworkEntityHandle createdEntity = entityList[0]; diff --git a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp index 3e9d548d5..ddcc33471 100644 --- a/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp +++ b/Gem/Code/Source/MultiplayerSampleSystemComponent.cpp @@ -115,12 +115,7 @@ namespace MultiplayerSample Multiplayer::INetworkEntityManager::EntityList entityList = AZ::Interface::Get()->GetNetworkEntityManager()->CreateEntitiesImmediate( - entityParams.first, Multiplayer::NetEntityRole::Authority, entityParams.second, Multiplayer::AutoActivate::DoNotActivate); - - for (Multiplayer::NetworkEntityHandle subEntity : entityList) - { - subEntity.Activate(); - } + entityParams.first, Multiplayer::NetEntityRole::Authority, entityParams.second); Multiplayer::NetworkEntityHandle controlledEntity; if (!entityList.empty()) From 1ea3c9bfc3c68e61acfde1855910ad76dd4a1724 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 6 Aug 2022 14:41:57 -0700 Subject: [PATCH 29/34] Adding sh script for opening client and server for linux users Signed-off-by: Gene Walters --- launch_client.cmd | 11 +++++++++++ launch_client.sh | 8 ++++++++ launch_server.cmd | 11 +++++++++++ launch_server.sh | 8 ++++++++ 4 files changed, 38 insertions(+) create mode 100644 launch_client.sh create mode 100644 launch_server.sh diff --git a/launch_client.cmd b/launch_client.cmd index db79cfba0..df8d30bc3 100644 --- a/launch_client.cmd +++ b/launch_client.cmd @@ -1 +1,12 @@ +@ECHO OFF +REM +REM Copyright (c) Contributors to the Open 3D Engine Project. +REM For complete copyright and license terms please see the LICENSE at the root of this distribution. +REM +REM SPDX-License-Identifier: Apache-2.0 OR MIT +REM +REM +REM Continuous Integration CLI entrypoint script to start CTest, triggering post-build tests +REM + .\build\windows\bin\profile\MultiplayerSample.GameLauncher.exe --console-command-file=launch_client.cfg \ No newline at end of file diff --git a/launch_client.sh b/launch_client.sh new file mode 100644 index 000000000..cf5e68bb3 --- /dev/null +++ b/launch_client.sh @@ -0,0 +1,8 @@ +# +# 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 +# + +./build/linux/bin/profile/MultiplayerSample.GameLauncher --console-command-file=launch_client.cfg diff --git a/launch_server.cmd b/launch_server.cmd index e4fdc27ee..94eca2711 100644 --- a/launch_server.cmd +++ b/launch_server.cmd @@ -1 +1,12 @@ +@ECHO OFF +REM +REM Copyright (c) Contributors to the Open 3D Engine Project. +REM For complete copyright and license terms please see the LICENSE at the root of this distribution. +REM +REM SPDX-License-Identifier: Apache-2.0 OR MIT +REM +REM +REM Continuous Integration CLI entrypoint script to start CTest, triggering post-build tests +REM + .\build\windows\bin\profile\MultiplayerSample.ServerLauncher.exe --console-command-file=launch_server.cfg \ No newline at end of file diff --git a/launch_server.sh b/launch_server.sh new file mode 100644 index 000000000..6e501a289 --- /dev/null +++ b/launch_server.sh @@ -0,0 +1,8 @@ +# +# 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 +# + +./build/linux/bin/profile/MultiplayerSample.ServerLauncher --console-command-file=launch_server.cfg From 5a5bcf12e179ee2c1a02c0c6d8d71ac001397f2b Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 8 Aug 2022 11:30:00 -0700 Subject: [PATCH 30/34] update VS debug settings to point to new cfg Signed-off-by: Gene Walters --- Gem/Code/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gem/Code/CMakeLists.txt b/Gem/Code/CMakeLists.txt index b187e9db9..779531e8a 100644 --- a/Gem/Code/CMakeLists.txt +++ b/Gem/Code/CMakeLists.txt @@ -80,5 +80,5 @@ if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) set_property(GLOBAL APPEND PROPERTY LY_LAUNCHER_SERVER_PROJECTS MultiplayerSample) endif() -set_property(TARGET MultiplayerSample APPEND PROPERTY GAMELAUNCHER_ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS "--console-command-file=\"client.cfg\"") -set_property(TARGET MultiplayerSample APPEND PROPERTY SERVERLAUNCHER_ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS "--console-command-file=\"server.cfg\"") +set_property(TARGET MultiplayerSample APPEND PROPERTY GAMELAUNCHER_ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS "--console-command-file=\"launch_client.cfg\"") +set_property(TARGET MultiplayerSample APPEND PROPERTY SERVERLAUNCHER_ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS "--console-command-file=\"launch_server.cfg\"") From cd95a74f7902c5b364784af1493529fd1dee39d3 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 8 Aug 2022 11:54:11 -0700 Subject: [PATCH 31/34] Updaing readme with the new launch_server/client cfg info Signed-off-by: Gene Walters --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b28608025..1c7a4c2e9 100644 --- a/README.md +++ b/README.md @@ -83,28 +83,28 @@ This option will output all the project and engine binaries in the engine's buil ### Step 4. Setup Client and Server -Under project root, there should be 2 files: client.cfg and server.cfg. File client.cfg should contain: +Under project root, there should be 2 files: launch_client.cfg and launch_server.cfg. File launch_client.cfg should contain: ```shell connect ``` -File server.cfg should contain: +File launch_server.cfg should contain: ```shell host LoadLevel Levels/SampleBase/SampleBase.spawnable ``` -If these cfg files are not present, create them as they will be used to when launching server and client launchers. - #### Running the Server A server can be run as follows ```shell -MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg +MultiplayerSample.ServerLauncher.exe --console-command-file=launch_server.cfg ``` +Notice the launch_server.cfg is passed into the commandline. Any file passed into the console-command-file argument will used when starting up the application. +For convenience you can run launch_server.cmd (Windows) or launch_server.sh (Unix) directly. #### (Optional) Running the Server Headless @@ -113,7 +113,7 @@ If you do not need to see rendered output on your servers, you can reduce resour Note: Parameters to use null renderer must be passed on the command line as the console-command-file is parsed after rendering is configured. ```shell -MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg -rhi=null -NullRenderer +MultiplayerSample.ServerLauncher.exe --console-command-file=launch_server.cfg -rhi=null -NullRenderer ``` #### Running the Server in the Editor @@ -127,11 +127,14 @@ Refer to the O3DE document [Test Multiplayer Games in the O3DE Editor](https://o A client can be run with: ```shell -MultiplayerSample.GameLauncher.exe --console-command-file=client.cfg +MultiplayerSample.GameLauncher.exe --console-command-file=launch_client.cfg ``` This will connect a client to the local server and start a multiplayer session. +For convenience you can run launch_client.cmd (Windows) or launch_client.sh (Unix) directly. +#### Debugging in Visual Studio +When debugging MultiplayerSample.GameLauncher and MultiplayerSample.ServerLauncher from Visual Studio it's helpful to automatically host and connect; thereby avoiding having to open the console (~) once the application opens and explicitly execute the 'host' and 'loadlevel' command on server, or the 'connect' command on client. For convience, Gem/Code/CMakeLists.txt defines ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS which allows Visual Studio to automatically populate the debugger with command arguments. By default, launch_client.cfg is used when debugging the GameLauncher and launch_server.cfg is used when debugging the ServerLauncher. ## More Information * [O3DE Networking](https://o3de.org/docs/user-guide/networking/) From 226480064b4503c42aa31b4c4451ef307e7a3001 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 8 Aug 2022 11:56:00 -0700 Subject: [PATCH 32/34] Minor grammar fix Signed-off-by: Gene Walters --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c7a4c2e9..d1dc41aa7 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ This will connect a client to the local server and start a multiplayer session. For convenience you can run launch_client.cmd (Windows) or launch_client.sh (Unix) directly. #### Debugging in Visual Studio -When debugging MultiplayerSample.GameLauncher and MultiplayerSample.ServerLauncher from Visual Studio it's helpful to automatically host and connect; thereby avoiding having to open the console (~) once the application opens and explicitly execute the 'host' and 'loadlevel' command on server, or the 'connect' command on client. For convience, Gem/Code/CMakeLists.txt defines ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS which allows Visual Studio to automatically populate the debugger with command arguments. By default, launch_client.cfg is used when debugging the GameLauncher and launch_server.cfg is used when debugging the ServerLauncher. +When debugging MultiplayerSample.GameLauncher and MultiplayerSample.ServerLauncher from Visual Studio it's helpful to automatically host and connect; thereby avoiding having to open the console (~) once the application opens and explicitly executing the 'host' and 'loadlevel' command on server, or the 'connect' command on client. For convience, Gem/Code/CMakeLists.txt defines ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS which allows Visual Studio to automatically populate the debugger with command arguments. By default, launch_client.cfg is used when debugging the GameLauncher and launch_server.cfg is used when debugging the ServerLauncher. ## More Information * [O3DE Networking](https://o3de.org/docs/user-guide/networking/) From e926fb2c0c4bc3f28443c1255e2e768850bdec66 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 8 Aug 2022 12:04:42 -0700 Subject: [PATCH 33/34] Readme grammar fix Signed-off-by: Gene Walters --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d1dc41aa7..3dbf6b21e 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ A server can be run as follows ```shell MultiplayerSample.ServerLauncher.exe --console-command-file=launch_server.cfg ``` -Notice the launch_server.cfg is passed into the commandline. Any file passed into the console-command-file argument will used when starting up the application. +Notice the launch_server.cfg is passed into the commandline. Any file passed into the console-command-file argument will be used when starting up the application. For convenience you can run launch_server.cmd (Windows) or launch_server.sh (Unix) directly. #### (Optional) Running the Server Headless From f72064d67829536e386aec3a4b8e586f85582957 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 8 Aug 2022 12:05:45 -0700 Subject: [PATCH 34/34] Spelling fix Signed-off-by: Gene Walters --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3dbf6b21e..9ae4737e6 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ This will connect a client to the local server and start a multiplayer session. For convenience you can run launch_client.cmd (Windows) or launch_client.sh (Unix) directly. #### Debugging in Visual Studio -When debugging MultiplayerSample.GameLauncher and MultiplayerSample.ServerLauncher from Visual Studio it's helpful to automatically host and connect; thereby avoiding having to open the console (~) once the application opens and explicitly executing the 'host' and 'loadlevel' command on server, or the 'connect' command on client. For convience, Gem/Code/CMakeLists.txt defines ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS which allows Visual Studio to automatically populate the debugger with command arguments. By default, launch_client.cfg is used when debugging the GameLauncher and launch_server.cfg is used when debugging the ServerLauncher. +When debugging MultiplayerSample.GameLauncher and MultiplayerSample.ServerLauncher from Visual Studio it's helpful to automatically host and connect; thereby avoiding having to open the console (~) once the application opens and explicitly executing the 'host' and 'loadlevel' command on server, or the 'connect' command on client. For convenience, Gem/Code/CMakeLists.txt defines ADDITIONAL_VS_DEBUGGER_COMMAND_ARGUMENTS which allows Visual Studio to automatically populate the debugger with command arguments. By default, launch_client.cfg is used when debugging the GameLauncher and launch_server.cfg is used when debugging the ServerLauncher. ## More Information * [O3DE Networking](https://o3de.org/docs/user-guide/networking/)