Skip to content

Commit

Permalink
Merge pull request #178 from spatialos/0.10.0-rc
Browse files Browse the repository at this point in the history
Release 0.10.0
  • Loading branch information
gdk-for-unreal-bot authored Jul 8, 2020
2 parents c8ba083 + d0c86fa commit 96d2e88
Show file tree
Hide file tree
Showing 170 changed files with 1,038 additions and 575 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
**/Intermediate/
**/Saved/

# Built data for maps
*_BuiltData.uasset

# SpatialOS files
logs
build/
Expand Down
2 changes: 1 addition & 1 deletion DeployGame.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set deploymentname=%gamename%%formatdate%
cd spatial/
spatial build build-config || goto :error
spatial cloud upload %deploymentname% --force || goto :error
spatial cloud launch %deploymentname% one_worker_test.json %deploymentname% --snapshot=snapshots/default.snapshot --cluster_region=eu || goto :error
spatial cloud launch %deploymentname% one_worker_test.json %deploymentname% --snapshot=snapshots/default.snapshot --cluster_region=eu --runtime_version=0.4.3 || goto :error
spatial project deployment tags add %deploymentname% dev_login || goto :error
spatial project deployment tags add %deploymentname% status_lobby || goto :error

Expand Down
10 changes: 5 additions & 5 deletions Game/Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/Maps/Deployments.Deployments
EditorStartupMap=/Game/Maps/FPS-Start_Tiny.FPS-Start_Tiny
GlobalDefaultGameMode=/Game/GameMode/BP_DeathmatchGameMode.BP_DeathmatchGameMode_C
GameInstanceClass=/Script/SpatialGDK.SpatialGameInstance
GameDefaultMap=/Engine/Maps/Entry.Entry
EditorStartupMap=/Game/Maps/Control_Small.Control_Small
GlobalDefaultGameMode=/Game/GameMode/BP_ControlGameMode.BP_ControlGameMode_C
GameInstanceClass=/Game/GameMode/BP_GDKShooterGameInstance.BP_GDKShooterGameInstance_C
GlobalDefaultServerGameMode=None
ServerDefaultMap=/Game/Maps/FPS-Start_Medium.FPS-Start_Medium
ServerDefaultMap=/Game/Maps/Control_Small.Control_Small

