From 45061f095b410848feba10c9aab29a36006bee1a Mon Sep 17 00:00:00 2001 From: Joshua Huburn Date: Thu, 30 May 2019 16:31:24 +0100 Subject: [PATCH 1/3] Working prototype --- .gitignore | 3 +- BuildProject.bat | 1 + LaunchSpatial.bat | 13 +- spatial/deployment.json | 25 +++ spatial/runtime.json | 21 +++ spatial/spatialos.json | 21 ++- .../unreal/spatialos.UnrealClient.worker.json | 69 +++---- .../unreal/spatialos.UnrealWorker.worker.json | 174 ++++++++---------- 8 files changed, 167 insertions(+), 160 deletions(-) create mode 100644 spatial/deployment.json create mode 100644 spatial/runtime.json diff --git a/.gitignore b/.gitignore index f47058cb..6e67826b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,9 @@ logs build/ -# SpatialGDK symlinked files +# SpatialGDK project specific files Game/Plugins/UnrealGDK/ spatial/schema/unreal spatial/snapshots +spatial/.improbable Game/Content/Spatial/SchemaDatabase.uasset diff --git a/BuildProject.bat b/BuildProject.bat index 57b129aa..cf1c6326 100644 --- a/BuildProject.bat +++ b/BuildProject.bat @@ -1,5 +1,6 @@ @echo off call "%~dp0ProjectPaths.bat" +call %~dp0%PROJECT_PATH%\"Plugins/UnrealGDK/SpatialGDK/Build/Scripts/BuildWorker.bat" %GAME_NAME%Editor Win64 Development %GAME_NAME%.uproject || goto :error call %~dp0%PROJECT_PATH%\"Plugins/UnrealGDK/SpatialGDK/Build/Scripts/BuildWorker.bat" %GAME_NAME%Server Linux Development %GAME_NAME%.uproject || goto :error call %~dp0%PROJECT_PATH%\"Plugins/UnrealGDK/SpatialGDK/Build/Scripts/BuildWorker.bat" %GAME_NAME% Win64 Development %GAME_NAME%.uproject || goto :error echo All builds succeeded. diff --git a/LaunchSpatial.bat b/LaunchSpatial.bat index 436a4df6..77a35b40 100644 --- a/LaunchSpatial.bat +++ b/LaunchSpatial.bat @@ -1,13 +1,12 @@ @echo off -echo Starting a local Spatial deployment with the default launch configuration. Modify LaunchSpatial.bat if you want to use a different launch configuration. -pushd "%~dp0\spatial" +pushd %~dp0 -spatial worker build build-config +call %~dp0Game\Plugins\UnrealGDK\SpatialGDK\Build\Scripts\BuildProto.bat %~dp0spatial\schema %~dp0spatial\build\dependencies\schema\standard_library\ %~dp0spatial\build\descriptor\output\schema.descriptor -rem To launch a local Spatial deployment with a different launch configuration, change the default_launch.json argument to the name of your configuration file, -rem for example one_worker_test.json or two_worker_test.json. Similarly, you can specify a different snapshot than the default one by replacing the value of -rem the --snapshot argument with the path to the snapshot you want to launch with. -spatial local launch default_launch.json --snapshot=snapshots/default.snapshot +spatial alpha local launch --main_config=spatial\spatialos.json --launch_config=spatial\deployment.json --log_directory=spatial\logs popd + +pause + diff --git a/spatial/deployment.json b/spatial/deployment.json new file mode 100644 index 00000000..39d6f11c --- /dev/null +++ b/spatial/deployment.json @@ -0,0 +1,25 @@ +{ + "template": "small", + "dimensionsInWorldUnits": { + "x": 2000, + "z": 2000 + }, + "loadBalancing": { + "layerConfigurations": [ + { + "layer": "UnrealWorker", + "rectangleGrid": { + "cols": 1, + "rows": 1 + }, + "options": { + "manualWorkerConnectionOnly": true + } + } + ] + }, + "snapshot": { + "takeSnapshotIntervalSeconds": 0, + "startDeploymentFromSnapshotFile": "./snapshots/default.snapshot" + } +} diff --git a/spatial/runtime.json b/spatial/runtime.json new file mode 100644 index 00000000..ba4eeeb8 --- /dev/null +++ b/spatial/runtime.json @@ -0,0 +1,21 @@ +{ + "template": "small", + "runtimeFlags": [ + { + "name": "streaming_query_diff", + "value": "true" + }, + { + "name": "bridge_qos_max_timeout", + "value": "0" + }, + { + "name": "qos_max_unacked_pings_rate", + "value": "10" + }, + { + "name": "game_chunk_size", + "value": "5" + } + ] +} diff --git a/spatial/spatialos.json b/spatial/spatialos.json index 19a68440..1d5481ef 100644 --- a/spatial/spatialos.json +++ b/spatial/spatialos.json @@ -1,11 +1,12 @@ { - "name": "unreal_gdk_playtests", - "project_version": "0.0.1", - "sdk_version": "13.7.1", - "dependencies": [ - { - "name": "standard_library", - "version": "13.7.1" - } - ] -} + "configurationVersion": "0.1", + "projectName": "unreal_gdk_playtests", + "schemaDescriptor": "./build/descriptor/output/schema.descriptor", + "clientWorkers": [ + "./workers/unreal/spatialos.UnrealClient.worker.json" + ], + "serverWorkers": [ + "./workers/unreal/spatialos.UnrealWorker.worker.json" + ], + "launchConfiguration": "./default_launch.json" +} \ No newline at end of file diff --git a/spatial/workers/unreal/spatialos.UnrealClient.worker.json b/spatial/workers/unreal/spatialos.UnrealClient.worker.json index 236dfb8d..2af4e20b 100644 --- a/spatial/workers/unreal/spatialos.UnrealClient.worker.json +++ b/spatial/workers/unreal/spatialos.UnrealClient.worker.json @@ -1,49 +1,28 @@ { - "build": { - "tasks": [ - { - "name": "codegen", - "description": "required by spatial worker build build-config.", - "steps": [{"name": "No-op", "command": "echo", "arguments": ["No-op."]}] - }, - { - "name": "build", - "description": "required by spatial worker build build-config.", - "steps": [{"name": "No-op", "command": "echo", "arguments": ["No-op."]}] - }, - { - "name": "clean", - "description": "required by spatial worker build build-config.", - "steps": [{"name": "No-op", "command": "echo", "arguments": ["No-op."]}] - } - ] - }, - "bridge": { - "worker_attribute_set": { - "attributes": [ - "UnrealClient" - ] + "workerType": "UnrealClient", + "layer": "UnrealClient", + "entityInterest": { + "rangeEntityInterest": { + "radius": 50 + } }, - "entity_interest": { - "range_entity_interest": { - "radius": 50 - } + "componentDelivery": { + "default": "RELIABLE_ORDERED", + "checkoutAllInitially": true }, - "streaming_query": [ - { - "global_component_streaming_query": { - "component_name": "unreal.SingletonManager" - } - }, - { - "global_component_streaming_query": { - "component_name": "unreal.Singleton" + "permissions": { + "all": {} + }, + "streamingQuery": [ + { + "globalComponentStreamingQuery": { + "componentName": "unreal.SingletonManager" + } + }, + { + "globalComponentStreamingQuery": { + "componentName": "unreal.Singleton" + } } - } - ], - "component_delivery": { - "default": "RELIABLE_ORDERED", - "checkout_all_initially": true - } - } -} + ] +} \ No newline at end of file diff --git a/spatial/workers/unreal/spatialos.UnrealWorker.worker.json b/spatial/workers/unreal/spatialos.UnrealWorker.worker.json index f8896aa2..46c1379b 100644 --- a/spatial/workers/unreal/spatialos.UnrealWorker.worker.json +++ b/spatial/workers/unreal/spatialos.UnrealWorker.worker.json @@ -1,104 +1,84 @@ { - "build": { - "tasks": [ - { - "name": "codegen", - "description": "required by spatial worker build build-config.", - "steps": [{"name": "No-op", "command": "echo", "arguments": ["No-op."]}] - }, - { - "name": "build", - "description": "required by spatial worker build build-config.", - "steps": [{"name": "No-op", "command": "echo", "arguments": ["No-op."]}] - }, - { - "name": "clean", - "description": "required by spatial worker build build-config.", - "steps": [{"name": "No-op", "command": "echo", "arguments": ["No-op."]}] - } - ] - }, - "bridge": { - "worker_attribute_set": { - "attributes": [ - "UnrealWorker" - ] + "workerType": "UnrealWorker", + "layer": "UnrealWorker", + "entityInterest": { + "rangeEntityInterest": { + "radius": 50 + } }, - "entity_interest": { - "range_entity_interest": { - "radius": 50 - } + "componentDelivery": { + "default": "RELIABLE_ORDERED", + "checkoutAllInitially": true }, - "streaming_query": [ - { - "global_component_streaming_query": { - "component_name": "unreal.SingletonManager" - } - }, - { - "global_component_streaming_query": { - "component_name": "unreal.Singleton" + "permissions": { + "all": {} + }, + "streamingQuery": [ + { + "globalComponentStreamingQuery": { + "componentName": "unreal.SingletonManager" + } + }, + { + "globalComponentStreamingQuery": { + "componentName": "unreal.Singleton" + } } - } ], - "component_delivery": { - "default": "RELIABLE_ORDERED", - "checkout_all_initially": true - } - }, - "managed": { - "windows": { - "artifact_name": "UnrealEditor@Windows.zip", - "command": "StartEditor.bat", - "arguments": [ - "ThirdPersonExampleMap", - "-server", - "-stdout", - "-nowrite", - "-unattended", - "-nologtimes", - "-nopause", - "-messaging", - "-SaveToUserDir", - "+workerType", - "UnrealWorker", - "+appName", - "${IMPROBABLE_PROJECT_NAME}", - "+receptionistHost", - "${IMPROBABLE_RECEPTIONIST_HOST}", - "+receptionistPort", - "${IMPROBABLE_RECEPTIONIST_PORT}", - "+workerType", - "${IMPROBABLE_WORKER_NAME}", - "+workerId", - "${IMPROBABLE_WORKER_ID}", - "+linkProtocol", - "Tcp", - "-abslog=${IMPROBABLE_LOG_FILE}", - "-NoVerifyGC" - ] - }, - "linux": { - "artifact_name": "UnrealWorker@Linux.zip", - "command": "StartWorker.sh", - "arguments": [ - "${IMPROBABLE_WORKER_ID}", - "${IMPROBABLE_LOG_FILE}", - "ThirdPersonExampleMap", - "+appName", - "${IMPROBABLE_PROJECT_NAME}", - "+receptionistHost", - "${IMPROBABLE_RECEPTIONIST_HOST}", - "+receptionistPort", - "${IMPROBABLE_RECEPTIONIST_PORT}", - "+workerType", - "${IMPROBABLE_WORKER_NAME}", - "+workerId", - "${IMPROBABLE_WORKER_ID}", - "+linkProtocol", - "Tcp", - "-NoVerifyGC" - ] + "launchConfiguration": { + "localDeployment": { + "windows": { + "localBuildDirectory": "../spatial/build/unreal/WindowsEditor", + "command": "StartEditor.bat", + "arguments": [ + "-server", + "-stdout", + "-nowrite", + "-unattended", + "-nologtimes", + "-nopause", + "-messaging", + "-SaveToUserDir", + "+workerType", + "UnrealWorker", + "+appName", + "${IMPROBABLE_PROJECT_NAME}", + "+receptionistHost", + "${IMPROBABLE_RECEPTIONIST_HOST}", + "+receptionistPort", + "${IMPROBABLE_RECEPTIONIST_PORT}", + "+workerType", + "${IMPROBABLE_WORKER_NAME}", + "+workerId", + "${IMPROBABLE_WORKER_ID}", + "+linkProtocol", + "Tcp", + "-abslog=${IMPROBABLE_LOG_FILE}", + "-NoVerifyGC" + ] + } + }, + "cloudDeployment": { + "linux": { + "localBuildDirectory": "../spatial/build/unreal/LinuxServer", + "command": "StartWorker.sh", + "arguments": [ + "+appName", + "${IMPROBABLE_PROJECT_NAME}", + "+receptionistHost", + "${IMPROBABLE_RECEPTIONIST_HOST}", + "+receptionistPort", + "${IMPROBABLE_RECEPTIONIST_PORT}", + "+workerType", + "${IMPROBABLE_WORKER_NAME}", + "+workerId", + "${IMPROBABLE_WORKER_ID}", + "+linkProtocol", + "RakNet", + "-abslog=${IMPROBABLE_LOG_FILE}", + "-NoVerifyGC" + ] + } + } } - } } From 2d644cd9754d490350cb19d30dee180d1ca97bec Mon Sep 17 00:00:00 2001 From: Joshua Huburn Date: Thu, 30 May 2019 19:34:36 +0100 Subject: [PATCH 2/3] Updated worker configs --- .../DefaultSpatialGDKEditorSettings.ini | 2 +- spatial/runtime.json | 21 ------------------- .../unreal/spatialos.UnrealWorker.worker.json | 4 ++-- 3 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 spatial/runtime.json diff --git a/Game/Config/DefaultSpatialGDKEditorSettings.ini b/Game/Config/DefaultSpatialGDKEditorSettings.ini index 020d6761..d608adb2 100644 --- a/Game/Config/DefaultSpatialGDKEditorSettings.ini +++ b/Game/Config/DefaultSpatialGDKEditorSettings.ini @@ -4,6 +4,6 @@ bDeleteDynamicEntities=True bGenerateDefaultLaunchConfig=True bStopSpatialOnExit=False SpatialOSSnapshotFile=default.snapshot -LaunchConfigDesc=(Template="small",World=(Dimensions=(X=2000,Y=2000),ChunkEdgeLengthMeters=5,StreamingQueryIntervalSeconds=4,SnapshotWritePeriodSeconds=0,LegacyFlags=(("bridge_qos_max_timeout", "0"),("bridge_soft_handover_enabled", "false"),("enable_chunk_interest", "false")),LegacyJavaParams=()),Workers=((WorkerTypeName="UnrealWorker",Columns=2))) +LaunchConfigDesc=(Template="small",World=(Dimensions=(X=2000,Y=2000),ChunkEdgeLengthMeters=5,StreamingQueryIntervalSeconds=4,SnapshotWritePeriodSeconds=0,LegacyFlags=(("bridge_qos_max_timeout", "0"),("bridge_soft_handover_enabled", "false"),("enable_chunk_interest", "false")),LegacyJavaParams=()),Workers=((WorkerTypeName="UnrealWorker"))) bGeneratePlaceholderEntitiesInSnapshot=True diff --git a/spatial/runtime.json b/spatial/runtime.json deleted file mode 100644 index ba4eeeb8..00000000 --- a/spatial/runtime.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "template": "small", - "runtimeFlags": [ - { - "name": "streaming_query_diff", - "value": "true" - }, - { - "name": "bridge_qos_max_timeout", - "value": "0" - }, - { - "name": "qos_max_unacked_pings_rate", - "value": "10" - }, - { - "name": "game_chunk_size", - "value": "5" - } - ] -} diff --git a/spatial/workers/unreal/spatialos.UnrealWorker.worker.json b/spatial/workers/unreal/spatialos.UnrealWorker.worker.json index 46c1379b..33677931 100644 --- a/spatial/workers/unreal/spatialos.UnrealWorker.worker.json +++ b/spatial/workers/unreal/spatialos.UnrealWorker.worker.json @@ -28,7 +28,7 @@ "launchConfiguration": { "localDeployment": { "windows": { - "localBuildDirectory": "../spatial/build/unreal/WindowsEditor", + "localBuildDirectory": "../../build/unreal/WindowsEditor", "command": "StartEditor.bat", "arguments": [ "-server", @@ -60,7 +60,7 @@ }, "cloudDeployment": { "linux": { - "localBuildDirectory": "../spatial/build/unreal/LinuxServer", + "localBuildDirectory": "../../build/unreal/LinuxServer", "command": "StartWorker.sh", "arguments": [ "+appName", From 0e1a49866ef5c5adb36b4633850720067af01ca2 Mon Sep 17 00:00:00 2001 From: Joshua Huburn Date: Fri, 31 May 2019 10:20:33 +0100 Subject: [PATCH 3/3] Updated launch configs --- spatial/default_launch.json | 116 ++++++++++++++++------------------- spatial/deployment.json | 25 -------- spatial/one_worker_test.json | 110 +++++++++++++++------------------ 3 files changed, 101 insertions(+), 150 deletions(-) delete mode 100644 spatial/deployment.json diff --git a/spatial/default_launch.json b/spatial/default_launch.json index 159c9ee6..9c98e3b4 100644 --- a/spatial/default_launch.json +++ b/spatial/default_launch.json @@ -1,65 +1,53 @@ { - "template": "small", - "world": { - "dimensions": { - "x_meters": 2000, - "z_meters": 2000 - }, - "chunk_edge_length_meters": 50, - "streaming_query_interval": 4, - "legacy_flags": [ - { - "name": "streaming_query_diff", - "value": "true" - }, - { - "name": "bridge_qos_max_timeout", - "value": "0" - }, - { - "name": "bridge_soft_handover_enabled", - "value": "false" - }, - { - "name": "qos_max_unacked_pings_rate", - "value": "10" - } - ], - "snapshots": { - "snapshot_write_period_seconds": 0 - } - }, - "load_balancing": { - "layer_configurations": [ - { - "layer": "UnrealWorker", - "rectangle_grid": { - "cols": 1, - "rows": 1 - }, - "options": { - "manual_worker_connection_only": true - } - } - ] - }, - "workers": [ - { - "worker_type": "UnrealWorker", - "flags" : [], - "permissions": [ - { - "all": {} - } - ] - }, - { - "worker_type": "UnrealClient", - "permissions": [ - { - "all": {} - } - ] - } - ] -} + "template": "small", + "dimensionsInWorldUnits": { + "x": "2000", + "z": "2000" + }, + "loadBalancing": { + "layerConfigurations": [ + { + "layer": "UnrealWorker", + "rectangleGrid": { + "cols": 1, + "rows": 1 + }, + "options": { + "manualWorkerConnectionOnly": true + } + } + ] + }, + "snapshot": { + + }, + "streamingQueryInterval": "4", + "runtimeFlags": [ + { + "name": "streaming_query_diff", + "value": "true" + }, + { + "name": "bridge_qos_max_timeout", + "value": "0" + }, + { + "name": "bridge_soft_handover_enabled", + "value": "false" + }, + { + "name": "qos_max_unacked_pings_rate", + "value": "10" + } + ], + "workerFlags": [ + { + "workerType": "UnrealWorker", + "flags": [ + ] + }, + { + "workerType": "UnrealClient" + } + ] +} \ No newline at end of file diff --git a/spatial/deployment.json b/spatial/deployment.json deleted file mode 100644 index 39d6f11c..00000000 --- a/spatial/deployment.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "template": "small", - "dimensionsInWorldUnits": { - "x": 2000, - "z": 2000 - }, - "loadBalancing": { - "layerConfigurations": [ - { - "layer": "UnrealWorker", - "rectangleGrid": { - "cols": 1, - "rows": 1 - }, - "options": { - "manualWorkerConnectionOnly": true - } - } - ] - }, - "snapshot": { - "takeSnapshotIntervalSeconds": 0, - "startDeploymentFromSnapshotFile": "./snapshots/default.snapshot" - } -} diff --git a/spatial/one_worker_test.json b/spatial/one_worker_test.json index d80ebb09..ada5cefc 100644 --- a/spatial/one_worker_test.json +++ b/spatial/one_worker_test.json @@ -1,62 +1,50 @@ { - "template": "small", - "world": { - "dimensions": { - "x_meters": 2000, - "z_meters": 2000 - }, - "chunk_edge_length_meters": 50, - "streaming_query_interval": 4, - "legacy_flags": [ - { - "name": "streaming_query_diff", - "value": "true" - }, - { - "name": "bridge_qos_max_timeout", - "value": "0" - }, - { - "name": "bridge_soft_handover_enabled", - "value": "false" - }, - { - "name": "worker_start_connection_timeout_ms", - "value": "60000" - } - ], - "snapshots": { - "snapshot_write_period_seconds": 0 - } - }, - "workers": [ - { - "worker_type": "UnrealWorker", - "flags" : [], - "load_balancing": { - "points_of_interest": { - "num_workers": 1, - "points" : [ - { - "x": 0, - "z": 0 - } - ] - } - }, - "permissions": [ - { - "all": {} - } - ] - }, - { - "worker_type": "UnrealClient", - "permissions": [ - { - "all": {} - } - ] - } - ] -} + "template": "small", + "dimensionsInWorldUnits": { + "x": "2000", + "z": "2000" + }, + "loadBalancing": { + "layerConfigurations": [ + { + "layer": "UnrealWorker", + "rectangleGrid": { + "cols": 1, + "rows": 1 + } + } + ] + }, + "snapshot": { + + }, + "streamingQueryInterval": "4", + "runtimeFlags": [ + { + "name": "streaming_query_diff", + "value": "true" + }, + { + "name": "bridge_qos_max_timeout", + "value": "0" + }, + { + "name": "bridge_soft_handover_enabled", + "value": "false" + }, + { + "name": "worker_start_connection_timeout_ms", + "value": "60000" + } + ], + "workerFlags": [ + { + "workerType": "UnrealWorker", + "flags": [ + ] + }, + { + "workerType": "UnrealClient" + } + ] +} \ No newline at end of file