diff --git a/.buildkite/nightly.steps.yaml b/.buildkite/nightly.steps.yaml index 6700940f..421dc86a 100644 --- a/.buildkite/nightly.steps.yaml +++ b/.buildkite/nightly.steps.yaml @@ -1,16 +1,36 @@ +--- +# This is designed to trap and retry failures because agent lost +# connection. Agent exits with -1 in this case. +agent_transients: &agent_transients + exit_status: -1 + limit: 3 +# BK system error +bk_system_error: &bk_system_error + exit_status: 255 + limit: 3 +# job was interrupted by a signal (e.g. ctrl+c etc) +bk_interrupted_by_signal: &bk_interrupted_by_signal + exit_status: 15 + limit: 3 + script_runner: &script_runner agents: - - "agent_count=8" - - "capable_of_building=platform" - - "environment=production" - - "machine_type=quarter" - - "permission_set=builder" - - "platform=linux" - - "queue=${CI_LINUX_BUILDER_QUEUE:-v3-1572524284-e64831bf1e88b227-------z}" - - "scaler_version=2" - - "working_hours_time_zone=london" + - "agent_count=8" + - "capable_of_building=platform" + - "environment=production" + - "machine_type=quarter" + - "permission_set=builder" + - "platform=linux" + - "queue=${CI_LINUX_BUILDER_QUEUE:-v4-2019-12-12-bk5225-daecba805768d787}" + - "scaler_version=2" + - "working_hours_time_zone=london" + retry: + automatic: + - <<: *agent_transients + - <<: *bk_system_error + - <<: *bk_interrupted_by_signal -common: &common +windows: &windows agents: - "agent_count=1" - "capable_of_building=gdk-for-unreal" @@ -19,13 +39,13 @@ common: &common - "permission_set=builder" - "platform=windows" - "scaler_version=2" - - "queue=${CI_WINDOWS_BUILDER_QUEUE:-v4-2019-11-07-bk3700-fbffad576b9676d7}" # Has FASTbuild disabled - timeout_in_minutes: 60 # TODO(ENG-548): reduce timeout once agent-cold-start is optimised. + - "queue=${CI_WINDOWS_BUILDER_QUEUE:-v4-20-03-26-102432-bk9951-8afe0ffb}" + timeout_in_minutes: 60 retry: automatic: - # This is designed to trap and retry failures because agent lost connection. Agent exits with -1 in this case. - - exit_status: -1 - limit: 3 + - <<: *agent_transients + - <<: *bk_system_error + - <<: *bk_interrupted_by_signal plugins: - ca-johnson/taskkill#v4.1: ~ @@ -46,4 +66,4 @@ steps: - label: "slack-notify" if: build.env("SLACK_NOTIFY") == "true" || build.branch == "master" command: "powershell -NoProfile -NonInteractive -InputFormat Text -Command ./ci/slack-notify.ps1" - <<: *common # This folds the YAML named anchor into this step. Overrides, if any, should follow, not precede. + <<: *windows diff --git a/BuildProject.bat b/BuildProject.bat index 9a536dcd..064a4861 100644 --- a/BuildProject.bat +++ b/BuildProject.bat @@ -28,7 +28,6 @@ set GDK_DIRECTORY=%UNREAL_ENGINE%\Engine\Plugins\UnrealGDK echo Building worker with GDK located at %GDK_DIRECTORY% call %GDK_DIRECTORY%\SpatialGDK\Build\Scripts\BuildWorker.bat %GAME_NAME%Server Linux Development "%~dp0\%PROJECT_PATH%\%GAME_NAME%.uproject" || goto :error -call %GDK_DIRECTORY%\SpatialGDK\Build\Scripts\BuildWorker.bat %GAME_NAME%SimulatedPlayer Linux Development "%~dp0\%PROJECT_PATH%\%GAME_NAME%.uproject" || goto :error call %GDK_DIRECTORY%\SpatialGDK\Build\Scripts\BuildWorker.bat %GAME_NAME% Win64 Development "%~dp0\%PROJECT_PATH%\%GAME_NAME%.uproject" || goto :error echo All builds succeeded. diff --git a/Game/Config/DefaultEngine.ini b/Game/Config/DefaultEngine.ini index bd2e3e2a..604ed462 100644 --- a/Game/Config/DefaultEngine.ini +++ b/Game/Config/DefaultEngine.ini @@ -7,7 +7,7 @@ GlobalDefaultServerGameMode=None ServerDefaultMap=/Game/Maps/FPS-Start_Medium.FPS-Start_Medium [/Script/IOSRuntimeSettings.IOSRuntimeSettings] -MinimumiOSVersion=IOS_8 +MinimumiOSVersion=IOS_11 [/Script/HardwareTargeting.HardwareTargetingSettings] TargetedHardwareClass=Desktop @@ -21,6 +21,7 @@ r.SceneColorFormat=2 r.TemporalAACurrentFrameWeight=0.25 r.AllowStaticLighting=False r.LightPropagationVolume = 1 +r.MobileHDR=False [/Script/Engine.LocalPlayer] AspectRatioAxisConstraint=AspectRatio_MaintainYFOV @@ -32,6 +33,7 @@ AspectRatioAxisConstraint=AspectRatio_MaintainYFOV +ActiveGameNameRedirects=(OldGameName="ThirdPersonShooter",NewGameName="/Script/GDKShooter") +ActiveGameNameRedirects=(OldGameName="/Script/ThirdPersonShooter",NewGameName="/Script/GDKShooter") MaximumLoopIterationCount=1000000 +WorldSettingsClassName=/Script/SpatialGDK.SpatialWorldSettings [CoreRedirects] +PackageRedirects=(OldName="/Script/SpatialOS",NewName="/Script/SpatialGDK") @@ -47,9 +49,6 @@ LogSpatialOSActorChannel=Log TargetedHardwareClass=Desktop DefaultGraphicsPerformance=Maximum -[/Script/SpatialGDK.SpatialGameInstance] -bPreventAutoConnectWithLocator=False - [/Script/NavigationSystem.NavigationSystemV1] bAllowClientSideNavigation=True @@ -86,6 +85,8 @@ bDisableKinematicStaticPairs=False bDisableKinematicKinematicPairs=False bDisableCCD=False bEnableEnhancedDeterminism=False +AnimPhysicsMinDeltaTime=0.000000 +bSimulateAnimPhysicsAfterReset=False MaxPhysicsDeltaTime=0.033333 bSubstepping=False bSubsteppingAsync=False @@ -94,5 +95,17 @@ MaxSubsteps=6 SyncSceneSmoothingFactor=0.000000 InitialAverageFrameRate=0.016667 PhysXTreeRebuildRate=10 -DefaultBroadphaseSettings=(bUseMBPOnClient=False,bUseMBPOnServer=False,MBPBounds=(Min=(X=0.000000,Y=0.000000,Z=0.000000),Max=(X=0.000000,Y=0.000000,Z=0.000000),IsValid=0),MBPNumSubdivs=2) +DefaultBroadphaseSettings=(bUseMBPOnClient=False,bUseMBPOnServer=False,bUseMBPOuterBounds=False,MBPBounds=(Min=(X=0.000000,Y=0.000000,Z=0.000000),Max=(X=0.000000,Y=0.000000,Z=0.000000),IsValid=0),MBPOuterBounds=(Min=(X=0.000000,Y=0.000000,Z=0.000000),Max=(X=0.000000,Y=0.000000,Z=0.000000),IsValid=0),MBPNumSubdivs=2) +ChaosSettings=(DefaultThreadingModel=DedicatedThread,DedicatedThreadTickMode=VariableCappedWithTarget,DedicatedThreadBufferMode=Double) +[DerivedDataBackendGraph] +MinimumDaysToKeepFile=7 +Root=(Type=KeyLength, Length=120, Inner=AsyncPut) +AsyncPut=(Type=AsyncPut, Inner=Hierarchy) +Hierarchy=(Type=Hierarchical, Inner=Boot, Inner=Pak, Inner=EnginePak, Inner=Local, Inner=Shared) +Boot=(Type=Boot, Filename=%GAMEDIR%DerivedDataCache/Boot.ddc, MaxCacheSize=256) +Local=(Type=FileSystem, ReadOnly=false, Clean=false, Flush=false, PurgeTransient=true, DeleteUnused=true, UnusedFileAge=17, FoldersToClean=-1, Path=../../../Engine/DerivedDataCache) +Shared=(Type=FileSystem, ReadOnly=false, Clean=false, Flush=false, DeleteUnused=true, UnusedFileAge=19, FoldersToClean=-1, Path=\\mystudio.net\DDC, EnvPathOverride=UE-SharedDataCachePath) +AltShared=(Type=FileSystem, ReadOnly=true, Clean=false, Flush=false, DeleteUnused=true, UnusedFileAge=19, FoldersToClean=-1, Path=\\mystudio.net\DDC2, EnvPathOverride=UE-SharedDataCachePath2) +Pak=(Type=ReadPak, Filename=%GAMEDIR%DerivedDataCache/DDC.ddp) +EnginePak=(Type=ReadPak, Filename=../../../Engine/DerivedDataCache/DDC.ddp) diff --git a/Game/Config/DefaultSpatialGDKSettings.ini b/Game/Config/DefaultSpatialGDKSettings.ini index 3df8e344..a1faa487 100644 --- a/Game/Config/DefaultSpatialGDKSettings.ini +++ b/Game/Config/DefaultSpatialGDKSettings.ini @@ -8,7 +8,7 @@ ActorReplicationRateLimit=0 EntityCreationRateLimit=0 OpsUpdateRate=1000.000000 bEnableHandover=True -MaxNetCullDistanceSquared=900000000.000000 +MaxNetCullDistanceSquared=0.000000 QueuedIncomingRPCWaitTime=1.000000 PositionUpdateFrequency=1.000000 PositionDistanceThreshold=100.000000 @@ -16,11 +16,8 @@ bEnableMetrics=True bEnableMetricsDisplay=False MetricsReportRate=2.000000 bUseFrameTimeAsLoad=False -bCheckRPCOrder=False -bBatchSpatialPositionUpdates=True +bBatchSpatialPositionUpdates=False MaxDynamicallyAttachedSubobjectsPerClass=3 -bEnableServerQBI=True -bPackRPCs=True DefaultReceptionistHost=127.0.0.1 bUseDevelopmentAuthenticationFlow=False DevelopmentAuthenticationToken= @@ -30,3 +27,21 @@ bEnableOffloading=False ActorGroups=() ServerWorkerTypes=("UnrealWorker") ServicesRegion=Default +UseIsActorRelevantForConnection=False +WorkerLogLevel=Warning +SpatialDebuggerClassPath=/SpatialGDK/SpatialDebugger/BP_SpatialDebugger.BP_SpatialDebugger_C +bEnableUnrealLoadBalancer=False +LoadBalancingWorkerType=(WorkerTypeName="UnrealWorker") +LoadBalanceStrategy=None +LockingPolicy=None +bUseRPCRingBuffers=True +DefaultRPCRingBufferSize=32 +RPCRingBufferSizeMap=() +MaxRPCRingBufferSize=32 +bTcpNoDelay=False +UdpServerUpstreamUpdateIntervalMS=1 +UdpServerDownstreamUpdateIntervalMS=1 +UdpClientUpstreamUpdateIntervalMS=1 +UdpClientDownstreamUpdateIntervalMS=1 +SpatialDebugger=BlueprintGeneratedClass'/Game/Blueprints/LoadBalancing/BP_VerboseSpatialDebugger.BP_VerboseSpatialDebugger_C' + diff --git a/Game/Content/Base/MasterMaterials/M_Spatial_Asset_MASTER.uasset b/Game/Content/Base/MasterMaterials/M_Spatial_Asset_MASTER.uasset index 8e4222a9..2dffff25 100644 Binary files a/Game/Content/Base/MasterMaterials/M_Spatial_Asset_MASTER.uasset and b/Game/Content/Base/MasterMaterials/M_Spatial_Asset_MASTER.uasset differ diff --git a/Game/Content/Blueprints/LoadBalancing/BP_QuadrantLBStrategy.uasset b/Game/Content/Blueprints/LoadBalancing/BP_QuadrantLBStrategy.uasset new file mode 100644 index 00000000..dbce381e Binary files /dev/null and b/Game/Content/Blueprints/LoadBalancing/BP_QuadrantLBStrategy.uasset differ diff --git a/Game/Content/Blueprints/LoadBalancing/BP_VerboseSpatialDebugger.uasset b/Game/Content/Blueprints/LoadBalancing/BP_VerboseSpatialDebugger.uasset new file mode 100644 index 00000000..4aa936ac Binary files /dev/null and b/Game/Content/Blueprints/LoadBalancing/BP_VerboseSpatialDebugger.uasset differ diff --git a/Game/Content/Blueprints/MapBuilder/BP_MapBuilder.uasset b/Game/Content/Blueprints/MapBuilder/BP_MapBuilder.uasset index 48d33f4c..db287346 100644 Binary files a/Game/Content/Blueprints/MapBuilder/BP_MapBuilder.uasset and b/Game/Content/Blueprints/MapBuilder/BP_MapBuilder.uasset differ diff --git a/Game/Content/Characters/BP_Base_Character.uasset b/Game/Content/Characters/BP_Base_Character.uasset index d717bd29..8b5e5586 100644 Binary files a/Game/Content/Characters/BP_Base_Character.uasset and b/Game/Content/Characters/BP_Base_Character.uasset differ diff --git a/Game/Content/Characters/BP_FPS_Character.uasset b/Game/Content/Characters/BP_FPS_Character.uasset index 40063f90..aec4f8c6 100644 Binary files a/Game/Content/Characters/BP_FPS_Character.uasset and b/Game/Content/Characters/BP_FPS_Character.uasset differ diff --git a/Game/Content/Controllers/BP_GDK_PlayerController.uasset b/Game/Content/Controllers/BP_GDK_PlayerController.uasset index e03472ab..b8e81d6a 100644 Binary files a/Game/Content/Controllers/BP_GDK_PlayerController.uasset and b/Game/Content/Controllers/BP_GDK_PlayerController.uasset differ diff --git a/Game/Content/GameMode/BP_DeathmatchGameMode.uasset b/Game/Content/GameMode/BP_DeathmatchGameMode.uasset index e711ea1f..82a55389 100644 Binary files a/Game/Content/GameMode/BP_DeathmatchGameMode.uasset and b/Game/Content/GameMode/BP_DeathmatchGameMode.uasset differ diff --git a/Game/Content/Maps/FPS-Start_Large.umap b/Game/Content/Maps/FPS-Start_Large.umap index 80d4d521..b4b5a020 100644 Binary files a/Game/Content/Maps/FPS-Start_Large.umap and b/Game/Content/Maps/FPS-Start_Large.umap differ diff --git a/Game/Content/Maps/FPS-Start_Large_BuiltData.uasset b/Game/Content/Maps/FPS-Start_Large_BuiltData.uasset index a7914f99..fc1eaa9c 100644 Binary files a/Game/Content/Maps/FPS-Start_Large_BuiltData.uasset and b/Game/Content/Maps/FPS-Start_Large_BuiltData.uasset differ diff --git a/Game/Content/Maps/FPS-Start_Large_Limited_Spawns.umap b/Game/Content/Maps/FPS-Start_Large_Limited_Spawns.umap index 1f575918..5c3a312e 100644 Binary files a/Game/Content/Maps/FPS-Start_Large_Limited_Spawns.umap and b/Game/Content/Maps/FPS-Start_Large_Limited_Spawns.umap differ diff --git a/Game/Content/Maps/FPS-Start_Large_Limited_Spawns_BuiltData.uasset b/Game/Content/Maps/FPS-Start_Large_Limited_Spawns_BuiltData.uasset index 3e412d9b..540a4009 100644 Binary files a/Game/Content/Maps/FPS-Start_Large_Limited_Spawns_BuiltData.uasset and b/Game/Content/Maps/FPS-Start_Large_Limited_Spawns_BuiltData.uasset differ diff --git a/Game/Content/Maps/FPS-Start_Medium.umap b/Game/Content/Maps/FPS-Start_Medium.umap index 4332f32b..5437a3e7 100644 Binary files a/Game/Content/Maps/FPS-Start_Medium.umap and b/Game/Content/Maps/FPS-Start_Medium.umap differ diff --git a/Game/Content/Maps/FPS-Start_Medium_BuiltData.uasset b/Game/Content/Maps/FPS-Start_Medium_BuiltData.uasset index af33bd09..85b6dd00 100644 Binary files a/Game/Content/Maps/FPS-Start_Medium_BuiltData.uasset and b/Game/Content/Maps/FPS-Start_Medium_BuiltData.uasset differ diff --git a/Game/Content/Maps/FPS-Start_Small.umap b/Game/Content/Maps/FPS-Start_Small.umap index 2e6689f1..2c03545a 100644 Binary files a/Game/Content/Maps/FPS-Start_Small.umap and b/Game/Content/Maps/FPS-Start_Small.umap differ diff --git a/Game/Content/Maps/FPS-Start_SmallTown.umap b/Game/Content/Maps/FPS-Start_SmallTown.umap index 9507e912..45108455 100644 Binary files a/Game/Content/Maps/FPS-Start_SmallTown.umap and b/Game/Content/Maps/FPS-Start_SmallTown.umap differ diff --git a/Game/Content/Maps/FPS-Start_SmallTown_BuiltData.uasset b/Game/Content/Maps/FPS-Start_SmallTown_BuiltData.uasset index b03cb2f8..a533ceb0 100644 Binary files a/Game/Content/Maps/FPS-Start_SmallTown_BuiltData.uasset and b/Game/Content/Maps/FPS-Start_SmallTown_BuiltData.uasset differ diff --git a/Game/Content/Maps/FPS-Start_Small_BuiltData.uasset b/Game/Content/Maps/FPS-Start_Small_BuiltData.uasset index d478feb4..b7a596f3 100644 Binary files a/Game/Content/Maps/FPS-Start_Small_BuiltData.uasset and b/Game/Content/Maps/FPS-Start_Small_BuiltData.uasset differ diff --git a/Game/Content/Maps/FPS-Start_Tiny.umap b/Game/Content/Maps/FPS-Start_Tiny.umap index daf48fcc..f4432e6d 100644 Binary files a/Game/Content/Maps/FPS-Start_Tiny.umap and b/Game/Content/Maps/FPS-Start_Tiny.umap differ diff --git a/Game/Content/Maps/FPS-Start_Tiny_BuiltData.uasset b/Game/Content/Maps/FPS-Start_Tiny_BuiltData.uasset index 89111fff..93a6a31c 100644 Binary files a/Game/Content/Maps/FPS-Start_Tiny_BuiltData.uasset and b/Game/Content/Maps/FPS-Start_Tiny_BuiltData.uasset differ diff --git a/Game/Content/UI/Blueprints/BP_QuitButton.uasset b/Game/Content/UI/Blueprints/BP_QuitButton.uasset index acf6c2bc..e2f58d29 100644 Binary files a/Game/Content/UI/Blueprints/BP_QuitButton.uasset and b/Game/Content/UI/Blueprints/BP_QuitButton.uasset differ diff --git a/Game/GDKShooter.uproject b/Game/GDKShooter.uproject index 91b31d64..19bf1c67 100644 --- a/Game/GDKShooter.uproject +++ b/Game/GDKShooter.uproject @@ -27,4 +27,4 @@ "Enabled": true } ] -} \ No newline at end of file +} diff --git a/Game/Source/GDKShooter/GDKShooter.Build.cs b/Game/Source/GDKShooter/GDKShooter.Build.cs index 92d76fa7..ad3d976a 100644 --- a/Game/Source/GDKShooter/GDKShooter.Build.cs +++ b/Game/Source/GDKShooter/GDKShooter.Build.cs @@ -8,6 +8,8 @@ public GDKShooter(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + bLegacyPublicIncludePaths = false; + PublicDependencyModuleNames.AddRange( new string[] { diff --git a/Game/Source/GDKShooter/Private/Characters/Components/EquippedComponent.cpp b/Game/Source/GDKShooter/Private/Characters/Components/EquippedComponent.cpp index 602b5db5..38d9a7cc 100644 --- a/Game/Source/GDKShooter/Private/Characters/Components/EquippedComponent.cpp +++ b/Game/Source/GDKShooter/Private/Characters/Components/EquippedComponent.cpp @@ -1,7 +1,7 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "EquippedComponent.h" -#include "UnrealNetwork.h" +#include "Characters/Components/EquippedComponent.h" +#include "Net/UnrealNetwork.h" #include "GDKLogging.h" #include "Engine/World.h" #include "Weapons/Holdable.h" @@ -10,7 +10,7 @@ UEquippedComponent::UEquippedComponent() { PrimaryComponentTick.bCanEverTick = false; - bReplicates = true; + SetIsReplicatedByDefault(true); } diff --git a/Game/Source/GDKShooter/Private/Characters/Components/FirstPersonTraceProvider.cpp b/Game/Source/GDKShooter/Private/Characters/Components/FirstPersonTraceProvider.cpp index 74cd4403..d43a410d 100644 --- a/Game/Source/GDKShooter/Private/Characters/Components/FirstPersonTraceProvider.cpp +++ b/Game/Source/GDKShooter/Private/Characters/Components/FirstPersonTraceProvider.cpp @@ -1,6 +1,6 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "FirstPersonTraceProvider.h" +#include "Characters/Components/FirstPersonTraceProvider.h" #include "GDKLogging.h" UFirstPersonTraceProvider::UFirstPersonTraceProvider() diff --git a/Game/Source/GDKShooter/Private/Characters/Components/GDKMovementComponent.cpp b/Game/Source/GDKShooter/Private/Characters/Components/GDKMovementComponent.cpp index 865f583a..d7fc779e 100644 --- a/Game/Source/GDKShooter/Private/Characters/Components/GDKMovementComponent.cpp +++ b/Game/Source/GDKShooter/Private/Characters/Components/GDKMovementComponent.cpp @@ -1,10 +1,10 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "Components/GDKMovementComponent.h" +#include "Characters/Components/GDKMovementComponent.h" #include "GameFramework/Character.h" #include "GameFramework/Controller.h" -#include "UnrealNetwork.h" +#include "Net/UnrealNetwork.h" #include "GDKLogging.h" // Use the first custom movement flag slot in the character for sprinting. @@ -27,9 +27,9 @@ UGDKMovementComponent::UGDKMovementComponent(const FObjectInitializer& ObjectIni MaxWalkSpeed = 250; MaxWalkSpeedCrouched = 125; MaxAcceleration = 1000; - bReplicates = true; JumpZVelocity = 600.f; AirControl = 0.2f; + SetIsReplicatedByDefault(true); } void UGDKMovementComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) diff --git a/Game/Source/GDKShooter/Private/Characters/Components/HealthComponent.cpp b/Game/Source/GDKShooter/Private/Characters/Components/HealthComponent.cpp index e403c76b..57508444 100644 --- a/Game/Source/GDKShooter/Private/Characters/Components/HealthComponent.cpp +++ b/Game/Source/GDKShooter/Private/Characters/Components/HealthComponent.cpp @@ -1,17 +1,17 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "HealthComponent.h" -#include "Components/ControllerEventsComponent.h" -#include "Components/ScorePublisher.h" +#include "Characters/Components/HealthComponent.h" +#include "Controllers/Components/ControllerEventsComponent.h" +#include "Game/Components/ScorePublisher.h" #include "GameFramework/Pawn.h" -#include "TeamComponent.h" -#include "UnrealNetwork.h" +#include "Characters/Components/TeamComponent.h" +#include "Net/UnrealNetwork.h" UHealthComponent::UHealthComponent() { PrimaryComponentTick.bCanEverTick = true; - bReplicates = true; + SetIsReplicatedByDefault(true); MaxHealth = 100.f; CurrentHealth = MaxHealth; diff --git a/Game/Source/GDKShooter/Private/Characters/Components/MetaDataComponent.cpp b/Game/Source/GDKShooter/Private/Characters/Components/MetaDataComponent.cpp index a5933dba..42a52ce2 100644 --- a/Game/Source/GDKShooter/Private/Characters/Components/MetaDataComponent.cpp +++ b/Game/Source/GDKShooter/Private/Characters/Components/MetaDataComponent.cpp @@ -1,12 +1,12 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "MetaDataComponent.h" -#include "UnrealNetwork.h" +#include "Characters/Components/MetaDataComponent.h" +#include "Net/UnrealNetwork.h" #include "GDKLogging.h" UMetaDataComponent::UMetaDataComponent() { - bReplicates = true; + SetIsReplicatedByDefault(true); } void UMetaDataComponent::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const diff --git a/Game/Source/GDKShooter/Private/Characters/Components/ShootingComponent.cpp b/Game/Source/GDKShooter/Private/Characters/Components/ShootingComponent.cpp index 88630aba..4099776f 100644 --- a/Game/Source/GDKShooter/Private/Characters/Components/ShootingComponent.cpp +++ b/Game/Source/GDKShooter/Private/Characters/Components/ShootingComponent.cpp @@ -1,6 +1,6 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "ShootingComponent.h" +#include "Characters/Components/ShootingComponent.h" #include "CollisionQueryParams.h" #include "Engine/World.h" #include "GameFramework/Actor.h" diff --git a/Game/Source/GDKShooter/Private/Characters/Components/TeamComponent.cpp b/Game/Source/GDKShooter/Private/Characters/Components/TeamComponent.cpp index dbd72765..31d41754 100644 --- a/Game/Source/GDKShooter/Private/Characters/Components/TeamComponent.cpp +++ b/Game/Source/GDKShooter/Private/Characters/Components/TeamComponent.cpp @@ -1,7 +1,7 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "TeamComponent.h" -#include "UnrealNetwork.h" +#include "Characters/Components/TeamComponent.h" +#include "Net/UnrealNetwork.h" #include "Engine/World.h" @@ -9,7 +9,7 @@ UTeamComponent::UTeamComponent() { PrimaryComponentTick.bCanEverTick = false; - bReplicates = true; + SetIsReplicatedByDefault(true); } void UTeamComponent::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const diff --git a/Game/Source/GDKShooter/Private/Characters/GDKCharacter.cpp b/Game/Source/GDKShooter/Private/Characters/GDKCharacter.cpp index 13374f07..5a7a8d5a 100644 --- a/Game/Source/GDKShooter/Private/Characters/GDKCharacter.cpp +++ b/Game/Source/GDKShooter/Private/Characters/GDKCharacter.cpp @@ -1,12 +1,12 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "GDKCharacter.h" +#include "Characters/GDKCharacter.h" #include "Components/CapsuleComponent.h" #include "GameFramework/CharacterMovementComponent.h" #include "Components/SkeletalMeshComponent.h" -#include "SpatialNetDriver.h" -#include "UnrealNetwork.h" +#include "EngineClasses/SpatialNetDriver.h" +#include "Net/UnrealNetwork.h" #include "GDKLogging.h" #include "Controllers/GDKPlayerController.h" #include "Controllers/Components/ControllerEventsComponent.h" @@ -48,6 +48,9 @@ void AGDKCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputCompon PlayerInputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput); PlayerInputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput); + PlayerInputComponent->BindAxis("TurnRate", this, &APawn::AddControllerYawInput); + PlayerInputComponent->BindAxis("LookUpRate", this, &APawn::AddControllerPitchInput); + PlayerInputComponent->BindAction("Sprint", IE_Pressed, GDKMovementComponent, &UGDKMovementComponent::SetWantsToSprint, true); PlayerInputComponent->BindAction("Sprint", IE_Released, GDKMovementComponent, &UGDKMovementComponent::SetWantsToSprint, false); PlayerInputComponent->BindAction("Crouch", IE_Pressed, this, &AGDKCharacter::Crouch, true); diff --git a/Game/Source/GDKShooter/Private/Controllers/Components/ControllerEventsComponent.cpp b/Game/Source/GDKShooter/Private/Controllers/Components/ControllerEventsComponent.cpp index 74c534c4..cc58773e 100644 --- a/Game/Source/GDKShooter/Private/Controllers/Components/ControllerEventsComponent.cpp +++ b/Game/Source/GDKShooter/Private/Controllers/Components/ControllerEventsComponent.cpp @@ -1,6 +1,6 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "ControllerEventsComponent.h" +#include "Controllers/Components/ControllerEventsComponent.h" #include "GameFramework/Controller.h" #include "GameFramework/PlayerState.h" diff --git a/Game/Source/GDKShooter/Private/Controllers/Components/TeamSettingComponent.cpp b/Game/Source/GDKShooter/Private/Controllers/Components/TeamSettingComponent.cpp index 6fdb62c9..e2482dd2 100644 --- a/Game/Source/GDKShooter/Private/Controllers/Components/TeamSettingComponent.cpp +++ b/Game/Source/GDKShooter/Private/Controllers/Components/TeamSettingComponent.cpp @@ -1,6 +1,6 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "TeamSettingComponent.h" +#include "Controllers/Components/TeamSettingComponent.h" #include "GDKLogging.h" #include "AIController.h" diff --git a/Game/Source/GDKShooter/Private/Controllers/GDKPlayerController.cpp b/Game/Source/GDKShooter/Private/Controllers/GDKPlayerController.cpp index 7e6258ef..3c384fce 100644 --- a/Game/Source/GDKShooter/Private/Controllers/GDKPlayerController.cpp +++ b/Game/Source/GDKShooter/Private/Controllers/GDKPlayerController.cpp @@ -4,11 +4,12 @@ #include "Blueprint/UserWidget.h" #include "Camera/CameraComponent.h" -#include "Components/ControllerEventsComponent.h" -#include "Components/EquippedComponent.h" -#include "Components/HealthComponent.h" -#include "Components/MetaDataComponent.h" -#include "Connection/SpatialWorkerConnection.h" +#include "Controllers/Components/ControllerEventsComponent.h" +#include "Characters/Components/EquippedComponent.h" +#include "Characters/Components/HealthComponent.h" +#include "Characters/Components/MetaDataComponent.h" +#include "EngineClasses/SpatialNetDriver.h" +#include "Interop/Connection/SpatialWorkerConnection.h" #include "Game/Components/ScorePublisher.h" #include "Game/Components/SpawnRequestPublisher.h" #include "Game/Components/PlayerPublisher.h" @@ -16,8 +17,8 @@ #include "GameFramework/GameStateBase.h" #include "GameFramework/PlayerState.h" #include "GameFramework/SpringArmComponent.h" -#include "SpatialNetDriver.h" -#include "UnrealNetwork.h" +#include "GameFramework/TouchInterface.h" +#include "Net/UnrealNetwork.h" #include "Weapons/Holdable.h" #include "Weapons/Projectile.h" #include "Weapons/Weapon.h" @@ -97,10 +98,12 @@ void AGDKPlayerController::SetUIMode(bool bIsUIMode) if (bIsUIMode) { SetInputMode(FInputModeGameAndUI()); + ActivateTouchInterface(nullptr); } else { SetInputMode(FInputModeGameOnly()); + CreateTouchInterface(); } if (GetPawn()) diff --git a/Game/Source/GDKShooter/Private/Deployments/DeploymentSnapshotTemplate.cpp b/Game/Source/GDKShooter/Private/Deployments/DeploymentSnapshotTemplate.cpp index 2bbcd247..6c31e595 100644 --- a/Game/Source/GDKShooter/Private/Deployments/DeploymentSnapshotTemplate.cpp +++ b/Game/Source/GDKShooter/Private/Deployments/DeploymentSnapshotTemplate.cpp @@ -1,10 +1,10 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "DeploymentSnapshotTemplate.h" +#include "Deployments/DeploymentSnapshotTemplate.h" #include "SpatialCommonTypes.h" #include "SpatialConstants.h" -#include "StandardLibrary.h" +#include "Schema/StandardLibrary.h" bool UDeploymentSnapshotTemplate::WriteToSnapshotOutput(Worker_SnapshotOutputStream* OutputStream, Worker_EntityId& NextEntityId) { @@ -36,7 +36,7 @@ bool UDeploymentSnapshotTemplate::WriteToSnapshotOutput(Worker_SnapshotOutputStr DeploymentComponentData.component_id = 1001; DeploymentComponentData.schema_type = Schema_CreateComponentData(); - Components.Add(SpatialGDK::Position(SpatialGDK::Origin).CreatePositionData()); + Components.Add(SpatialGDK::Position(SpatialGDK::DeploymentOrigin).CreatePositionData()); Components.Add(SpatialGDK::Metadata(TEXT("Session")).CreateMetadataData()); Components.Add(SpatialGDK::Persistence().CreatePersistenceData()); Components.Add(SpatialGDK::EntityAcl(AnyWorkerPermission, ComponentWriteAcl).CreateEntityAclData()); diff --git a/Game/Source/GDKShooter/Private/Deployments/DeploymentsPlayerController.cpp b/Game/Source/GDKShooter/Private/Deployments/DeploymentsPlayerController.cpp index b2367f5f..f6a234e0 100644 --- a/Game/Source/GDKShooter/Private/Deployments/DeploymentsPlayerController.cpp +++ b/Game/Source/GDKShooter/Private/Deployments/DeploymentsPlayerController.cpp @@ -1,11 +1,10 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "DeploymentsPlayerController.h" +#include "Deployments/DeploymentsPlayerController.h" -#include "SpatialGameInstance.h" +#include "EngineClasses/SpatialGameInstance.h" +#include "Interop/Connection/SpatialConnectionManager.h" #include "TimerManager.h" -#include "SpatialGDKSettings.h" -#include "SpatialWorkerConnection.h" #include "GDKLogging.h" @@ -14,19 +13,20 @@ void ADeploymentsPlayerController::BeginPlay() { Super::BeginPlay(); + ActivateTouchInterface(nullptr); bShowMouseCursor = true; USpatialGameInstance* SpatialGameInstance = GetGameInstance(); - SpatialWorkerConnection = SpatialGameInstance->GetSpatialWorkerConnection(); + SpatialConnectionManager = SpatialGameInstance->GetSpatialConnectionManager(); - if (SpatialWorkerConnection == nullptr) + if (SpatialConnectionManager == nullptr) { // We might not be using spatial networking in which case SpatialWorkerConnection will not exist so we should just return return; } FString SpatialWorkerType = SpatialGameInstance->GetSpatialWorkerType().ToString(); - SpatialWorkerConnection->RegisterOnLoginTokensCallback([this](const Worker_Alpha_LoginTokensResponse* Deployments){ + SpatialConnectionManager->RegisterOnLoginTokensCallback([this](const Worker_Alpha_LoginTokensResponse* Deployments){ Populate(Deployments); if (!GetWorld()->GetTimerManager().IsTimerActive(QueryDeploymentsTimer)) { @@ -37,14 +37,17 @@ void ADeploymentsPlayerController::BeginPlay() if (GetDefault()->bUseDevelopmentAuthenticationFlow) { - SpatialWorkerConnection->Connect(true, 0); + // Attempts to load the devAuthToken from the command line. + // If it has not been set, SpatialWorkerConnection will fail to retrieve a PIT. + SpatialConnectionManager->TrySetupConnectionConfigFromCommandLine(SpatialWorkerType); + SpatialConnectionManager->Connect(true, 0); } } void ADeploymentsPlayerController::EndPlay(const EEndPlayReason::Type Reason) { - if (SpatialWorkerConnection != nullptr) - SpatialWorkerConnection->RegisterOnLoginTokensCallback([](const Worker_Alpha_LoginTokensResponse* Deployments){return false;}); + if (SpatialConnectionManager != nullptr) + SpatialConnectionManager->RegisterOnLoginTokensCallback([](const Worker_Alpha_LoginTokensResponse* Deployments){return false;}); GetWorld()->GetTimerManager().ClearAllTimersForObject(this); } @@ -95,17 +98,17 @@ void ADeploymentsPlayerController::Populate(const Worker_Alpha_LoginTokensRespon void ADeploymentsPlayerController::JoinDeployment(const FString& LoginToken) { - if (SpatialWorkerConnection == nullptr) + if (SpatialConnectionManager == nullptr) { UE_LOG(LogGDK, Error, TEXT("Failure: failed to Join Deployment caused by SpatialWorkerConnection is nullptr")); return; } - const FLocatorConfig& LocatorConfig = SpatialWorkerConnection->LocatorConfig; + const FDevAuthConfig& DevAuthConfig = SpatialConnectionManager->DevAuthConfig; FURL TravelURL; - TravelURL.Host = LocatorConfig.LocatorHost; + TravelURL.Host = DevAuthConfig.LocatorHost; TravelURL.AddOption(TEXT("locator")); - TravelURL.AddOption(*FString::Printf(TEXT("playeridentity=%s"), *LocatorConfig.PlayerIdentityToken)); + TravelURL.AddOption(*FString::Printf(TEXT("playeridentity=%s"), *DevAuthConfig.PlayerIdentityToken)); TravelURL.AddOption(*FString::Printf(TEXT("login=%s"), *LoginToken)); OnLoadingStarted.Broadcast(); @@ -120,6 +123,6 @@ void ADeploymentsPlayerController::SetLoadingScreen(UUserWidget* LoadingScreen) void ADeploymentsPlayerController::ScheduleRefreshDeployments() { - if (SpatialWorkerConnection != nullptr) - SpatialWorkerConnection->RequestDeploymentLoginTokens(); + if (SpatialConnectionManager != nullptr) + SpatialConnectionManager->RequestDeploymentLoginTokens(); } diff --git a/Game/Source/GDKShooter/Private/GDKLogging.cpp b/Game/Source/GDKShooter/Private/GDKLogging.cpp index 8f76abc8..b93238dc 100644 --- a/Game/Source/GDKShooter/Private/GDKLogging.cpp +++ b/Game/Source/GDKShooter/Private/GDKLogging.cpp @@ -5,9 +5,9 @@ #include "CoreMinimal.h" #include "Engine/NetDriver.h" #include "GameFramework/Actor.h" -#include "SpatialNetDriver.h" -#include "SpatialPackageMapClient.h" -#include "Connection/SpatialWorkerConnection.h" +#include "EngineClasses/SpatialNetDriver.h" +#include "EngineClasses/SpatialPackageMapClient.h" +#include "Interop/Connection/SpatialWorkerConnection.h" DEFINE_LOG_CATEGORY(LogGDK); diff --git a/Game/Source/GDKShooter/Private/Game/Components/DeathmatchScoreComponent.cpp b/Game/Source/GDKShooter/Private/Game/Components/DeathmatchScoreComponent.cpp index 6af180f9..7ac8afff 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/DeathmatchScoreComponent.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/DeathmatchScoreComponent.cpp @@ -1,12 +1,12 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "DeathmatchScoreComponent.h" -#include "UnrealNetwork.h" +#include "Game/Components/DeathmatchScoreComponent.h" +#include "Net/UnrealNetwork.h" UDeathmatchScoreComponent::UDeathmatchScoreComponent() { PrimaryComponentTick.bCanEverTick = false; - bReplicates = true; + SetIsReplicatedByDefault(true); } void UDeathmatchScoreComponent::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const diff --git a/Game/Source/GDKShooter/Private/Game/Components/DeathmatchSpawnerComponent.cpp b/Game/Source/GDKShooter/Private/Game/Components/DeathmatchSpawnerComponent.cpp index 50091e18..cfe0c5ef 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/DeathmatchSpawnerComponent.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/DeathmatchSpawnerComponent.cpp @@ -1,9 +1,9 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "DeathmatchSpawnerComponent.h" +#include "Game/Components/DeathmatchSpawnerComponent.h" #include "Characters/Components/MetaDataComponent.h" -#include "Components/TeamComponent.h" +#include "Characters/Components/TeamComponent.h" #include "Engine/World.h" #include "Game/Components/PlayerPublisher.h" #include "GameFramework/GameModeBase.h" diff --git a/Game/Source/GDKShooter/Private/Game/Components/LobbyTimerComponent.cpp b/Game/Source/GDKShooter/Private/Game/Components/LobbyTimerComponent.cpp index 7c9582b0..fb0411f4 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/LobbyTimerComponent.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/LobbyTimerComponent.cpp @@ -1,6 +1,6 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "LobbyTimerComponent.h" +#include "Game/Components/LobbyTimerComponent.h" #include "GDKLogging.h" #include "GameFramework/Actor.h" #include "Misc/CommandLine.h" diff --git a/Game/Source/GDKShooter/Private/Game/Components/MatchStateComponent.cpp b/Game/Source/GDKShooter/Private/Game/Components/MatchStateComponent.cpp index f7569aaa..d5207d2b 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/MatchStateComponent.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/MatchStateComponent.cpp @@ -1,13 +1,13 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "MatchStateComponent.h" -#include "UnrealNetwork.h" +#include "Game/Components/MatchStateComponent.h" +#include "Net/UnrealNetwork.h" #include "GameFramework/Actor.h" UMatchStateComponent::UMatchStateComponent() { PrimaryComponentTick.bCanEverTick = false; - bReplicates = true; + SetIsReplicatedByDefault(true); } void UMatchStateComponent::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const diff --git a/Game/Source/GDKShooter/Private/Game/Components/MatchTimerComponent.cpp b/Game/Source/GDKShooter/Private/Game/Components/MatchTimerComponent.cpp index 948846c3..82bc0eaf 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/MatchTimerComponent.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/MatchTimerComponent.cpp @@ -1,6 +1,6 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "MatchTimerComponent.h" +#include "Game/Components/MatchTimerComponent.h" #include "Misc/CommandLine.h" void UMatchTimerComponent::BeginPlay() diff --git a/Game/Source/GDKShooter/Private/Game/Components/PlayerCountingComponent.cpp b/Game/Source/GDKShooter/Private/Game/Components/PlayerCountingComponent.cpp index b491fc3f..e2795864 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/PlayerCountingComponent.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/PlayerCountingComponent.cpp @@ -1,14 +1,14 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "PlayerCountingComponent.h" -#include "UnrealNetwork.h" +#include "Game/Components/PlayerCountingComponent.h" +#include "Net/UnrealNetwork.h" #include "GDKLogging.h" UPlayerCountingComponent::UPlayerCountingComponent() { PrimaryComponentTick.bCanEverTick = false; - bReplicates = true; + SetIsReplicatedByDefault(true); } void UPlayerCountingComponent::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const diff --git a/Game/Source/GDKShooter/Private/Game/Components/SpatialSessionStateComponent.cpp b/Game/Source/GDKShooter/Private/Game/Components/SpatialSessionStateComponent.cpp index aa1771d6..cf97fd72 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/SpatialSessionStateComponent.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/SpatialSessionStateComponent.cpp @@ -1,15 +1,12 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "SpatialSessionStateComponent.h" +#include "Game/Components/SpatialSessionStateComponent.h" #include "Engine/World.h" -#include "UnrealNetwork.h" -#include "SpatialNetDriver.h" -#include "SpatialStaticComponentView.h" -#include "SpatialWorkerConnection.h" - -#include -#include +#include "Net/UnrealNetwork.h" +#include "EngineClasses/SpatialNetDriver.h" +#include "Interop/SpatialStaticComponentView.h" +#include "Interop/Connection/SpatialWorkerConnection.h" void USpatialSessionStateComponent::SendStateUpdate(EGDKSessionProgress SessionProgressState) { @@ -31,7 +28,7 @@ void USpatialSessionStateComponent::SendStateUpdate(EGDKSessionProgress SessionP int SessionState = static_cast(SessionProgressState) + 1; Worker_EntityId target_entity_id = SessionEntityId; - Worker_ComponentUpdate component_update = {}; + FWorkerComponentUpdate component_update = {}; component_update.component_id = SessionComponentId; component_update.schema_type = Schema_CreateComponentUpdate(); Schema_Object* fields_object = Schema_GetComponentUpdateFields(component_update.schema_type); diff --git a/Game/Source/GDKShooter/Private/Game/Components/SpawnRequestPublisher.cpp b/Game/Source/GDKShooter/Private/Game/Components/SpawnRequestPublisher.cpp index b5aacc99..4911b0f0 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/SpawnRequestPublisher.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/SpawnRequestPublisher.cpp @@ -1,6 +1,6 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "SpawnRequestPublisher.h" +#include "Game/Components/SpawnRequestPublisher.h" USpawnRequestPublisher::USpawnRequestPublisher() diff --git a/Game/Source/GDKShooter/Private/Game/Components/TeamSpawnerComponent.cpp b/Game/Source/GDKShooter/Private/Game/Components/TeamSpawnerComponent.cpp index 3c8a5b32..e725897e 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/TeamSpawnerComponent.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/TeamSpawnerComponent.cpp @@ -1,11 +1,11 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "TeamSpawnerComponent.h" +#include "Game/Components/TeamSpawnerComponent.h" -#include "Components/MetaDataComponent.h" -#include "Components/TeamComponent.h" +#include "Characters/Components/MetaDataComponent.h" +#include "Characters/Components/TeamComponent.h" #include "EngineUtils.h" -#include "Components/PlayerPublisher.h" +#include "Game/Components/PlayerPublisher.h" #include "GameFramework/GameModeBase.h" #include "GameFramework/GameStateBase.h" #include "GameFramework/PlayerController.h" diff --git a/Game/Source/GDKShooter/Private/Game/Components/TimerComponent.cpp b/Game/Source/GDKShooter/Private/Game/Components/TimerComponent.cpp index 26b45f81..1d5b3789 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/TimerComponent.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/TimerComponent.cpp @@ -1,14 +1,14 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "TimerComponent.h" +#include "Game/Components/TimerComponent.h" #include "Engine/World.h" #include "GDKLogging.h" -#include "UnrealNetwork.h" +#include "Net/UnrealNetwork.h" UTimerComponent::UTimerComponent() { PrimaryComponentTick.bCanEverTick = false; - bReplicates = true; + SetIsReplicatedByDefault(true); } void UTimerComponent::BeginPlay() diff --git a/Game/Source/GDKShooter/Private/GameFramework/CrossServerPawn.cpp b/Game/Source/GDKShooter/Private/GameFramework/CrossServerPawn.cpp index a36bc130..4f2ab327 100644 --- a/Game/Source/GDKShooter/Private/GameFramework/CrossServerPawn.cpp +++ b/Game/Source/GDKShooter/Private/GameFramework/CrossServerPawn.cpp @@ -1,6 +1,6 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "CrossServerPawn.h" +#include "GameFramework/CrossServerPawn.h" float ACrossServerPawn::TakeDamage(float Damage, const FDamageEvent& DamageEvent, AController* EventInstigator, AActor* DamageCauser) { diff --git a/Game/Source/GDKShooter/Private/UI/GDKWidget.cpp b/Game/Source/GDKShooter/Private/UI/GDKWidget.cpp index 4d493077..c30384d4 100644 --- a/Game/Source/GDKShooter/Private/UI/GDKWidget.cpp +++ b/Game/Source/GDKShooter/Private/UI/GDKWidget.cpp @@ -1,16 +1,18 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "GDKWidget.h" -#include "Components/ControllerEventsComponent.h" -#include "Components/GDKMovementComponent.h" -#include "Components/HealthComponent.h" -#include "EngineClasses/SpatialGameInstance.h" +#include "UI/GDKWidget.h" +#include "Controllers/Components/ControllerEventsComponent.h" +#include "Characters/Components/GDKMovementComponent.h" +#include "Characters/Components/HealthComponent.h" #include "Game/Components/LobbyTimerComponent.h" #include "Game/Components/MatchTimerComponent.h" #include "Game/Components/PlayerCountingComponent.h" #include "GameFramework/GameStateBase.h" #include "Weapons/InstantWeapon.h" +#include "EngineClasses/SpatialGameInstance.h" +#include "Interop/Connection/SpatialConnectionManager.h" + // Register listeners on AGDKPlayerController and AGDKGameState void UGDKWidget::NativeConstruct() { @@ -109,7 +111,7 @@ void UGDKWidget::LeaveGame(const FString& TargetMap) if (USpatialGameInstance* GameInstance = Cast(GetGameInstance())) { - GameInstance->GetSpatialWorkerConnection()->DestroyConnection(); + GameInstance->GetSpatialConnectionManager()->DestroyConnection(); } GetOwningPlayer()->ClientTravel(TravelURL.ToString(), TRAVEL_Absolute, false /*bSeamless*/); diff --git a/Game/Source/GDKShooter/Private/Weapons/Holdable.cpp b/Game/Source/GDKShooter/Private/Weapons/Holdable.cpp index 8976a7d3..dbbd9387 100644 --- a/Game/Source/GDKShooter/Private/Weapons/Holdable.cpp +++ b/Game/Source/GDKShooter/Private/Weapons/Holdable.cpp @@ -1,11 +1,11 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "Holdable.h" -#include "GDKLogging.h" -#include "Components/EquippedComponent.h" -#include "Components/SkeletalMeshComponent.h" -#include "UnrealNetwork.h" +#include "Weapons/Holdable.h" +#include "Characters/Components/EquippedComponent.h" +#include "Components/SkeletalMeshComponent.h" +#include "GDKLogging.h" +#include "Net/UnrealNetwork.h" AHoldable::AHoldable() { @@ -13,7 +13,7 @@ AHoldable::AHoldable() PrimaryActorTick.bCanEverTick = false; bReplicates = true; - bReplicateMovement = true; + SetReplicatingMovement(true); LocationComponent = CreateDefaultSubobject(TEXT("RootComponent")); SetRootComponent(LocationComponent); diff --git a/Game/Source/GDKShooter/Private/Weapons/InstantWeapon.cpp b/Game/Source/GDKShooter/Private/Weapons/InstantWeapon.cpp index fa654f7f..42391e41 100644 --- a/Game/Source/GDKShooter/Private/Weapons/InstantWeapon.cpp +++ b/Game/Source/GDKShooter/Private/Weapons/InstantWeapon.cpp @@ -1,12 +1,12 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "InstantWeapon.h" +#include "Weapons/InstantWeapon.h" #include "Engine/World.h" #include "Kismet/GameplayStatics.h" #include "GameFramework/DamageType.h" #include "GDKLogging.h" -#include "UnrealNetwork.h" +#include "Net/UnrealNetwork.h" AInstantWeapon::AInstantWeapon() @@ -61,7 +61,7 @@ void AInstantWeapon::DoFire_Implementation() { ServerDidHit(HitInfo); SpawnFX(HitInfo, true); // Spawn the hit fx locally - AnnounceShot(HitInfo.HitActor ? HitInfo.HitActor->bCanBeDamaged : false); + AnnounceShot(HitInfo.HitActor ? HitInfo.HitActor->CanBeDamaged() : false); } else { diff --git a/Game/Source/GDKShooter/Private/Weapons/Projectile.cpp b/Game/Source/GDKShooter/Private/Weapons/Projectile.cpp index 998652d2..8b76c9a3 100644 --- a/Game/Source/GDKShooter/Private/Weapons/Projectile.cpp +++ b/Game/Source/GDKShooter/Private/Weapons/Projectile.cpp @@ -1,12 +1,12 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "Projectile.h" +#include "Weapons/Projectile.h" #include "Kismet/GameplayStatics.h" #include "Components/StaticMeshComponent.h" #include "Engine/World.h" #include "GameFramework/Pawn.h" #include "GDKLogging.h" -#include "UnrealNetwork.h" +#include "Net/UnrealNetwork.h" AProjectile::AProjectile(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { @@ -14,7 +14,7 @@ AProjectile::AProjectile(const FObjectInitializer& ObjectInitializer) : Super(Ob PrimaryActorTick.TickGroup = TG_PrePhysics; bReplicates = true; - bReplicateMovement = true; + SetReplicatingMovement(true); SetRemoteRoleForBackwardsCompat(ROLE_SimulatedProxy); CollisionComp = ObjectInitializer.CreateDefaultSubobject(this, TEXT("SphereComp")); @@ -45,7 +45,7 @@ AProjectile::AProjectile(const FObjectInitializer& ObjectInitializer) : Super(Ob void AProjectile::PostInitializeComponents() { Super::PostInitializeComponents(); - CollisionComp->MoveIgnoreActors.Add(Instigator); + CollisionComp->MoveIgnoreActors.Add(GetInstigator()); MovementComp->OnProjectileStop.AddDynamic(this, &AProjectile::OnStop); MovementComp->OnProjectileBounce.AddDynamic(this, &AProjectile::OnBounce); CollisionComp->OnComponentBeginOverlap.AddDynamic(this, &AProjectile::BeginOverlap); @@ -161,7 +161,7 @@ void AProjectile::Explode() return; } - bCanBeDamaged = false; + SetCanBeDamaged(false); bExploded = true; MovementComp->StopMovementImmediately(); SetLifeSpan(2.0f); diff --git a/Game/Source/GDKShooter/Private/Weapons/ProjectileWeapon.cpp b/Game/Source/GDKShooter/Private/Weapons/ProjectileWeapon.cpp index 4ad2bee0..4e9630fa 100644 --- a/Game/Source/GDKShooter/Private/Weapons/ProjectileWeapon.cpp +++ b/Game/Source/GDKShooter/Private/Weapons/ProjectileWeapon.cpp @@ -1,6 +1,6 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "ProjectileWeapon.h" +#include "Weapons/ProjectileWeapon.h" #include "Kismet/GameplayStatics.h" #include "Engine/World.h" diff --git a/Game/Source/GDKShooter/Private/Weapons/Weapon.cpp b/Game/Source/GDKShooter/Private/Weapons/Weapon.cpp index 24a6a5ee..8af55ea8 100644 --- a/Game/Source/GDKShooter/Private/Weapons/Weapon.cpp +++ b/Game/Source/GDKShooter/Private/Weapons/Weapon.cpp @@ -1,13 +1,13 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -#include "Weapon.h" +#include "Weapons/Weapon.h" #include "Engine/World.h" #include "Components/SkeletalMeshComponent.h" #include "CollisionQueryParams.h" #include "Kismet/GameplayStatics.h" #include "GDKLogging.h" -#include "UnrealNetwork.h" +#include "Net/UnrealNetwork.h" AWeapon::AWeapon() diff --git a/Game/Source/GDKShooter/Public/Characters/Components/EquippedComponent.h b/Game/Source/GDKShooter/Public/Characters/Components/EquippedComponent.h index c0f88b0b..8733405f 100644 --- a/Game/Source/GDKShooter/Public/Characters/Components/EquippedComponent.h +++ b/Game/Source/GDKShooter/Public/Characters/Components/EquippedComponent.h @@ -102,13 +102,13 @@ class GDKSHOOTER_API UEquippedComponent : public UActorComponent UFUNCTION() void BlockUsing(bool bBlock); - UFUNCTION() + UFUNCTION(BlueprintCallable) void StartPrimaryUse(); - UFUNCTION() + UFUNCTION(BlueprintCallable) void StopPrimaryUse(); - UFUNCTION() + UFUNCTION(BlueprintCallable) void StartSecondaryUse(); - UFUNCTION() + UFUNCTION(BlueprintCallable) void StopSecondaryUse(); UFUNCTION() diff --git a/Game/Source/GDKShooter/Public/Characters/GDKCharacter.h b/Game/Source/GDKShooter/Public/Characters/GDKCharacter.h index d5896057..26dd468e 100644 --- a/Game/Source/GDKShooter/Public/Characters/GDKCharacter.h +++ b/Game/Source/GDKShooter/Public/Characters/GDKCharacter.h @@ -5,11 +5,11 @@ #include "CoreMinimal.h" #include "Materials/MaterialInstance.h" #include "GameFramework/Character.h" -#include "Components/HealthComponent.h" -#include "Components/EquippedComponent.h" -#include "Components/MetaDataComponent.h" -#include "Components/GDKMovementComponent.h" -#include "Components/TeamComponent.h" +#include "Characters/Components/HealthComponent.h" +#include "Characters/Components/EquippedComponent.h" +#include "Characters/Components/MetaDataComponent.h" +#include "Characters/Components/GDKMovementComponent.h" +#include "Characters/Components/TeamComponent.h" #include "Weapons/Holdable.h" #include "TimerManager.h" #include "Runtime/AIModule/Classes/GenericTeamAgentInterface.h" diff --git a/Game/Source/GDKShooter/Public/Deployments/DeploymentsPlayerController.h b/Game/Source/GDKShooter/Public/Deployments/DeploymentsPlayerController.h index 830b0ce5..34a631b8 100644 --- a/Game/Source/GDKShooter/Public/Deployments/DeploymentsPlayerController.h +++ b/Game/Source/GDKShooter/Public/Deployments/DeploymentsPlayerController.h @@ -9,7 +9,7 @@ #include "DeploymentsPlayerController.generated.h" -class USpatialWorkerConnection; +class USpatialConnectionManager; USTRUCT(BlueprintType) struct FDeploymentInfo { @@ -54,7 +54,7 @@ class GDKSHOOTER_API ADeploymentsPlayerController : public APlayerController const char * LatestPITokenData; FTimerHandle QueryDeploymentsTimer; - USpatialWorkerConnection* SpatialWorkerConnection = nullptr; + USpatialConnectionManager* SpatialConnectionManager = nullptr; UFUNCTION(BlueprintCallable) void JoinDeployment(const FString& LoginToken); diff --git a/Game/Source/GDKShooter/Public/Weapons/Holdable.h b/Game/Source/GDKShooter/Public/Weapons/Holdable.h index eb367d16..2ea4e23b 100644 --- a/Game/Source/GDKShooter/Public/Weapons/Holdable.h +++ b/Game/Source/GDKShooter/Public/Weapons/Holdable.h @@ -4,7 +4,7 @@ #include "CoreMinimal.h" #include "GameFramework/Actor.h" -#include "Components/EquippedComponent.h" +#include "Characters/Components/EquippedComponent.h" #include "Characters/Components/MetaDataComponent.h" #include "Holdable.generated.h" diff --git a/Game/Source/GDKShooter/Public/Weapons/Weapon.h b/Game/Source/GDKShooter/Public/Weapons/Weapon.h index 4417d4cf..028411c8 100644 --- a/Game/Source/GDKShooter/Public/Weapons/Weapon.h +++ b/Game/Source/GDKShooter/Public/Weapons/Weapon.h @@ -4,8 +4,8 @@ #include "CoreMinimal.h" #include "Camera/CameraShake.h" -#include "Components/GDKMovementComponent.h" -#include "Components/ShootingComponent.h" +#include "Characters/Components/GDKMovementComponent.h" +#include "Characters/Components/ShootingComponent.h" #include "GameFramework/Actor.h" #include "Holdable.h" #include "Materials/Material.h" diff --git a/Game/Source/GDKShooterEditor.Target.cs b/Game/Source/GDKShooterEditor.Target.cs index 54de5b68..e1ba7bd9 100644 --- a/Game/Source/GDKShooterEditor.Target.cs +++ b/Game/Source/GDKShooterEditor.Target.cs @@ -9,5 +9,6 @@ public GDKShooterEditorTarget(TargetInfo Target) : base(Target) { Type = TargetType.Editor; ExtraModuleNames.Add("GDKShooter"); + DefaultBuildSettings = BuildSettingsVersion.V2; } } diff --git a/Launch10SimPlayerClients.bat b/Launch10SimPlayerClients.bat new file mode 100644 index 00000000..1905a04c --- /dev/null +++ b/Launch10SimPlayerClients.bat @@ -0,0 +1,11 @@ +@echo off +start LaunchSimPlayerClient.bat +start LaunchSimPlayerClient.bat +start LaunchSimPlayerClient.bat +start LaunchSimPlayerClient.bat +start LaunchSimPlayerClient.bat +start LaunchSimPlayerClient.bat +start LaunchSimPlayerClient.bat +start LaunchSimPlayerClient.bat +start LaunchSimPlayerClient.bat +start LaunchSimPlayerClient.bat \ No newline at end of file diff --git a/LaunchSimPlayerClient.bat b/LaunchSimPlayerClient.bat new file mode 100644 index 00000000..1a5963a5 --- /dev/null +++ b/LaunchSimPlayerClient.bat @@ -0,0 +1,4 @@ +@echo off +call "%~dp0FindEngine.bat" +call "%~dp0ProjectPaths.bat" +"%UNREAL_ENGINE:"=%\Engine\Binaries\Win64\UE4Editor.exe" "%~dp0%PROJECT_PATH%\%GAME_NAME%.uproject" 127.0.0.1 -game -log -workerType UnrealClient -stdout -nowrite -unattended -nologtimes -nopause -noin -messaging -NoVerifyGC -windowed -ResX=800 -ResY=600 -simulatedPlayer diff --git a/ci/common.ps1 b/ci/common.ps1 index 3d409533..f16602f8 100644 --- a/ci/common.ps1 +++ b/ci/common.ps1 @@ -1,3 +1,5 @@ +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + function Write-Log() { param( [string] $msg, @@ -55,4 +57,4 @@ function Get-Env-Variable-Value-Or-Default() { } } -$ErrorActionPreference = 'Stop' \ No newline at end of file +$ErrorActionPreference = 'Stop' diff --git a/ci/deploy.ps1 b/ci/deploy.ps1 index 0572c075..b62ba003 100644 --- a/ci/deploy.ps1 +++ b/ci/deploy.ps1 @@ -77,7 +77,7 @@ pushd "spatial" buildkite-agent meta-data set "deployment-name-$($env:STEP_NUMBER)" "$deployment_name" buildkite-agent meta-data set "project-name" "$project_name" - buildkite-agent meta-data set "gdk-commit-hash" "$gdk_commit_hash)" + buildkite-agent meta-data set "gdk-commit-hash" "$gdk_commit_hash" } else { Write-Log "Deployment will not be launched as you have passed in an argument specifying that it should not be (START_DEPLOYMENT=${launch_deployment}). Remove it to have your build launch a deployment." } diff --git a/ci/generate-pipeline-steps.sh b/ci/generate-pipeline-steps.sh index fd65e57f..c4dd7092 100644 --- a/ci/generate-pipeline-steps.sh +++ b/ci/generate-pipeline-steps.sh @@ -1,6 +1,16 @@ #!/bin/bash set -euo pipefail +BUILDKITE_TEMPLATE_FILE=ci/nightly.template.steps.yaml + +if [[ -n "${MAC_BUILD:-}" ]]; then + export BUILDKITE_COMMAND="./ci/setup-and-build.sh" + REPLACE_STRING="s|BUILKDITE_AGENT_PLACEHOLDER|macos|g" +else + export BUILDKITE_COMMAND="powershell -NoProfile -NonInteractive -InputFormat Text -Command ./ci/setup-and-build.ps1" + REPLACE_STRING="s|BUILKDITE_AGENT_PLACEHOLDER|windows|g" +fi + # Download the unreal-engine.version file from the GDK repo so we can run the example project builds on the same versions the GDK was run against # This is not the pinnacle of engineering, as we rely on GitHub's web interface to download the file, but it seems like GitHub disallows git archive # which would be our other option for downloading a single file @@ -20,20 +30,28 @@ done # We retrieve these engine versions from the unreal-engine.version file in the UnrealGDK repository. # The steps are based on the template in nightly.template.steps.yaml. +# Default to only testing the first version listed in the unreal-engine.version file +MAXIMUM_ENGINE_VERSION_COUNT_LOCAL="${MAXIMUM_ENGINE_VERSION_COUNT:-1}" if [ -z "${ENGINE_VERSION}" ]; then - echo "Generating build steps for each engine version listed in unreal-engine.version" + echo "Generating build steps for the first ${MAXIMUM_ENGINE_VERSION_COUNT_LOCAL} engine versions listed in unreal-engine.version" STEP_NUMBER=1 IFS=$'\n' - for commit_hash in $(cat < ci/unreal-engine.version); do - REPLACE_STRING="s|ENGINE_COMMIT_HASH_PLACEHOLDER|$commit_hash|g; s|STEP_NUMBER_PLACEHOLDER|$STEP_NUMBER|g" - sed $REPLACE_STRING ci/nightly.template.steps.yaml | buildkite-agent pipeline upload + for COMMIT_HASH in $(cat < ci/unreal-engine.version); do + if ((STEP_NUMBER > MAXIMUM_ENGINE_VERSION_COUNT_LOCAL)); then + break + fi + + export ENGINE_COMMIT_HASH="${COMMIT_HASH}" + export STEP_NUMBER + sed $REPLACE_STRING "${BUILDKITE_TEMPLATE_FILE}" | buildkite-agent pipeline upload STEP_NUMBER=$((STEP_NUMBER+1)) done # We generate one build step for each engine version, which is one line in the unreal-engine.version file. # The number of engine versions we are dealing with is therefore the counting variable from the above loop minus one. STEP_NUMBER=$((STEP_NUMBER-1)) - buildkite-agent meta-data set "engine-version-count" "$STEP_NUMBER" + buildkite-agent meta-data set "engine-version-count" "${STEP_NUMBER}" else echo "Generating steps for the specified engine version: $ENGINE_VERSION" - sed "s|ENGINE_COMMIT_HASH_PLACEHOLDER|$ENGINE_VERSION|g" ci/nightly.template.steps.yaml | buildkite-agent pipeline upload + export ENGINE_COMMIT_HASH=${ENGINE_VERSION} + sed $REPLACE_STRING "${BUILDKITE_TEMPLATE_FILE}" | buildkite-agent pipeline upload fi diff --git a/ci/nightly.template.steps.yaml b/ci/nightly.template.steps.yaml index ce4ff3b2..2a3fc219 100644 --- a/ci/nightly.template.steps.yaml +++ b/ci/nightly.template.steps.yaml @@ -1,4 +1,19 @@ -common: &common +--- +# This is designed to trap and retry failures because agent lost +# connection. Agent exits with -1 in this case. +agent_transients: &agent_transients + exit_status: -1 + limit: 3 +# BK system error +bk_system_error: &bk_system_error + exit_status: 255 + limit: 3 +# job was interrupted by a signal (e.g. ctrl+c etc) +bk_interrupted_by_signal: &bk_interrupted_by_signal + exit_status: 15 + limit: 3 + +windows: &windows agents: - "agent_count=1" - "capable_of_building=gdk-for-unreal" @@ -7,22 +22,41 @@ common: &common - "permission_set=builder" - "platform=windows" - "scaler_version=2" - - "queue=${CI_WINDOWS_BUILDER_QUEUE:-v4-2019-11-07-bk3700-fbffad576b9676d7}" # Has FASTbuild disabled + - "queue=${CI_WINDOWS_BUILDER_QUEUE:-v4-20-03-26-102432-bk9951-8afe0ffb}" + - "boot_disk_size_gb=500" timeout_in_minutes: 60 # TODO(ENG-548): reduce timeout once agent-cold-start is optimised. retry: automatic: - # This is designed to trap and retry failures because agent lost connection. Agent exits with -1 in this case. - - exit_status: -1 - limit: 3 + - <<: *agent_transients + - <<: *bk_system_error + - <<: *bk_interrupted_by_signal plugins: - ca-johnson/taskkill#v4.1: ~ +macos: &macos + agents: + - "capable_of_building=gdk-for-unreal" + - "environment=production" + - "permission_set=builder" + - "platform=macos" + - "queue=${DARWIN_BUILDER_QUEUE:-v4-9c6ee0ef-d}" + timeout_in_minutes: 60 + retry: + automatic: + - <<: *agent_transients + - <<: *bk_system_error + - <<: *bk_interrupted_by_signal + steps: - - label: "build-and-deploy-:windows:-ENGINE_COMMIT_HASH_PLACEHOLDER" - command: "powershell -NoProfile -NonInteractive -InputFormat Text -Command ./ci/setup-and-build.ps1" - <<: *common # This folds the YAML named anchor into this step. Overrides, if any, should follow, not precede. + - label: "build-and-deploy-BUILKDITE_AGENT_PLACEHOLDER-${ENGINE_COMMIT_HASH}" + command: ${BUILDKITE_COMMAND} + <<: *BUILKDITE_AGENT_PLACEHOLDER artifact_paths: - "UnrealEngine/Engine/Programs/AutomationTool/Saved/Logs/*" + - "cooked-android/**/*" + - "cooked-mac/**/*" + - "cooked-ios/**/*" env: - ENGINE_COMMIT_HASH: "ENGINE_COMMIT_HASH_PLACEHOLDER" - STEP_NUMBER: "STEP_NUMBER_PLACEHOLDER" + ENGINE_COMMIT_HASH: "${ENGINE_COMMIT_HASH}" + STEP_NUMBER: "${STEP_NUMBER}" + UE-SharedDataCachePath: "\\\\gdk-for-unreal-cache.${CI_ENVIRONMENT}-intinf-eu1.i8e.io\\samba\\ddc" diff --git a/ci/setup-and-build.ps1 b/ci/setup-and-build.ps1 index 7276e3d2..5ba589ad 100644 --- a/ci/setup-and-build.ps1 +++ b/ci/setup-and-build.ps1 @@ -5,14 +5,16 @@ param( [string] $deployment_launch_configuration = "one_worker_test.json", [string] $deployment_snapshot_path = "snapshots/FPS-Start_Small.snapshot", [string] $deployment_cluster_region = "eu", - [string] $project_name = "unreal_gdk" + [string] $project_name = "unreal_gdk", + [string] $build_home = (Get-Item "$($PSScriptRoot)").parent.parent.FullName, ## The root of the entire build. Should ultimately resolve to "C:\b\\". + [string] $unreal_engine_symlink_dir = "$build_home\UnrealEngine" ) . "$PSScriptRoot\common.ps1" # When a build is launched custom environment variables can be specified. # Parse them here to use the set value or the default. -$gdk_branch_name = Get-Env-Variable-Value-Or-Default -environment_variable_name "GDK_BRANCH" -default_value "master" +$gdk_branch_name = Get-Env-Variable-Value-Or-Default -environment_variable_name "GDK_BRANCH" -default_value "0.9.0" $launch_deployment = Get-Env-Variable-Value-Or-Default -environment_variable_name "START_DEPLOYMENT" -default_value "true" $gdk_home = "${exampleproject_home}\Game\Plugins\UnrealGDK" @@ -50,19 +52,18 @@ pushd "$exampleproject_home" # Use the cached engine version or set it up if it has not been cached yet. Start-Event "set-up-engine" "build-unreal-gdk-example-project-:windows:" - $engine_directory = "${exampleproject_home}\UnrealEngine" - &"$($gdk_home)\ci\get-engine.ps1" -unreal_path "$engine_directory" + &"$($gdk_home)\ci\get-engine.ps1" -unreal_path "$unreal_engine_symlink_dir" Finish-Event "set-up-engine" "build-unreal-gdk-example-project-:windows:" Start-Event "associate-uproject-with-engine" "build-unreal-gdk-example-project-:windows:" - pushd $engine_directory + pushd $unreal_engine_symlink_dir $unreal_version_selector_path = "Engine\Binaries\Win64\UnrealVersionSelector.exe" $find_engine_process = Start-Process -Wait -PassThru -NoNewWindow -FilePath $unreal_version_selector_path -ArgumentList @(` "-switchversionsilent", ` "${exampleproject_home}\Game\GDKShooter.uproject", ` - "$engine_directory" + "$unreal_engine_symlink_dir" ) if ($find_engine_process.ExitCode -ne 0) { @@ -88,7 +89,7 @@ pushd "$exampleproject_home" # This works around an issue whereby Wait-Process would fail to find build_editor_proc $build_editor_handle = $build_editor_proc.Handle - Wait-Process -Id (Get-Process -InputObject $build_editor_proc).id + Wait-Process -InputObject $build_editor_proc if ($build_editor_proc.ExitCode -ne 0) { Write-Log "Failed to build Win64 Development Editor. Error: $($build_editor_proc.ExitCode)" Throw "Failed to build Win64 Development Editor" @@ -97,12 +98,18 @@ pushd "$exampleproject_home" # Invoke the GDK commandlet to generate schema and snapshot. Note: this needs to be run prior to cooking Start-Event "generate-schema" "build-unreal-gdk-example-project-:windows:" - pushd "UnrealEngine/Engine/Binaries/Win64" - Start-Process -Wait -PassThru -NoNewWindow -FilePath ((Convert-Path .) + "\UE4Editor.exe") -ArgumentList @(` + pushd "${unreal_engine_symlink_dir}/Engine/Binaries/Win64" + $schema_gen_proc = Start-Process -PassThru -NoNewWindow -FilePath ((Convert-Path .) + "\UE4Editor.exe") -ArgumentList @(` "$($exampleproject_home)/Game/GDKShooter.uproject", ` "-run=GenerateSchemaAndSnapshots", ` "-MapPaths=`"/Maps/FPS-Start_Small`"" ) + $schema_gen_handle = $schema_gen_proc.Handle + Wait-Process -InputObject $schema_gen_proc + if ($schema_gen_proc.ExitCode -ne 0) { + Write-Log "Failed to generate schema. Error: $($schema_gen_proc.ExitCode)" + Throw "Failed to generate schema" + } popd Finish-Event "generate-schema" "build-unreal-gdk-example-project-:windows:" @@ -114,7 +121,7 @@ pushd "$exampleproject_home" "GDKShooter.uproject" ) $build_client_handle = $build_client_proc.Handle - Wait-Process -Id (Get-Process -InputObject $build_client_proc).id + Wait-Process -InputObject $build_client_proc if ($build_client_proc.ExitCode -ne 0) { Write-Log "Failed to build Win64 Development Client. Error: $($build_client_proc.ExitCode)" Throw "Failed to build Win64 Development Client" @@ -129,7 +136,7 @@ pushd "$exampleproject_home" "GDKShooter.uproject" ) $build_server_handle = $build_server_proc.Handle - Wait-Process -Id (Get-Process -InputObject $build_server_proc).id + Wait-Process -InputObject $build_server_proc if ($build_server_proc.ExitCode -ne 0) { Write-Log "Failed to build Linux Development Server. Error: $($build_server_proc.ExitCode)" @@ -137,6 +144,40 @@ pushd "$exampleproject_home" } Finish-Event "build-linux-worker" "build-unreal-gdk-example-project-:windows:" + Start-Event "build-android-client" "build-unreal-gdk-example-project-:windows:" + $unreal_uat_path = "${unreal_engine_symlink_dir}\Engine\Build\BatchFiles\RunUAT.bat" + $build_server_proc = Start-Process -PassThru -NoNewWindow -FilePath $unreal_uat_path -ArgumentList @(` + "-ScriptsForProject=$($exampleproject_home)/Game/GDKShooter.uproject", ` + "BuildCookRun", ` + "-nocompileeditor", ` + "-nop4", ` + "-project=$($exampleproject_home)/Game/GDKShooter.uproject", ` + "-cook", ` + "-stage", ` + "-archive", ` + "-archivedirectory=$($exampleproject_home)/cooked-android", ` + "-package", ` + "-clientconfig=Development", ` + "-ue4exe=$($unreal_engine_symlink_dir)/Engine/Binaries/Win64/UE4Editor-Cmd.exe", ` + "-pak", ` + "-prereqs", ` + "-nodebuginfo", ` + "-targetplatform=Android", ` + "-cookflavor=Multi", ` + "-build", ` + "-utf8output", ` + "-compile" + ) + + $build_server_handle = $build_server_proc.Handle + Wait-Process -InputObject $build_server_proc + + if ($build_server_proc.ExitCode -ne 0) { + Write-Log "Failed to build Android Development Client. Error: $($build_server_proc.ExitCode)" + Throw "Failed to build Android Development Client" + } + Finish-Event "build-android-client" "build-unreal-gdk-example-project-:windows:" + # Deploy the project to SpatialOS &$PSScriptRoot"\deploy.ps1" -launch_deployment "$launch_deployment" -gdk_branch_name "$gdk_branch_name" popd \ No newline at end of file diff --git a/ci/setup-and-build.sh b/ci/setup-and-build.sh new file mode 100755 index 00000000..c5f36492 --- /dev/null +++ b/ci/setup-and-build.sh @@ -0,0 +1,124 @@ +#!/usr/bin/env bash + +set -e -u -o pipefail +if [[ -n "${DEBUG-}" ]]; then + set -x +fi + +source /opt/improbable/environment + +run_uat() { + ENGINE_DIRECTORY="${1}" + EXAMPLEPROJECT_HOME="${2}" + CLIENT_CONFIG="${3}" + TARGET_PLATFORM="${4}" + ARCHIVE_DIRECTORY="${5}" + ADDITIONAL_UAT_FLAGS="${6:-}" + + ${ENGINE_DIRECTORY}/Engine/Build/BatchFiles/RunUAT.sh \ + -ScriptsForProject="${EXAMPLEPROJECT_HOME}/Game/GDKShooter.uproject" \ + BuildCookRun \ + -nocompileeditor \ + -nop4 \ + -project="${EXAMPLEPROJECT_HOME}/Game/GDKShooter.uproject" \ + -cook \ + -stage \ + -archive \ + -archivedirectory="${ARCHIVE_DIRECTORY}" \ + -package \ + -clientconfig="${CLIENT_CONFIG}" \ + -ue4exe="${EXAMPLEPROJECT_HOME}/UnrealEngine/Engine/Binaries/Mac/UE4Editor-Cmd" \ + -pak \ + -prereqs \ + -nodebuginfo \ + -targetplatform="${TARGET_PLATFORM}" \ + -build \ + -utf8output \ + -compile \ + "${ADDITIONAL_UAT_FLAGS}" +} + + +GDK_REPO="${1:-git@github.com:spatialos/UnrealGDK.git}" +GCS_PUBLISH_BUCKET="${2:-io-internal-infra-unreal-artifacts-production/UnrealEngine}" + +pushd "$(dirname "$0")" + EXAMPLEPROJECT_HOME="$(pwd)/.." + GDK_BRANCH_NAME="${GDK_BRANCH:-master}" + GDK_HOME="${EXAMPLEPROJECT_HOME}/Game/Plugins/UnrealGDK" + + echo "--- clone-gdk-plugin" + mkdir -p "${EXAMPLEPROJECT_HOME}/Game/Plugins" + pushd "${EXAMPLEPROJECT_HOME}/Game/Plugins/" + git clone ${GDK_REPO} \ + --branch ${GDK_BRANCH_NAME} \ + --single-branch \ + --depth 1 + popd + + echo "--- print-head-gdk-commit" + pushd "${GDK_HOME}" + GDK_COMMIT_HASH=$(git rev-parse HEAD | cut -c1-6) + echo "GDK at commit: ${GDK_COMMIT_HASH} on branch ${GDK_BRANCH_NAME}" + popd + + echo "--- set-up-gdk-plugin" + "${GDK_HOME}/Setup.sh" --mobile + + echo "--- set-up-engine" + ENGINE_DIRECTORY="${EXAMPLEPROJECT_HOME}/UnrealEngine" + "${GDK_HOME}/ci/get-engine.sh" \ + "${ENGINE_DIRECTORY}" \ + "${GCS_PUBLISH_BUCKET}" + + pushd "${ENGINE_DIRECTORY}" + echo "--- create-xcode-project" + Engine/Build/BatchFiles/Mac/Build.sh \ + -projectfiles \ + -project="${EXAMPLEPROJECT_HOME}/Game/GDKShooter.uproject" \ + -game \ + -engine \ + -progress + + echo "--- build-unreal-editor" + Engine/Build/BatchFiles/Mac/XcodeBuild.sh \ + GDKShooterEditor \ + Mac \ + Development \ + "${EXAMPLEPROJECT_HOME}/Game/GDKShooter.uproject" + + echo "--- generate-schema" + pushd "Engine/Binaries/Mac" + UE4Editor.app/Contents/MacOS/UE4Editor \ + "${EXAMPLEPROJECT_HOME}/Game/GDKShooter.uproject" \ + -run=CookAndGenerateSchema \ + -targetplatform=MacNoEditor \ + -SkipShaderCompile \ + -unversioned \ + -map="/Maps/FPS-Start_Small" + + UE4Editor.app/Contents/MacOS/UE4Editor \ + "${EXAMPLEPROJECT_HOME}/Game/GDKShooter.uproject" \ + -run=GenerateSchemaAndSnapshots \ + -MapPaths="/Maps/FPS-Start_Small" \ + -SkipSchema + popd + popd + + echo "--- build-mac-client" + run_uat \ + "${ENGINE_DIRECTORY}" \ + "${EXAMPLEPROJECT_HOME}" \ + "Development" \ + "Mac" \ + "${EXAMPLEPROJECT_HOME}/cooked-mac" \ + "-iterative" + + echo "--- build-ios-client" + run_uat \ + "${ENGINE_DIRECTORY}" \ + "${EXAMPLEPROJECT_HOME}" \ + "Development" \ + "IOS" \ + "${EXAMPLEPROJECT_HOME}/cooked-ios" +popd diff --git a/ci/slack-notify.ps1 b/ci/slack-notify.ps1 index b2051bba..cdaee908 100644 --- a/ci/slack-notify.ps1 +++ b/ci/slack-notify.ps1 @@ -9,7 +9,7 @@ $gdk_commit_hash = buildkite-agent meta-data get "gdk_commit_hash" # Send a Slack notification with a link to the new deployment and to the build. Start-Event "slack-notify" "slack-notify" # Build Slack text - if ($env:BUILDKITE_NIGHTLY_BUILD -eq "true") { + if ($env:NIGHTLY_BUILD -eq "true") { $slack_text = ":night_with_stars: Nightly build of *Example Project* succeeded." } else { $slack_text = "*Example Project* build by $env:BUILDKITE_BUILD_CREATOR succeeded." diff --git a/fastlane/Matchfile b/fastlane/Matchfile new file mode 100644 index 00000000..0b05372c --- /dev/null +++ b/fastlane/Matchfile @@ -0,0 +1,9 @@ +git_url("git@github.com:improbable/apple-codesigning.git") +storage_mode("git") +type("development") +app_identifier("io.improbable.*") +keychain_name("login.keychain") +username("imp-apple-dev@improbable.io") + +# For all available options run `fastlane match --help` +# The docs are available on https://docs.fastlane.tools/actions/match diff --git a/spatial/workers/improbable/spatialos.SimulatedPlayerCoordinator.worker.json b/spatial/workers/improbable/spatialos.SimulatedPlayerCoordinator.worker.json index e2f5dd4d..ca0c9fec 100644 --- a/spatial/workers/improbable/spatialos.SimulatedPlayerCoordinator.worker.json +++ b/spatial/workers/improbable/spatialos.SimulatedPlayerCoordinator.worker.json @@ -39,13 +39,14 @@ "${IMPROBABLE_RECEPTIONIST_PORT}", "${IMPROBABLE_WORKER_ID}", "coordinator_start_delay_millis=10000", - + + "connect.to.spatialos", "+workerType", "UnrealClient", - "+loginToken", - "", - "+playerIdentityToken", - "", + "+deployment", + "", + "+devAuthToken", + "", "+workerId", "", "+useExternalIpForBridge",