[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
MinimumiOSVersion=IOS_11
Expand Down
8 changes: 5 additions & 3 deletions Game/Config/DefaultGame.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ ProjectName=SpatialOS Unreal GDK Shooter
CopyrightNotice=Copyright (c) Improbable Worlds Ltd, All Rights Reserved
bSpatialNetworking=True

[/Script/UnrealEd.ProjectPackagingSettings]
+DirectoriesToAlwaysCook=(Path="Spatial")

[/Script/Engine.RendererSettings]
r.LightPropagationVolume = 1

[/Script/Engine.GameSession]
MaxPlayers=100
MaxSpectators=100

[/Script/UnrealEd.ProjectPackagingSettings]
+MapsToCook=(FilePath="/Game/Maps/Control_Medium")
+MapsToCook=(FilePath="/Game/Maps/Control_Small")
+DirectoriesToAlwaysCook=(Path="/Game/Spatial")
2 changes: 1 addition & 1 deletion Game/Config/DefaultSpatialGDKSettings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ UdpServerUpstreamUpdateIntervalMS=1
UdpServerDownstreamUpdateIntervalMS=1
UdpClientUpstreamUpdateIntervalMS=1
UdpClientDownstreamUpdateIntervalMS=1
SpatialDebugger=BlueprintGeneratedClass'/Game/Blueprints/LoadBalancing/BP_VerboseSpatialDebugger.BP_VerboseSpatialDebugger_C'
SpatialDebugger=None

Binary file removed Game/Content/AI/BB_NPC.uasset
Binary file not shown.
Binary file added Game/Content/AI/BB_Wander.uasset
Binary file not shown.
Binary file modified Game/Content/AI/BT_Wander.uasset
Binary file not shown.
Binary file added Game/Content/Blueprints/BP_ControlPoint.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Game/Content/Blueprints/NPCs/BB_NPC.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Game/Content/Blueprints/NPCs/BT_NPC.uasset
Binary file not shown.
Binary file not shown.
Binary file added Game/Content/Blueprints/NPCs/NPCSpawner.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Game/Content/Blueprints/NPCs/PatrolPoint.uasset
Binary file not shown.
Binary file modified Game/Content/Characters/BP_Base_Character.uasset
Binary file not shown.
Binary file removed Game/Content/Characters/BP_CrashBot.uasset
Binary file not shown.
Binary file not shown.
Binary file modified Game/Content/Characters/BP_FPS_Character.uasset
Binary file not shown.
Binary file modified Game/Content/Characters/BP_SimulatedPlayerCharacter.uasset
Binary file not shown.
Binary file modified Game/Content/Characters/Components/BP_FloatingCombatText.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Game/Content/Controllers/BP_GDK_PlayerController.uasset
Binary file not shown.
Binary file modified Game/Content/Controllers/BP_SimulatedPlayerAIController.uasset
Binary file not shown.
Binary file not shown.
Binary file added Game/Content/Environment/TeamPlayerStart.uasset
Binary file not shown.
Binary file added Game/Content/GameMode/BP_ControlGameMode.uasset
Binary file not shown.
Binary file added Game/Content/GameMode/BP_ControlGameState.uasset
Binary file not shown.
Binary file removed Game/Content/GameMode/BP_CorridorGameMode.uasset
Binary file not shown.
Binary file removed Game/Content/GameMode/BP_CorridorGameState.uasset
Binary file not shown.
Binary file removed Game/Content/GameMode/BP_DeathmatchGameMode.uasset
Binary file not shown.
Binary file modified Game/Content/GameMode/BP_DeathmatchGameState.uasset
Binary file not shown.
Binary file removed Game/Content/GameMode/BP_DeploymentGameMode.uasset
Binary file not shown.
Binary file not shown.
Binary file removed Game/Content/GameMode/BP_GymGameMode.uasset
Binary file not shown.
Binary file removed Game/Content/GameMode/BP_GymGameState.uasset
Binary file not shown.
Binary file modified Game/Content/GameMode/BP_PlayerState.uasset
Binary file not shown.
Binary file not shown.
Binary file added Game/Content/Maps/Control_Medium.umap
Binary file not shown.
Binary file added Game/Content/Maps/Control_Small.umap
Binary file not shown.
Binary file removed Game/Content/Maps/Corridor_Gym.umap
Binary file not shown.
Binary file removed Game/Content/Maps/Corridor_Gym_BuiltData.uasset
Binary file not shown.
Binary file removed Game/Content/Maps/CrashBot_Gym.umap
Binary file not shown.
Binary file removed Game/Content/Maps/CrashBot_Gym_BuiltData.uasset
Binary file not shown.
Binary file removed Game/Content/Maps/Deployments.umap
Binary file not shown.
Binary file removed Game/Content/Maps/FPS-Start_Large.umap
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Game/Content/Maps/FPS-Start_Medium.umap
Binary file not shown.
Binary file not shown.
Binary file removed Game/Content/Maps/FPS-Start_Small.umap
Binary file not shown.
Binary file removed Game/Content/Maps/FPS-Start_SmallTown.umap
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Game/Content/Maps/FPS-Start_Tiny.umap
Binary file not shown.
Binary file not shown.
Binary file removed Game/Content/Maps/FPS_Test_Gym_01.umap
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Game/Content/UI/Blueprints/BP_GDK_HUD.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Game/Content/UI/Blueprints/BP_HUD_Deathmatch.uasset
Binary file not shown.
Binary file removed Game/Content/UI/Blueprints/BP_HUD_Gym.uasset
Binary file not shown.
Binary file not shown.
Binary file modified Game/Content/UI/Blueprints/BP_RespawnMenu.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Game/Content/UI/Blueprints/Scores/BP_ScoreTableWidget.uasset
Binary file not shown.
Binary file not shown.
Binary file removed Game/Content/UI/Textures/UI_T_Text_Back.uasset
Binary file not shown.
Binary file removed Game/Content/UI/Textures/UI_T_Text_Browse.uasset
Binary file not shown.
Binary file removed Game/Content/UI/Textures/UI_T_Text_Connecting.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Game/Content/UI/Textures/UI_T_Text_Join.uasset
Binary file not shown.
Binary file removed Game/Content/UI/Textures/UI_T_Text_Join_Game.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Game/Content/UI/Textures/UI_T_Text_Quick_Join.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ void UHealthComponent::TakeDamage(float Damage, const FDamageEvent& DamageEvent,
if (InstigatorPlayerState != nullptr)
{
InstigatorPlayerId = InstigatorPlayerState->PlayerId;
if (const UTeamComponent* TeamComponent = InstigatorPlayerState->FindComponentByClass<UTeamComponent>())
{
InstigatorTeamId = TeamComponent->GetTeam();
}
}
}
if (IGenericTeamAgentInterface* InstgatorTeam = Cast<IGenericTeamAgentInterface>(EventInstigator))
Expand Down Expand Up @@ -157,6 +161,8 @@ void UHealthComponent::TakeDamage(float Damage, const FDamageEvent& DamageEvent,
{
GetOwner()->GetWorldTimerManager().SetTimer(ArmourRegenerationHandle, this, &UHealthComponent::RegenerateArmour, ArmourRegenInterval, true, ArmourRegenCooldown);
}

AuthoritativeDamage.Broadcast(EventInstigator);
}
}

Expand Down Expand Up @@ -214,7 +220,7 @@ void UHealthComponent::OnRep_CurrentHealth()
}
}

void UHealthComponent::MulticastDamageTaken_Implementation(float Value, FVector Source, FVector Impact, int32 PlayerId, FGenericTeamId TeamId)
void UHealthComponent::MulticastDamageTaken_Implementation(float Value, FVector Source, FVector Impact, int32 InstigatorPlayerId, FGenericTeamId InstigatorTeamId)
{
DamageTaken.Broadcast(Value, Source, Impact, PlayerId, TeamId);
DamageTaken.Broadcast(Value, Source, Impact, InstigatorPlayerId, InstigatorTeamId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ void UTeamComponent::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLi

bool UTeamComponent::CanDamageActor(AActor* OtherActor)
{
if (!IsValid(OtherActor))
{
return false;
}

if (bAllowFriendlyFire)
{
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ void UControllerEventsComponent::Death_Implementation(const AController* Killer)
{
ClientInformOfDeath(KillerPlayerState->GetPlayerName(), KillerPlayerState->PlayerId);
}
else
{
ClientInformOfDeath(TEXT("") /*PlayerName*/, -1 /*PlayerID*/);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@ UTeamSettingComponent::UTeamSettingComponent()
PrimaryComponentTick.bCanEverTick = false;
}

void UTeamSettingComponent::BeginPlay()
void UTeamSettingComponent::UpdateTeam(FGenericTeamId InTeamId)
{
Super::BeginPlay();
TeamId = InTeamId;
if (AAIController* OwningController = Cast<AAIController>(GetOwner()))
{
OwningController->SetGenericTeamId(TeamId);
}
else
else
{
UE_LOG(LogGDK, Error, TEXT("TeamSettingComponent is designed to work with AIControllers, will not work with %s"), *GetOwner()->GetName());
}
}

void UTeamSettingComponent::BeginPlay()
{
Super::BeginPlay();
UpdateTeam(TeamId);
}

This file was deleted.

52 changes: 52 additions & 0 deletions Game/Source/GDKShooter/Private/GDKShooterFunctionLibrary.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) Improbable Worlds Ltd, All Rights Reserved

#include "GDKShooterFunctionLibrary.h"
#include "GameFramework/Pawn.h"
#include "Perception/AIPerceptionStimuliSourceComponent.h"


void UGDKShooterFunctionLibrary::SetGenericTeamId(AActor* Actor, FGenericTeamId NewTeamId)
{
IGenericTeamAgentInterface* TeamAgentActor = Cast<IGenericTeamAgentInterface>(Actor);
IGenericTeamAgentInterface* TeamAgentController = nullptr;
if (APawn* AsPawn = Cast<APawn>(Actor))
{
TeamAgentController = Cast<IGenericTeamAgentInterface>(AsPawn->GetController());
}

if (TeamAgentActor != nullptr)
{
TeamAgentActor->SetGenericTeamId(NewTeamId);
}

if (TeamAgentController != nullptr)
{
TeamAgentController->SetGenericTeamId(NewTeamId);
}

if (UAIPerceptionStimuliSourceComponent* PerceptionStimuli = Actor->FindComponentByClass<UAIPerceptionStimuliSourceComponent>())
{
PerceptionStimuli->UnregisterFromPerceptionSystem();
PerceptionStimuli->RegisterWithPerceptionSystem();
}
}

FGenericTeamId UGDKShooterFunctionLibrary::GetGenericTeamId(AActor* Actor)
{
IGenericTeamAgentInterface* TeamAgent = Cast<IGenericTeamAgentInterface>(Actor);

if (TeamAgent == nullptr)
{
if (APawn* AsPawn = Cast<APawn>(Actor))
{
TeamAgent = Cast<IGenericTeamAgentInterface>(AsPawn->GetController());
}
}

if (TeamAgent != nullptr)
{
return TeamAgent->GetGenericTeamId();
}

return FGenericTeamId::NoTeam;
}
Loading

0 comments on commit 96d2e88

Please sign in to comment.