Files
UnrealEngineUWP/Engine/Source/Developer/GameplayDebugger/Private/GameplayDebuggingComponent.cpp

1621 lines
50 KiB
C++
Raw Normal View History

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "GameplayDebuggerPrivate.h"
#include "Net/UnrealNetwork.h"
#include "DebugRenderSceneProxy.h"
#include "AI/Navigation/RecastNavMeshGenerator.h"
#include "NavMeshRenderingHelpers.h"
#include "AI/Navigation/NavigationSystem.h"
#include "EnvironmentQuery/EnvQueryTypes.h"
#include "EnvironmentQuery/EnvQueryManager.h"
#include "EnvironmentQuery/EQSRenderingComponent.h"
#include "EnvironmentQuery/EnvQueryTest.h"
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
#include "BehaviorTree/BlackboardComponent.h"
#include "BehaviorTree/BehaviorTreeComponent.h"
#include "AbilitySystemComponent.h"
#include "AIController.h"
#include "BrainComponent.h"
#include "BehaviorTreeDelegates.h"
#include "GameFramework/PlayerState.h"
#include "GameFramework/Character.h"
#include "GameFramework/CharacterMovementComponent.h"
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
#include "Engine/Channel.h"
#include "Animation/AnimMontage.h"
#include "GameplayAbilitiesModule.h"
#include "Perception/AIPerceptionComponent.h"
#if WITH_EDITOR
#include "Editor/EditorEngine.h"
#include "GeomTools.h"
#endif // WITH_EDITOR
#include "GameplayDebuggingComponent.h"
//----------------------------------------------------------------------//
// Composite Scene proxy
//----------------------------------------------------------------------//
class FDebugRenderSceneCompositeProxy : public FDebugRenderSceneProxy
{
public:
FDebugRenderSceneCompositeProxy(const UPrimitiveComponent* InComponent)
: FDebugRenderSceneProxy(InComponent)
{
}
virtual ~FDebugRenderSceneCompositeProxy()
{
for (int32 Index = 0; Index < ChildProxies.Num(); ++Index)
{
delete ChildProxies[Index];
}
}
virtual void DrawStaticElements(FStaticPrimitiveDrawInterface* PDI) override
{
for (int32 Index = 0; Index < ChildProxies.Num(); ++Index)
{
ChildProxies[Index]->DrawStaticElements(PDI);
}
}
virtual void GetDynamicMeshElements(const TArray<const FSceneView*>& Views, const FSceneViewFamily& ViewFamily, uint32 VisibilityMap, FMeshElementCollector& Collector) const override
{
for (int32 Index = 0; Index < ChildProxies.Num(); ++Index)
{
ChildProxies[Index]->GetDynamicMeshElements(Views, ViewFamily, VisibilityMap, Collector);
}
}
virtual void RegisterDebugDrawDelgate() override
{
for (int32 Index = 0; Index < ChildProxies.Num(); ++Index)
{
ChildProxies[Index]->RegisterDebugDrawDelgate();
}
}
virtual void UnregisterDebugDrawDelgate() override
{
for (int32 Index = 0; Index < ChildProxies.Num(); ++Index)
{
ChildProxies[Index]->UnregisterDebugDrawDelgate();
}
}
virtual FPrimitiveViewRelevance GetViewRelevance(const FSceneView* View) const override
{
FPrimitiveViewRelevance Result;
for (int32 Index = 0; Index < ChildProxies.Num(); ++Index)
{
Result |= ChildProxies[Index]->GetViewRelevance(View);
}
return Result;
}
virtual uint32 GetMemoryFootprint( void ) const override
{
return sizeof( *this ) + GetAllocatedSize();
}
uint32 GetAllocatedSize( void ) const
{
uint32 Size = 0;
for (int32 Index = 0; Index < ChildProxies.Num(); ++Index)
{
ChildProxies[Index]->GetMemoryFootprint();
}
return Size + ChildProxies.GetAllocatedSize();
}
void AddChild(FDebugRenderSceneProxy* NewChild)
{
ChildProxies.AddUnique(NewChild);
}
protected:
TArray<FDebugRenderSceneProxy*> ChildProxies;
};
//----------------------------------------------------------------------//
// UGameplayDebuggingComponent
//----------------------------------------------------------------------//
FName UGameplayDebuggingComponent::DefaultComponentName = TEXT("GameplayDebuggingComponent");
FOnDebuggingTargetChanged UGameplayDebuggingComponent::OnDebuggingTargetChangedDelegate;
UGameplayDebuggingComponent::UGameplayDebuggingComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, bDrawEQSLabels(true)
, bDrawEQSFailedItems(true)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
DebugComponentClassName = TEXT("/Script/GameplayDebugger.GameplayDebuggingComponent");
PrimaryComponentTick.bCanEverTick = true;
bWantsInitializeComponent = true;
bAutoActivate = false;
PrimaryComponentTick.bStartWithTickEnabled = false;
LastStoredPathTimeStamp = -1.f;
ShowExtendedInformatiomCounter = 0;
#if WITH_EDITOR
bWasSelectedInEditor = false;
#endif
bHiddenInGame = false;
bEnabledTargetSelection = false;
bEnableClientEQSSceneProxy = false;
NextTargrtSelectionTime = 0;
ReplicateViewDataCounters.Init(0, EAIDebugDrawDataView::MAX);
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
AGameplayDebuggingReplicator* Replicator = Cast<AGameplayDebuggingReplicator>(GetOwner());
if (Replicator)
{
Replicator->OnCycleDetailsView.AddUObject(this, &UGameplayDebuggingComponent::OnCycleDetailsView);
FGameplayDebuggerSettings Settings = GameplayDebuggerSettings(Replicator);
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2799478 on 2015/12/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added Dev Stream custom versions. - Each stream now has its own custom version - Developers working in a stream should only modify their respective version Change 2789867 on 2015/12/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealHeaderTool plugins no longer need to be a separate plugin and don't require UnrealHeaderTool source code changes to work. - Merged ScriptGeneratorPlugin with ScriptPlugin - Introduced the concept of UHT plugin support for plugins so that UHT's source files don't need to be modified to make it work with external plugins - Added RuntimeNoProgram module type (module that can be used at runtime but not by program targets). - Fixed logic with project file path setting in the engine. It will no longer try to crate a full path from an already rooted path. Change 2796114 on 2015/12/09 by Steve.Robb@Dev-Core TEnumRange - enabled ranged-based for iteration over enum values. Change 2789843 on 2015/12/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 More thorough way of verifying GC cluster assumptions. Change 2794221 on 2015/12/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't merge GC clusters by default Change 2797824 on 2015/12/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the option to load all symbols for stack walking in non-monolithic builds. Change 2790539 on 2015/12/04 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec Stats/Profiler - Better handling for live connection, using the same path as file profiles, added FStatsLoadedState to separate runtime stats state from the loaded one Change 2794183 on 2015/12/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Always reset events when returning them to pool. Change 2794406 on 2015/12/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Fixing -unversioned flag being completely ignored when cooking Change 2794563 on 2015/12/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Making sure string referenced assets don't get cooked if referenced by editor-only properties. Change 2795124 on 2015/12/08 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec Profiler - Fixed bad data in min/max/avg inclusive times, added min/max/avg num calls, fixed event graph tooltip not displaying correct values Change 2796208 on 2015/12/09 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec Profiler - Remove support for multiple instances in the profiler (game thread is always visible, a few crash fixes, cleaned code a bit) Change 2797658 on 2015/12/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Allocation verification helpers. Helps with tracking down memory stomps, freeing the same pointers multiple times. Change 2797699 on 2015/12/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fix incorrect asset loading in Cooked game data (by bozaro) PR #1844 Change 2798173 on 2015/12/10 by Steve.Robb@Dev-Core Migration of Fortnite to use engine's TEnumRange. Change 2798217 on 2015/12/10 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec PR #1331 [Core] Added a stomp allocator that allows finding memory overruns, underruns, and read/write after free. (Contributed by Pablo Zurita) Change 2799605 on 2015/12/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing a crash when cancelling async loading caused by detaching linker from objects that had RF_NeedLoad flag set. Change 2799849 on 2015/12/11 by Steve.Robb@Dev-Core Migration of Ocean to use engine's TEnumRange. Change 2803144 on 2015/12/15 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Changed export tagging archive to also serialize class default objects using the normal Serialize path so that it can collect all custom versions used by exports. Change 2803206 on 2015/12/15 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec #jira UE-24177 Audit ôshippingö defines in engine Change 2804868 on 2015/12/16 by Steve.Robb@Dev-Core Removal of stats from MallocBinned2, to be readded later. #lockdown Nick.Penwarden [CL 2805158 by Robert Manuszewski in Main branch]
2015-12-16 11:52:36 -05:00
for (EAIDebugDrawDataView::Type View : TEnumRange<EAIDebugDrawDataView::Type>())
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2799478 on 2015/12/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added Dev Stream custom versions. - Each stream now has its own custom version - Developers working in a stream should only modify their respective version Change 2789867 on 2015/12/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealHeaderTool plugins no longer need to be a separate plugin and don't require UnrealHeaderTool source code changes to work. - Merged ScriptGeneratorPlugin with ScriptPlugin - Introduced the concept of UHT plugin support for plugins so that UHT's source files don't need to be modified to make it work with external plugins - Added RuntimeNoProgram module type (module that can be used at runtime but not by program targets). - Fixed logic with project file path setting in the engine. It will no longer try to crate a full path from an already rooted path. Change 2796114 on 2015/12/09 by Steve.Robb@Dev-Core TEnumRange - enabled ranged-based for iteration over enum values. Change 2789843 on 2015/12/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 More thorough way of verifying GC cluster assumptions. Change 2794221 on 2015/12/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't merge GC clusters by default Change 2797824 on 2015/12/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the option to load all symbols for stack walking in non-monolithic builds. Change 2790539 on 2015/12/04 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec Stats/Profiler - Better handling for live connection, using the same path as file profiles, added FStatsLoadedState to separate runtime stats state from the loaded one Change 2794183 on 2015/12/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Always reset events when returning them to pool. Change 2794406 on 2015/12/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Fixing -unversioned flag being completely ignored when cooking Change 2794563 on 2015/12/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Making sure string referenced assets don't get cooked if referenced by editor-only properties. Change 2795124 on 2015/12/08 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec Profiler - Fixed bad data in min/max/avg inclusive times, added min/max/avg num calls, fixed event graph tooltip not displaying correct values Change 2796208 on 2015/12/09 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec Profiler - Remove support for multiple instances in the profiler (game thread is always visible, a few crash fixes, cleaned code a bit) Change 2797658 on 2015/12/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Allocation verification helpers. Helps with tracking down memory stomps, freeing the same pointers multiple times. Change 2797699 on 2015/12/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fix incorrect asset loading in Cooked game data (by bozaro) PR #1844 Change 2798173 on 2015/12/10 by Steve.Robb@Dev-Core Migration of Fortnite to use engine's TEnumRange. Change 2798217 on 2015/12/10 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec PR #1331 [Core] Added a stomp allocator that allows finding memory overruns, underruns, and read/write after free. (Contributed by Pablo Zurita) Change 2799605 on 2015/12/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing a crash when cancelling async loading caused by detaching linker from objects that had RF_NeedLoad flag set. Change 2799849 on 2015/12/11 by Steve.Robb@Dev-Core Migration of Ocean to use engine's TEnumRange. Change 2803144 on 2015/12/15 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Changed export tagging archive to also serialize class default objects using the normal Serialize path so that it can collect all custom versions used by exports. Change 2803206 on 2015/12/15 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec #jira UE-24177 Audit ôshippingö defines in engine Change 2804868 on 2015/12/16 by Steve.Robb@Dev-Core Removal of stats from MallocBinned2, to be readded later. #lockdown Nick.Penwarden [CL 2805158 by Robert Manuszewski in Main branch]
2015-12-16 11:52:36 -05:00
ReplicateViewDataCounters[View] = Settings.CheckFlag(View);
}
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
}
#endif
}
void UGameplayDebuggingComponent::Activate(bool bReset)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
Super::Activate(bReset);
SetComponentTickEnabled(true);
SetIsReplicated(true);
ActivationCounter++;
#else
Super::Activate(bReset);
#endif
}
void UGameplayDebuggingComponent::Deactivate()
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
Super::Deactivate();
SetComponentTickEnabled(false);
SetIsReplicated(false);
#else
Super::Deactivate();
#endif
}
void UGameplayDebuggingComponent::OnRep_ActivationCounter()
{
// make sure that tick function is running, can't select actor to debug without it
// if first activation (UActorComponent) comes before tick function is registered, state will be overridden by bStartWithTickEnabled (false)
SetComponentTickEnabled(true);
}
void UGameplayDebuggingComponent::GetLifetimeReplicatedProps( TArray< FLifetimeProperty > & OutLifetimeProps ) const
{
Super::GetLifetimeReplicatedProps( OutLifetimeProps );
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
DOREPLIFETIME(UGameplayDebuggingComponent, ReplicateViewDataCounters);
DOREPLIFETIME(UGameplayDebuggingComponent, ShowExtendedInformatiomCounter);
DOREPLIFETIME(UGameplayDebuggingComponent, ControllerName)
DOREPLIFETIME(UGameplayDebuggingComponent, PawnName);
DOREPLIFETIME(UGameplayDebuggingComponent, DebugIcon);
DOREPLIFETIME(UGameplayDebuggingComponent, PawnClass);
DOREPLIFETIME(UGameplayDebuggingComponent, ActivationCounter);
DOREPLIFETIME(UGameplayDebuggingComponent, bIsUsingCharacter);
DOREPLIFETIME(UGameplayDebuggingComponent, MovementBaseInfo);
DOREPLIFETIME(UGameplayDebuggingComponent, MovementModeInfo);
DOREPLIFETIME(UGameplayDebuggingComponent, MontageInfo);
DOREPLIFETIME(UGameplayDebuggingComponent, bIsUsingPathFollowing);
DOREPLIFETIME(UGameplayDebuggingComponent, PathFollowingInfo);
DOREPLIFETIME(UGameplayDebuggingComponent, NavDataInfo);
DOREPLIFETIME(UGameplayDebuggingComponent, PathPoints);
DOREPLIFETIME(UGameplayDebuggingComponent, PathCorridorData);
DOREPLIFETIME(UGameplayDebuggingComponent, NextPathPointIndex);
DOREPLIFETIME(UGameplayDebuggingComponent, bIsUsingBehaviorTree);
DOREPLIFETIME(UGameplayDebuggingComponent, CurrentAITask);
DOREPLIFETIME(UGameplayDebuggingComponent, CurrentAIState);
DOREPLIFETIME(UGameplayDebuggingComponent, CurrentAIAssets);
DOREPLIFETIME(UGameplayDebuggingComponent, GameplayTasksState);
DOREPLIFETIME(UGameplayDebuggingComponent, bIsUsingAbilities);
DOREPLIFETIME(UGameplayDebuggingComponent, AbilityInfo);
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
DOREPLIFETIME(UGameplayDebuggingComponent, BrainComponentName);
DOREPLIFETIME(UGameplayDebuggingComponent, BrainComponentString);
DOREPLIFETIME(UGameplayDebuggingComponent, BlackboardRepData);
DOREPLIFETIME(UGameplayDebuggingComponent, NavmeshRepData);
DOREPLIFETIME(UGameplayDebuggingComponent, TargetActor);
DOREPLIFETIME(UGameplayDebuggingComponent, EQSRepData);
DOREPLIFETIME(UGameplayDebuggingComponent, SensingComponentLocation);
DOREPLIFETIME(UGameplayDebuggingComponent, PerceptionLegend)
DOREPLIFETIME(UGameplayDebuggingComponent, DistanceFromPlayer);
DOREPLIFETIME(UGameplayDebuggingComponent, DistanceFromSensor);
DOREPLIFETIME(UGameplayDebuggingComponent, SensingComponentLocation);
DOREPLIFETIME(UGameplayDebuggingComponent, PerceptionShapeElements);
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
bool UGameplayDebuggingComponent::ClientEnableTargetSelection_Validate(bool bEnable)
{
return true;
}
void UGameplayDebuggingComponent::ClientEnableTargetSelection_Implementation(bool bEnable)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
bEnabledTargetSelection = bEnable;
if (bEnabledTargetSelection && World && World->GetNetMode() != NM_DedicatedServer)
{
NextTargrtSelectionTime = 0;
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::SetActorToDebug(AActor* Actor)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (TargetActor != Actor)
{
MarkRenderStateDirty();
}
TargetActor = Actor;
EQSLocalData.Reset();
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (World && World->GetNetMode() != NM_DedicatedServer)
{
if (bEnabledTargetSelection)
{
AGameplayDebuggingReplicator* Replicator = Cast<AGameplayDebuggingReplicator>(GetOwner());
if (Replicator)
{
if (Replicator->GetLocalPlayerOwner())
{
SelectTargetToDebug();
}
}
}
}
if (World && World->GetNetMode() < NM_Client)
{
CollectDataToReplicate(true);
}
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::SelectTargetToDebug()
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
AGameplayDebuggingReplicator* Replicator = Cast<AGameplayDebuggingReplicator>(GetOwner());
UGameplayDebuggingControllerComponent* GDC = Replicator->FindComponentByClass<UGameplayDebuggingControllerComponent>();
APlayerController* MyPC = GDC && GDC->GetDebugCameraController().IsValid() ? GDC->GetDebugCameraController().Get() : Replicator->GetLocalPlayerOwner();
if (MyPC )
{
float bestAim = 0;
FVector CamLocation;
FRotator CamRotation;
check(MyPC->PlayerCameraManager != NULL);
MyPC->PlayerCameraManager->GetCameraViewPoint(CamLocation, CamRotation);
FVector FireDir = CamRotation.Vector();
UWorld* World = MyPC->GetWorld();
check( World );
APawn* PossibleTarget = NULL;
for (FConstPawnIterator Iterator = World->GetPawnIterator(); Iterator; ++Iterator )
{
APawn* NewTarget = *Iterator;
if (NewTarget == NULL || NewTarget == MyPC->GetPawn()
|| (NewTarget->PlayerState != NULL && NewTarget->PlayerState->bIsABot == false)
|| NewTarget->GetActorEnableCollision() == false)
{
continue;
}
if (NewTarget != MyPC->GetPawn())
{
// look for best controlled pawn target
const FVector AimDir = NewTarget->GetActorLocation() - CamLocation;
float FireDist = AimDir.SizeSquared();
// only find targets which are < 25000 units away
if (FireDist < 625000000.f)
{
FireDist = FMath::Sqrt(FireDist);
float newAim = FVector::DotProduct(FireDir, AimDir);
newAim = newAim / FireDist;
if (newAim > bestAim)
{
PossibleTarget = NewTarget;
bestAim = newAim;
}
}
}
}
if (PossibleTarget != NULL && PossibleTarget != GetSelectedActor())
{
if (AGameplayDebuggingReplicator* DebuggingReplicator = Cast<AGameplayDebuggingReplicator>(GetOwner()))
{
DebuggingReplicator->ServerSetActorToDebug(Cast<AActor>(PossibleTarget));
MarkRenderStateDirty();
}
ServerReplicateData(EDebugComponentMessage::ActivateReplication, EAIDebugDrawDataView::Empty);
}
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::CollectDataToReplicate(bool bCollectExtendedData)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
const AActor *SelectedActor = GetSelectedActor();
if (!SelectedActor || SelectedActor->IsPendingKill())
{
return;
}
if (ShouldReplicateData(EAIDebugDrawDataView::Basic) || ShouldReplicateData(EAIDebugDrawDataView::OverHead))
{
CollectBasicData();
}
AGameplayDebuggingReplicator* Replicator = Cast<AGameplayDebuggingReplicator>(GetOwner());
const bool bDrawFullData = Replicator->GetSelectedActorToDebug() == GetSelectedActor();
if (bDrawFullData && ShouldReplicateData(EAIDebugDrawDataView::Basic))
{
CollectPathData();
}
if (bCollectExtendedData && bDrawFullData)
{
if (ShouldReplicateData(EAIDebugDrawDataView::BehaviorTree))
{
CollectBehaviorTreeData();
}
#if WITH_EQS
if (ShouldReplicateData(EAIDebugDrawDataView::EQS))
{
bool bEnabledEnvironmentQueryEd = true;
if (GConfig)
{
GConfig->GetBool(TEXT("EnvironmentQueryEd"), TEXT("EnableEnvironmentQueryEd"), bEnabledEnvironmentQueryEd, GEngineIni);
}
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
if (bEnabledEnvironmentQueryEd)
{
CollectEQSData();
}
}
#endif // WITH_EQS
CollectPerceptionData();
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::CollectBasicData()
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
APawn* MyPawn = Cast<APawn>(GetSelectedActor());
PawnName = MyPawn->GetHumanReadableName();
PawnClass = MyPawn->GetClass()->GetName();
AAIController* MyController = Cast<AAIController>(MyPawn->Controller);
bIsUsingCharacter = MyPawn->IsA(ACharacter::StaticClass());
if (MyController)
{
if (MyController->IsPendingKill() == false)
{
ControllerName = MyController->GetName();
DebugIcon = MyController->GetDebugIcon();
CollectBasicMovementData(MyPawn);
CollectBasicPathData(MyPawn);
CollectBasicBehaviorData(MyPawn);
CollectBasicAbilityData(MyPawn);
CollectBasicAnimationData(MyPawn);
}
else
{
ControllerName = TEXT("Controller PENDING KILL");
}
}
else
{
ControllerName = TEXT("No Controller");
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::CollectBasicMovementData(APawn* MyPawn)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
UCharacterMovementComponent* CharMovement = Cast<UCharacterMovementComponent>(MyPawn->GetMovementComponent());
if (CharMovement)
{
UPrimitiveComponent* FloorComponent = MyPawn->GetMovementBase();
AActor* FloorActor = FloorComponent ? FloorComponent->GetOwner() : nullptr;
MovementBaseInfo = FloorComponent ? FString::Printf(TEXT("%s.%s"), *GetNameSafe(FloorActor), *FloorComponent->GetName()) : TEXT("None");
MovementModeInfo = CharMovement->GetMovementName();
}
else
{
MovementBaseInfo = TEXT("");
MovementModeInfo = TEXT("");
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::CollectBasicPathData(APawn* MyPawn)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
UNavigationSystem* NavSys = UNavigationSystem::GetCurrent(MyPawn->GetWorld());
AAIController* MyAIController = Cast<AAIController>(MyPawn->GetController());
const ANavigationData* NavData = NavSys ? NavSys->GetNavDataForProps(MyAIController->GetNavAgentPropertiesRef()) : nullptr;
if (NavData)
{
NavDataInfo = NavData->GetConfig().Name.ToString();
}
UPathFollowingComponent* PFC = MyAIController->GetPathFollowingComponent();
bIsUsingPathFollowing = (PFC != nullptr);
if (PFC)
{
TArray<FString> Tokens;
TArray<EPathFollowingDebugTokens::Type> Flags;
if (PFC)
{
PFC->GetDebugStringTokens(Tokens, Flags);
}
PathFollowingInfo = FString();
for (int32 Idx = 0; Idx < Tokens.Num(); Idx++)
{
switch (Flags[Idx])
{
case EPathFollowingDebugTokens::Description:
PathFollowingInfo += Tokens[Idx];
break;
case EPathFollowingDebugTokens::ParamName:
PathFollowingInfo += TEXT(", {yellow}");
PathFollowingInfo += Tokens[Idx];
PathFollowingInfo += TEXT(":");
break;
case EPathFollowingDebugTokens::PassedValue:
PathFollowingInfo += TEXT("{yellow}");
PathFollowingInfo += Tokens[Idx];
break;
case EPathFollowingDebugTokens::FailedValue:
PathFollowingInfo += TEXT("{orange}");
PathFollowingInfo += Tokens[Idx];
break;
default:
break;
}
}
}
else
{
PathFollowingInfo = TEXT("");
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::CollectBasicBehaviorData(APawn* MyPawn)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST) && ENABLE_VISUAL_LOG
AAIController* MyAIController = Cast<AAIController>(MyPawn->GetController());
UBehaviorTreeComponent* BTC = MyAIController ? Cast<UBehaviorTreeComponent>(MyAIController->BrainComponent) : nullptr;
bIsUsingBehaviorTree = (BTC != nullptr);
if (BTC)
{
CurrentAITask = BTC->DescribeActiveTasks();
CurrentAIState = BTC->IsRunning() ? TEXT("Running") : BTC->IsPaused() ? TEXT("Paused") : TEXT("Inactive");
CurrentAIAssets = BTC->DescribeActiveTrees();
}
else
{
CurrentAITask = TEXT("");
CurrentAIState = TEXT("");
CurrentAIAssets = TEXT("");
}
UGameplayTasksComponent* GTComponent = MyPawn->FindComponentByClass<UGameplayTasksComponent>();
if (GTComponent)
{
GameplayTasksState = FString::Printf(TEXT("Ticking Tasks: %s\nTask Queue: %s"), *GTComponent->GetTickingTasksDescription(), *GTComponent->GetTasksPriorityQueueDescription());
}
else
{
GameplayTasksState = TEXT("");
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::CollectBasicAbilityData(APawn* MyPawn)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (IGameplayAbilitiesModule::IsAvailable())
{
bool bUsingAbilities;
IGameplayAbilitiesModule& AbilitiesModule = FModuleManager::LoadModuleChecked<IGameplayAbilitiesModule>("GameplayAbilities");
AbilitiesModule.GetActiveAbilitiesDebugDataForActor(MyPawn, AbilityInfo, bUsingAbilities);
bIsUsingAbilities = bUsingAbilities;
}
else
{
bIsUsingAbilities = false;
AbilityInfo = TEXT("None");
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::CollectBasicAnimationData(APawn* MyPawn)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
ACharacter* MyChar = Cast<ACharacter>(MyPawn);
MontageInfo = MyChar ? GetNameSafe(MyChar->GetCurrentMontage()) : TEXT("");
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::CollectBehaviorTreeData()
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (!ShouldReplicateData(EAIDebugDrawDataView::BehaviorTree))
{
return;
}
BrainComponentName = TEXT("");
BrainComponentString = TEXT("");
APawn* MyPawn = Cast<APawn>(GetSelectedActor());
AAIController* MyController = Cast<AAIController>(MyPawn->Controller);
if (MyController != NULL && MyController->BrainComponent != NULL && MyController->IsPendingKillPending() == false)
{
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
BrainComponentName = MyController->BrainComponent != NULL ? MyController->BrainComponent->GetName() : TEXT("");
BrainComponentString = MyController->BrainComponent != NULL ? MyController->BrainComponent->GetDebugInfoString() : TEXT("");
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
BlackboardString = MyController->BrainComponent->GetBlackboardComponent() ? MyController->BrainComponent->GetBlackboardComponent()->GetDebugInfoString(EBlackboardDescription::KeyWithValue) : TEXT("");
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
if (World && World->GetNetMode() != NM_Standalone)
{
TArray<uint8> UncompressedBuffer;
FMemoryWriter ArWriter(UncompressedBuffer);
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
ArWriter << BlackboardString;
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
const int32 HeaderSize = sizeof(int32);
BlackboardRepData.Init(0, HeaderSize + FMath::TruncToInt(1.1f * UncompressedBuffer.Num()));
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
const int32 UncompressedSize = UncompressedBuffer.Num();
int32 CompressedSize = BlackboardRepData.Num() - HeaderSize;
uint8* DestBuffer = BlackboardRepData.GetData();
FMemory::Memcpy(DestBuffer, &UncompressedSize, HeaderSize);
DestBuffer += HeaderSize;
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
FCompression::CompressMemory((ECompressionFlags)(COMPRESS_ZLIB | COMPRESS_BiasMemory),
(void*)DestBuffer, CompressedSize, (void*)UncompressedBuffer.GetData(), UncompressedSize);
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
BlackboardRepData.SetNum(CompressedSize + HeaderSize, false);
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
}
}
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::OnRep_UpdateBlackboard()
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (World && World->GetNetMode() != NM_Standalone)
{
TArray<uint8> UncompressedBuffer;
int32 UncompressedSize = 0;
const int32 HeaderSize = sizeof(int32);
uint8* SrcBuffer = (uint8*)BlackboardRepData.GetData();
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
FMemory::Memcpy(&UncompressedSize, SrcBuffer, HeaderSize);
SrcBuffer += HeaderSize;
const int32 CompressedSize = BlackboardRepData.Num() - HeaderSize;
UncompressedBuffer.AddZeroed(UncompressedSize);
FCompression::UncompressMemory((ECompressionFlags)(COMPRESS_ZLIB), (void*)UncompressedBuffer.GetData(), UncompressedSize, SrcBuffer, CompressedSize);
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
FMemoryReader ArReader(UncompressedBuffer);
ArReader << BlackboardString;
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::CollectPathData()
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST) && ENABLE_VISUAL_LOG
APawn* MyPawn = Cast<APawn>(GetSelectedActor());
bool bRefreshRendering = false;
if (AAIController *MyController = Cast<AAIController>(MyPawn->Controller))
{
if (MyController->PathFollowingComponent && MyController->PathFollowingComponent->GetPath().IsValid())
{
NextPathPointIndex = MyController->PathFollowingComponent->GetNextPathIndex();
const FNavPathSharedPtr& NewPath = MyController->PathFollowingComponent->GetPath();
if (CurrentPath.HasSameObject(NewPath.Get()) == false || NewPath->GetTimeStamp() > LastStoredPathTimeStamp)
{
LastStoredPathTimeStamp = NewPath->GetTimeStamp();
FVisualLogEntry Snapshot;
NewPath->DescribeSelfToVisLog(&Snapshot);
PathCorridorPolygons.Reset(Snapshot.ElementsToDraw.Num());
FPathCorridorPolygons Polygon;
for (FVisualLogShapeElement& CurrentShape : Snapshot.ElementsToDraw)
{
if (CurrentShape.GetType() == EVisualLoggerShapeElement::Polygon)
{
Polygon.Color = CurrentShape.GetFColor();
Polygon.Points.Reset();
Polygon.Points.Append(CurrentShape.Points);
PathCorridorPolygons.Add(Polygon);
}
}
PathPoints.Reset();
for (int32 Index=0; Index < NewPath->GetPathPoints().Num(); ++Index)
{
PathPoints.Add(NewPath->GetPathPoints()[Index].Location);
}
CurrentPath = NewPath;
if (PathCorridorPolygons.Num() && World && World->GetNetMode() != NM_Client)
{
PathCorridorData.Reset();
TArray<uint8> HelpBuffer;
FMemoryWriter ArWriter(HelpBuffer);
int32 NumPolygons = PathCorridorPolygons.Num();
ArWriter << NumPolygons;
for (const FPathCorridorPolygons& CurrentPoly : PathCorridorPolygons)
{
FColor Color = CurrentPoly.Color;
ArWriter << Color;
int32 NumVerts = CurrentPoly.Points.Num();
ArWriter << NumVerts;
for (auto Vert : CurrentPoly.Points)
{
ArWriter << Vert;
}
}
PathCorridorData = HelpBuffer;
}
bRefreshRendering = true;
}
}
else
{
NextPathPointIndex = INDEX_NONE;
CurrentPath = NULL;
PathPoints.Reset();
PathCorridorPolygons.Reset();
}
}
if (bRefreshRendering && World && World->GetNetMode() != NM_DedicatedServer)
{
UpdateBounds();
MarkRenderStateDirty();
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::OnRep_PathCorridorData()
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (World && World->GetNetMode() != NM_DedicatedServer)
{
FMemoryReader ArReader(PathCorridorData);
int32 NumPolygons = 0;
ArReader << NumPolygons;
PathCorridorPolygons.Reset(NumPolygons);
for (int32 PolyIndex = 0; PolyIndex < NumPolygons; ++PolyIndex)
{
FPathCorridorPolygons Polygon;
FColor Color;
ArReader << Polygon.Color;
int32 NumVerts = 0;
ArReader << NumVerts;
for (int32 VertIndex = 0; VertIndex < NumVerts; ++VertIndex)
{
FVector CurrentVertex;
ArReader << CurrentVertex;
Polygon.Points.Add(CurrentVertex);
}
if (NumVerts > 2)
{
PathCorridorPolygons.Add(Polygon);
}
}
UpdateBounds();
MarkRenderStateDirty();
}
#endif
}
void UGameplayDebuggingComponent::EnableDebugDraw(bool bEnable, bool InFocusedComponent)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
#if WITH_EQS
EnableClientEQSSceneProxy(bEnable);
#endif // WITH_EQS
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
void UGameplayDebuggingComponent::ServerReplicateData(uint32 InMessage, uint32 InDataView)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
EDebugComponentMessage::Type Message = (EDebugComponentMessage::Type)InMessage;
EAIDebugDrawDataView::Type DataView = (EAIDebugDrawDataView::Type) InDataView;
switch (Message)
{
case EDebugComponentMessage::EnableExtendedView:
ShowExtendedInformatiomCounter++;
break;
case EDebugComponentMessage::DisableExtendedView:
ShowExtendedInformatiomCounter = FMath::Max(0, ShowExtendedInformatiomCounter - 1);
break;
case EDebugComponentMessage::ActivateReplication:
Activate();
break;
case EDebugComponentMessage::DeactivateReplilcation:
Deactivate();
break;
case EDebugComponentMessage::ActivateDataView:
if (ReplicateViewDataCounters.IsValidIndex(DataView))
{
ReplicateViewDataCounters[DataView] += 1;
}
break;
case EDebugComponentMessage::DeactivateDataView:
if (ReplicateViewDataCounters.IsValidIndex(DataView))
{
ReplicateViewDataCounters[DataView] = FMath::Max(0, ReplicateViewDataCounters[DataView] - 1);
}
break;
default:
break;
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
//////////////////////////////////////////////////////////////////////////
// EQS Data
//////////////////////////////////////////////////////////////////////////
void UGameplayDebuggingComponent::OnCycleDetailsView()
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (++CurrentEQSIndex >= EQSLocalData.Num())
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
{
CurrentEQSIndex = 0;
}
UpdateBounds();
MarkRenderStateDirty();
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
}
const FEnvQueryResult* UGameplayDebuggingComponent::GetQueryResult() const
{
return CachedQueryInstance.Get();
}
const FEnvQueryInstance* UGameplayDebuggingComponent::GetQueryInstance() const
{
return CachedQueryInstance.Get();
}
void UGameplayDebuggingComponent::OnRep_UpdateEQS()
{
#if USE_EQS_DEBUGGER
// decode scoring data
if (World && World->GetNetMode() == NM_Client)
{
TArray<uint8> UncompressedBuffer;
int32 UncompressedSize = 0;
const int32 HeaderSize = sizeof(int32);
uint8* SrcBuffer = (uint8*)EQSRepData.GetData();
FMemory::Memcpy(&UncompressedSize, SrcBuffer, HeaderSize);
SrcBuffer += HeaderSize;
const int32 CompressedSize = EQSRepData.Num() - HeaderSize;
UncompressedBuffer.AddZeroed(UncompressedSize);
FCompression::UncompressMemory((ECompressionFlags)(COMPRESS_ZLIB), (void*)UncompressedBuffer.GetData(), UncompressedSize, SrcBuffer, CompressedSize);
FMemoryReader ArReader(UncompressedBuffer);
ArReader << EQSLocalData;
}
UpdateBounds();
MarkRenderStateDirty();
#endif //USE_EQS_DEBUGGER
}
void UGameplayDebuggingComponent::CollectEQSData()
{
#if USE_EQS_DEBUGGER
if (!ShouldReplicateData(EAIDebugDrawDataView::EQS))
{
return;
}
UWorld* World = GetWorld();
UEnvQueryManager* QueryManager = World ? UEnvQueryManager::GetCurrent(World) : NULL;
const AActor* Owner = GetSelectedActor();
AGameplayDebuggingReplicator* Replicator = Cast<AGameplayDebuggingReplicator>(GetOwner());
if (QueryManager == NULL || Owner == NULL)
{
return;
}
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
auto AllQueries = QueryManager->GetDebugger().GetAllQueriesForOwner(Owner);
const class APawn* OwnerAsPawn = Cast<class APawn>(Owner);
if (OwnerAsPawn != NULL && OwnerAsPawn->GetController())
{
const auto& AllControllerQueries = QueryManager->GetDebugger().GetAllQueriesForOwner(OwnerAsPawn->GetController());
AllQueries.Append(AllControllerQueries);
}
struct FEnvQueryInfoSort
{
FORCEINLINE bool operator()(const FEQSDebugger::FEnvQueryInfo& A, const FEQSDebugger::FEnvQueryInfo& B) const
{
return (A.Timestamp < B.Timestamp);
}
};
TArray<FEQSDebugger::FEnvQueryInfo> QueriesToSort = AllQueries;
QueriesToSort.Sort(FEnvQueryInfoSort()); //sort queries by timestamp
QueriesToSort.SetNum(FMath::Min<int32>(Replicator->MaxEQSQueries, AllQueries.Num()));
for (int32 Index = AllQueries.Num() - 1; Index >= 0; --Index)
{
auto &CurrentQuery = AllQueries[Index];
if (QueriesToSort.Find(CurrentQuery) == INDEX_NONE)
{
AllQueries.RemoveAt(Index);
}
}
EQSLocalData.Reset();
for (int32 Index = 0; Index < FMath::Min<int32>(Replicator->MaxEQSQueries, AllQueries.Num()); ++Index)
{
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
EQSDebug::FQueryData* CurrentLocalData = NULL;
CachedQueryInstance = AllQueries[Index].Instance;
const float CachedTimestamp = AllQueries[Index].Timestamp;
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
if (!CurrentLocalData)
{
EQSLocalData.AddZeroed();
CurrentLocalData = &EQSLocalData[EQSLocalData.Num()-1];
}
if (CachedQueryInstance.IsValid())
{
UEnvQueryDebugHelpers::QueryToDebugData(*CachedQueryInstance, *CurrentLocalData);
}
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
CurrentLocalData->Timestamp = AllQueries[Index].Timestamp;
}
TArray<uint8> UncompressedBuffer;
FMemoryWriter ArWriter(UncompressedBuffer);
ArWriter << EQSLocalData;
const int32 UncompressedSize = UncompressedBuffer.Num();
const int32 HeaderSize = sizeof(int32);
EQSRepData.Init(0, HeaderSize + FMath::TruncToInt(1.1f * UncompressedSize));
int32 CompressedSize = EQSRepData.Num() - HeaderSize;
uint8* DestBuffer = EQSRepData.GetData();
FMemory::Memcpy(DestBuffer, &UncompressedSize, HeaderSize);
DestBuffer += HeaderSize;
FCompression::CompressMemory((ECompressionFlags)(COMPRESS_ZLIB | COMPRESS_BiasMemory), (void*)DestBuffer, CompressedSize, (void*)UncompressedBuffer.GetData(), UncompressedSize);
EQSRepData.SetNum(CompressedSize + HeaderSize, false);
if (World && World->GetNetMode() != NM_DedicatedServer)
{
OnRep_UpdateEQS();
}
#endif
}
//----------------------------------------------------------------------//
// NavMesh rendering
//----------------------------------------------------------------------//
void UGameplayDebuggingComponent::OnRep_UpdateNavmesh()
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
NavMeshBounds = FBox(FVector(-HALF_WORLD_MAX1, -HALF_WORLD_MAX1, -HALF_WORLD_MAX1), FVector(HALF_WORLD_MAX1, HALF_WORLD_MAX1, HALF_WORLD_MAX1));
UpdateBounds();
MarkRenderStateDirty();
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
}
bool UGameplayDebuggingComponent::ServerCollectNavmeshData_Validate(FVector_NetQuantize10 TargetLocation)
{
bool bIsValid = false;
#if WITH_RECAST
UNavigationSystem* NavSys = UNavigationSystem::GetCurrent(GetWorld());
bIsValid = NavSys && NavSys->GetMainNavData(FNavigationSystem::DontCreate);
#endif
return bIsValid;
}
bool UGameplayDebuggingComponent::ServerDiscardNavmeshData_Validate()
{
return true;
}
namespace NavMeshDebug
{
struct FShortVector
{
int16 X;
int16 Y;
int16 Z;
FShortVector()
:X(0), Y(0), Z(0)
{
}
FShortVector(const FVector& Vec)
: X(Vec.X)
, Y(Vec.Y)
, Z(Vec.Z)
{
}
FShortVector& operator=(const FVector& R)
{
X = R.X;
Y = R.Y;
Z = R.Z;
return *this;
}
FVector ToVector() const
{
return FVector(X, Y, Z);
}
};
struct FOffMeshLinkFlags
{
uint8 Radius : 6;
uint8 Direction : 1;
uint8 ValidEnds : 1;
};
struct FOffMeshLink
{
FShortVector Left;
FShortVector Right;
FColor Color;
union
{
FOffMeshLinkFlags PackedFlags;
uint8 ByteFlags;
};
};
struct FAreaPolys
{
TArray<int32> Indices;
FColor Color;
};
struct FTileData
{
FVector Location;
TArray<FAreaPolys> Areas;
TArray<FShortVector> Verts;
TArray<FOffMeshLink> Links;
};
}
FArchive& operator<<(FArchive& Ar, NavMeshDebug::FShortVector& ShortVector)
{
Ar << ShortVector.X;
Ar << ShortVector.Y;
Ar << ShortVector.Z;
return Ar;
}
FArchive& operator<<(FArchive& Ar, NavMeshDebug::FOffMeshLink& Data)
{
Ar << Data.Left;
Ar << Data.Right;
Ar << Data.Color.R;
Ar << Data.Color.G;
Ar << Data.Color.B;
Ar << Data.ByteFlags;
return Ar;
}
FArchive& operator<<(FArchive& Ar, NavMeshDebug::FAreaPolys& Data)
{
Ar << Data.Indices;
Ar << Data.Color.R;
Ar << Data.Color.G;
Ar << Data.Color.B;
Data.Color.A = 255;
return Ar;
}
FArchive& operator<<(FArchive& Ar, NavMeshDebug::FTileData& Data)
{
Ar << Data.Areas;
Ar << Data.Location;
Ar << Data.Verts;
Ar << Data.Links;
return Ar;
}
void UGameplayDebuggingComponent::ServerDiscardNavmeshData_Implementation()
{
NavmeshRepData.Empty();
}
FORCEINLINE bool LineInCorrectDistance(const FVector& PlayerLoc, const FVector& Start, const FVector& End, float CorrectDistance = -1)
{
const float MaxDistance = CorrectDistance > 0 ? (CorrectDistance*CorrectDistance) : ARecastNavMesh::GetDrawDistanceSq();
if ((FVector::DistSquared(Start, PlayerLoc) > MaxDistance || FVector::DistSquared(End, PlayerLoc) > MaxDistance))
{
return false;
}
return true;
}
Merging Dev->Main CL#2294650 using UE4-Fortnite-To-UE4 CL#2272587 Added "BlueprintReadWrite" to bNoneIsAllowedValue in FBlackboardKeySelector to avoid breaking any usage of it in blueprints through Break node which people were already using. That matches the usage for AllowedTypes, which is conceptually a related idea and was already set to BlueprintReadWrite. CL#2272599 Fixed crash when AI were killed in the same frame they were spawning into the world. CL#2274068 behavior tree search can be reverted, task will be aborted AFTER finding a valid replacement fix for move action crashing on pawn's death CL#2274177 fixed behavior tree's search range when there are mutliple restart requests in the same frame CL#2274359 Fixes RotateToFaceBBEntry not working correctly when focusing on an actor - the GetFocalPoint call to AIController had different behavior if you called it with a priority vs. without - with a priority we would just look at the Priorities and return the position, but that position was never being updated for Actors - without a priority we would go through all the priorities, check for an Actor, and if it existed we would return its location - while I could have just modified the RotateToFaceBBEntry call to just call GetFocusActor for the appropriate focus priority, this seems like the better fix) - solution was to make the GetFocalPoint with a focus priority work exactly like the one without the focus priority. while I would have liked to reduce the copy/paste code between the functions it didn't seem like a good idea. Also fixed Precision not considering vectors that were in the same direction (>= vs just > with the angle threshold value) CL#2274719 Fix crash related to AnimCameraActor. TTP #344968 CRASH: TAKER: If the world owner leaves the game in the middle of a Taker Soul sucking another player, the Client will crash. CL#2274988 #UE4 Proper handling of saving level assets that were created without a valid non-read only path. TTP#344899 CL#2275045 #UE4: Include "IHttpBase.h" in IHttpResponse.h since it's using a base class from there (they're truly dependent). Would be nice if this file just had the enum though. CL#2275152 TTP# 336668 Moved the input check for VOIP from the child widgets into the base SFortHUDLayer to capture that event on different screens. Removed code duplication. CL#2275528 Fixed StaticMeshComponent destruction blocking on the rendering thread instead of using the UObject async destruction interface CL#2275960 fixed behavior tree search being discarded after merge with non discardable request decorator observers will be added even after failed search CL#2276294 Added support to EQS "Dot" test for 2D dot-product AND taking absolute value of dot-product (for biasing for lateral over forward/back). They are separate options which can be used together or separately. CL#2277344 fixed BT decorator indices for abort range preview in editor CL#2277473 NavCollision settings of static mesh will persist through reimport ttp# 344853 CL#2277509 fixed multiple nodes connected to special pins in behavior tree editor CL#2278042 Fixes EQS not returning the best item when the last EQS test is a filter. - To do this, on the last test if we know it's just a filter and eventually we will use the first item that passes the test, then we sort prior to filtering. Made the filter and score test types display "Filter Only" & "Score Only" CL#2278111 Improved EQS Dot test "Description Title" to display "Absolute" and " 2D" as appropriate. CL#2278115 Added "Random" EQS test, which can be used for adding a random value to items. Potentially needed for hunting EQS query Phil is working on, and should be useful for other cases as well. CL#2278286 Fixes crash when trying to use the VisLog due to a spelling correction made in CL 2276628. CL#2281762 Moved VLOG in Vlog Redirect function to avoid ensure - Ensure was caused because we were trying to log to a redirect when the redirect hadn't be set yet CL#2282248 Fixed EQS "Random" test to work with ANY query item type, not just VectorBase item types. CL#2282639 Enhanced debug information data for single item in EQS Debugger (GameplayDebugger feature) #ue4 - Fixed few compilation issues with disabled USE_EQS_DEBUGGER flag - Fixed crash in EQSRenderingComponent - Fixed EQS debug data for sorted EQS itesm (it's slower way to sort items but only with active USE_EQS_DEBUGGER flag) CL#2282678 fixed crash on reimporting static mesh without NavCollision data ttp# 345454 CL#2282919 Renamed BTTask_MoveDirectlyToward.bForceMoveToLocation to more clear bDisablePathUpdateOnGoalLocationChange #UE4 - also fixed a bug in FortBTTask_GameMoveDirectlyToward that was misusing that variable. This addressed TTP#343489 CL#2282927 Fixed paths rendering while using GameplayDebugger (client/server too) #Fortnite CL#2283374 Fixes crowd following AIs (ie. regular husks) trying to rotate in the direction of their CrowdAgentMoveDirection while falling or not moving (Fixes ttp 344776) CL#2283475 Comment/code refactor that occurred but wasn't saved prior to check in of CL 2283374 CL#2283644 #UE4 Fix various issues seen when changing graphics settings with r.detailmode causes all components to reregister Fix it so particle system components track if they were active when unregistering, reactivate on next register if true Fix it so character movement components don't throw away timestamp data on unregister, this broke networking entirely Fix it so single anim skeletal meshes restore state accross reinitializations CL#2283688 Make bPendingKillPending no longer a UProperty so it won't be serialized. Fixes TTPs 342221, 342634 CL#2283879 #UE4 Fix it so the scalability settings are correctly written to the user config file when saving settings, and are properly reset to in memory values when reset. Has been broken since they got refactored. CL#2284368 fixed crash on using blueprint-based EQS contexts in PIE CL#2284405 HotSpots auto expire #UE4 Also, Fortnite-specific: - made FortAIHotSpotManager the owner of hotspots spawning process - added support for having multiple hotspots assigned to one BuildingSMActor, one per approach vector CL#2285167 Fixed Fortnite client to match FriendsService API change for pending invites CL#2285650 #UE4: Allow JsonObjectConverter to convert Strings to FDateTime fields using ISO-8601 CL#2286127 fixed pathfinding eqs test CL#2286208 fixed EQS tests reverting to Score Only settings after reopening editor ttp# 345719 CL#2286296 Game Invites work in Fortnite again Fixed game to match a backend API change CL#2286378 Removing TickAnim from InitAnim as that seems unnecessary and should avoid if we can. CL#2286408 - TTP#345476 Slate: Fixed MenuPlacement_AboveAnchor not being respected. CL#2286777 Fixed bug in GameplayDebuggingComponent which would cause debug display of EQS queries sharing the same name never to update after the initial query of a certain name is made. (In Fortnite, Goal Manager queries all have the same name, and the data would never update. In fact, even choosing a second actor would not clear out the data from the earlier actor, because they weren't updating data when the Timestamp updated.) CL#2289211 Fix for TTP #345752 "CRASH: DEDICATED SERVER: ToggleAILogging with a gate active causes a server crash" CL#2289279 LatentActionManager: value from iterator (over ObjectToActionListMap) was invalidated, when ObjectToActionListMap was changed. Unique Ptr should be used instead of SharedPtr, but UniquePtr is currently not compatible with TMap. CL#2289897 Fixes flying AIs (like the Taker) trying to move their feet to their destination, causing them to float higher than they should be. CL#2290041 Fix a number of properties in the Action_Move hierarchy that aren't exposed and therefore aren't duplicated when we duplicate Pawn Actions. CL#2290210 #UE4 Fix it so UEngine::ShutdownWorldNetDriver shuts down all net drivers associated with a world and not just a primary one. Fixes a crash when transferring maps with an active beacon net driver. Also fix issue where UEngine::ShutdownAllNetDrivers would miss some net drivers due to indexes being removed - Duplicating actions occurs as part of adding a Pawn Action Sequence comprised of multiple Pawn Actions. The bug causes undesired behavior because the properties that were set on the initial Pawn Action are not carried over to the duplicate. - We will continue to use the feet location as the origin of the Actor for determining requested velocity with walking AIs, but use the Actor's location as the origin for non-walking AIs CL#2290255 #UE4 Fix to previous netdriver checkin, only kill world net drivers if the world is actively set, idle net drivers are fine and needed for beacons to work properly CL#2290585 Fixed some PawnActions' bool properties not being marked as UPROPERTIES #UE4 It was resulting in copied actions loosing parts of its configuration. Also: - added a parameter to PawnAction_Move to controll "finish on overlap" path following behavior CL#2290675 Extended GameplayDebugger view in Simulation. I added a way to switch debug views, to have all functionality from PIE. #ue4 CL#2290778 fixed invalid nav nodes in paths after offseting CL#2290784 moved pathfollowing's reachability test out of FollowPathSegment function (it's supposed to handle only velocity calculations), agent will always use feet location for moving on path segment CL#2292104 Fixes for GameplayDebugger, it mostly fixes activation in different configurations (PIE, standalone, client-server, etc.). CL#2292198 Fixed issues related to NavMesh rendering and EQS query switching for GameplayDebugger. #ue4 CL#2292766 Fixed crash if touch event without valid MovieStreamer CL#2292967 GameplayDebuggingComponent now tries to pick the correct nav-mesh for the selected actor, rather than always displaying the default nav-mesh. NOTE: If you switch from one actor to another with nav-agent properties that are associated with different nav-meshes, it may continue to display the original nav-mesh for a while until it needs to update the position where the nav-mesh should display. CL#2293116 #UE4 #HTTP: Make LibCurl reuse connections by default on windows/android to mirror the change in CL# 2025870. Also added [Networking]UseLibCurl as an option to have LibCurl get used in addition to command line. CL#2293217 Added suffix override to allow StagingInfo instances without platform in the staging path This is to handle where platform is already in each build product instead of as a root dir, eg. \\WindowsClient instead of \\Windows\\WindowsClient CL#2293263 #UE4: Make JsonObjectConverter skip null values in arrays and structs (this is consistent with skipping missing keys) CL#2293534 fixed parent node usage in navigation octree (navmesh stays unchanged after deleting an actor) CL#2293536 fixed updating parent chain in navoctree after removing last attached node CL#2293543 changed navigation octree parent map to use weak object pointers (merged from main) CL#2293952 Changes/improvements to curl http module: - Properly get bUseCurl from a configuration file. - Do less work when creating requests (checking commandline settings moved to CurlHttpManager). - Do not init/shutdown unless actually used. CL#2294062 Added virtual function OnCharacterStuckInGeometry for Characters that get stuck in geometry to CharacterMovementComponent - Allows subclasses to define behavior when this occurs - Comment states that this only will be called when the character is walking [CL 2305577 by Bob Tellez in Main branch]
2014-09-22 10:33:39 -04:00
#if WITH_RECAST
ARecastNavMesh* UGameplayDebuggingComponent::GetNavData()
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
Merging Dev->Main CL#2294650 using UE4-Fortnite-To-UE4 CL#2272587 Added "BlueprintReadWrite" to bNoneIsAllowedValue in FBlackboardKeySelector to avoid breaking any usage of it in blueprints through Break node which people were already using. That matches the usage for AllowedTypes, which is conceptually a related idea and was already set to BlueprintReadWrite. CL#2272599 Fixed crash when AI were killed in the same frame they were spawning into the world. CL#2274068 behavior tree search can be reverted, task will be aborted AFTER finding a valid replacement fix for move action crashing on pawn's death CL#2274177 fixed behavior tree's search range when there are mutliple restart requests in the same frame CL#2274359 Fixes RotateToFaceBBEntry not working correctly when focusing on an actor - the GetFocalPoint call to AIController had different behavior if you called it with a priority vs. without - with a priority we would just look at the Priorities and return the position, but that position was never being updated for Actors - without a priority we would go through all the priorities, check for an Actor, and if it existed we would return its location - while I could have just modified the RotateToFaceBBEntry call to just call GetFocusActor for the appropriate focus priority, this seems like the better fix) - solution was to make the GetFocalPoint with a focus priority work exactly like the one without the focus priority. while I would have liked to reduce the copy/paste code between the functions it didn't seem like a good idea. Also fixed Precision not considering vectors that were in the same direction (>= vs just > with the angle threshold value) CL#2274719 Fix crash related to AnimCameraActor. TTP #344968 CRASH: TAKER: If the world owner leaves the game in the middle of a Taker Soul sucking another player, the Client will crash. CL#2274988 #UE4 Proper handling of saving level assets that were created without a valid non-read only path. TTP#344899 CL#2275045 #UE4: Include "IHttpBase.h" in IHttpResponse.h since it's using a base class from there (they're truly dependent). Would be nice if this file just had the enum though. CL#2275152 TTP# 336668 Moved the input check for VOIP from the child widgets into the base SFortHUDLayer to capture that event on different screens. Removed code duplication. CL#2275528 Fixed StaticMeshComponent destruction blocking on the rendering thread instead of using the UObject async destruction interface CL#2275960 fixed behavior tree search being discarded after merge with non discardable request decorator observers will be added even after failed search CL#2276294 Added support to EQS "Dot" test for 2D dot-product AND taking absolute value of dot-product (for biasing for lateral over forward/back). They are separate options which can be used together or separately. CL#2277344 fixed BT decorator indices for abort range preview in editor CL#2277473 NavCollision settings of static mesh will persist through reimport ttp# 344853 CL#2277509 fixed multiple nodes connected to special pins in behavior tree editor CL#2278042 Fixes EQS not returning the best item when the last EQS test is a filter. - To do this, on the last test if we know it's just a filter and eventually we will use the first item that passes the test, then we sort prior to filtering. Made the filter and score test types display "Filter Only" & "Score Only" CL#2278111 Improved EQS Dot test "Description Title" to display "Absolute" and " 2D" as appropriate. CL#2278115 Added "Random" EQS test, which can be used for adding a random value to items. Potentially needed for hunting EQS query Phil is working on, and should be useful for other cases as well. CL#2278286 Fixes crash when trying to use the VisLog due to a spelling correction made in CL 2276628. CL#2281762 Moved VLOG in Vlog Redirect function to avoid ensure - Ensure was caused because we were trying to log to a redirect when the redirect hadn't be set yet CL#2282248 Fixed EQS "Random" test to work with ANY query item type, not just VectorBase item types. CL#2282639 Enhanced debug information data for single item in EQS Debugger (GameplayDebugger feature) #ue4 - Fixed few compilation issues with disabled USE_EQS_DEBUGGER flag - Fixed crash in EQSRenderingComponent - Fixed EQS debug data for sorted EQS itesm (it's slower way to sort items but only with active USE_EQS_DEBUGGER flag) CL#2282678 fixed crash on reimporting static mesh without NavCollision data ttp# 345454 CL#2282919 Renamed BTTask_MoveDirectlyToward.bForceMoveToLocation to more clear bDisablePathUpdateOnGoalLocationChange #UE4 - also fixed a bug in FortBTTask_GameMoveDirectlyToward that was misusing that variable. This addressed TTP#343489 CL#2282927 Fixed paths rendering while using GameplayDebugger (client/server too) #Fortnite CL#2283374 Fixes crowd following AIs (ie. regular husks) trying to rotate in the direction of their CrowdAgentMoveDirection while falling or not moving (Fixes ttp 344776) CL#2283475 Comment/code refactor that occurred but wasn't saved prior to check in of CL 2283374 CL#2283644 #UE4 Fix various issues seen when changing graphics settings with r.detailmode causes all components to reregister Fix it so particle system components track if they were active when unregistering, reactivate on next register if true Fix it so character movement components don't throw away timestamp data on unregister, this broke networking entirely Fix it so single anim skeletal meshes restore state accross reinitializations CL#2283688 Make bPendingKillPending no longer a UProperty so it won't be serialized. Fixes TTPs 342221, 342634 CL#2283879 #UE4 Fix it so the scalability settings are correctly written to the user config file when saving settings, and are properly reset to in memory values when reset. Has been broken since they got refactored. CL#2284368 fixed crash on using blueprint-based EQS contexts in PIE CL#2284405 HotSpots auto expire #UE4 Also, Fortnite-specific: - made FortAIHotSpotManager the owner of hotspots spawning process - added support for having multiple hotspots assigned to one BuildingSMActor, one per approach vector CL#2285167 Fixed Fortnite client to match FriendsService API change for pending invites CL#2285650 #UE4: Allow JsonObjectConverter to convert Strings to FDateTime fields using ISO-8601 CL#2286127 fixed pathfinding eqs test CL#2286208 fixed EQS tests reverting to Score Only settings after reopening editor ttp# 345719 CL#2286296 Game Invites work in Fortnite again Fixed game to match a backend API change CL#2286378 Removing TickAnim from InitAnim as that seems unnecessary and should avoid if we can. CL#2286408 - TTP#345476 Slate: Fixed MenuPlacement_AboveAnchor not being respected. CL#2286777 Fixed bug in GameplayDebuggingComponent which would cause debug display of EQS queries sharing the same name never to update after the initial query of a certain name is made. (In Fortnite, Goal Manager queries all have the same name, and the data would never update. In fact, even choosing a second actor would not clear out the data from the earlier actor, because they weren't updating data when the Timestamp updated.) CL#2289211 Fix for TTP #345752 "CRASH: DEDICATED SERVER: ToggleAILogging with a gate active causes a server crash" CL#2289279 LatentActionManager: value from iterator (over ObjectToActionListMap) was invalidated, when ObjectToActionListMap was changed. Unique Ptr should be used instead of SharedPtr, but UniquePtr is currently not compatible with TMap. CL#2289897 Fixes flying AIs (like the Taker) trying to move their feet to their destination, causing them to float higher than they should be. CL#2290041 Fix a number of properties in the Action_Move hierarchy that aren't exposed and therefore aren't duplicated when we duplicate Pawn Actions. CL#2290210 #UE4 Fix it so UEngine::ShutdownWorldNetDriver shuts down all net drivers associated with a world and not just a primary one. Fixes a crash when transferring maps with an active beacon net driver. Also fix issue where UEngine::ShutdownAllNetDrivers would miss some net drivers due to indexes being removed - Duplicating actions occurs as part of adding a Pawn Action Sequence comprised of multiple Pawn Actions. The bug causes undesired behavior because the properties that were set on the initial Pawn Action are not carried over to the duplicate. - We will continue to use the feet location as the origin of the Actor for determining requested velocity with walking AIs, but use the Actor's location as the origin for non-walking AIs CL#2290255 #UE4 Fix to previous netdriver checkin, only kill world net drivers if the world is actively set, idle net drivers are fine and needed for beacons to work properly CL#2290585 Fixed some PawnActions' bool properties not being marked as UPROPERTIES #UE4 It was resulting in copied actions loosing parts of its configuration. Also: - added a parameter to PawnAction_Move to controll "finish on overlap" path following behavior CL#2290675 Extended GameplayDebugger view in Simulation. I added a way to switch debug views, to have all functionality from PIE. #ue4 CL#2290778 fixed invalid nav nodes in paths after offseting CL#2290784 moved pathfollowing's reachability test out of FollowPathSegment function (it's supposed to handle only velocity calculations), agent will always use feet location for moving on path segment CL#2292104 Fixes for GameplayDebugger, it mostly fixes activation in different configurations (PIE, standalone, client-server, etc.). CL#2292198 Fixed issues related to NavMesh rendering and EQS query switching for GameplayDebugger. #ue4 CL#2292766 Fixed crash if touch event without valid MovieStreamer CL#2292967 GameplayDebuggingComponent now tries to pick the correct nav-mesh for the selected actor, rather than always displaying the default nav-mesh. NOTE: If you switch from one actor to another with nav-agent properties that are associated with different nav-meshes, it may continue to display the original nav-mesh for a while until it needs to update the position where the nav-mesh should display. CL#2293116 #UE4 #HTTP: Make LibCurl reuse connections by default on windows/android to mirror the change in CL# 2025870. Also added [Networking]UseLibCurl as an option to have LibCurl get used in addition to command line. CL#2293217 Added suffix override to allow StagingInfo instances without platform in the staging path This is to handle where platform is already in each build product instead of as a root dir, eg. \\WindowsClient instead of \\Windows\\WindowsClient CL#2293263 #UE4: Make JsonObjectConverter skip null values in arrays and structs (this is consistent with skipping missing keys) CL#2293534 fixed parent node usage in navigation octree (navmesh stays unchanged after deleting an actor) CL#2293536 fixed updating parent chain in navoctree after removing last attached node CL#2293543 changed navigation octree parent map to use weak object pointers (merged from main) CL#2293952 Changes/improvements to curl http module: - Properly get bUseCurl from a configuration file. - Do less work when creating requests (checking commandline settings moved to CurlHttpManager). - Do not init/shutdown unless actually used. CL#2294062 Added virtual function OnCharacterStuckInGeometry for Characters that get stuck in geometry to CharacterMovementComponent - Allows subclasses to define behavior when this occurs - Comment states that this only will be called when the character is walking [CL 2305577 by Bob Tellez in Main branch]
2014-09-22 10:33:39 -04:00
UNavigationSystem* NavSys = UNavigationSystem::GetCurrent(GetWorld());
if (NavSys == NULL)
{
return NULL;
}
// Try to get the correct nav-mesh relative to the selected actor.
APawn* TargetPawn = Cast<APawn>(TargetActor);
if (TargetPawn != NULL)
{
const FNavAgentProperties& NavAgentProperties = TargetPawn->GetNavAgentPropertiesRef();
return Cast<ARecastNavMesh>(NavSys->GetNavDataForProps(NavAgentProperties));
Merging Dev->Main CL#2294650 using UE4-Fortnite-To-UE4 CL#2272587 Added "BlueprintReadWrite" to bNoneIsAllowedValue in FBlackboardKeySelector to avoid breaking any usage of it in blueprints through Break node which people were already using. That matches the usage for AllowedTypes, which is conceptually a related idea and was already set to BlueprintReadWrite. CL#2272599 Fixed crash when AI were killed in the same frame they were spawning into the world. CL#2274068 behavior tree search can be reverted, task will be aborted AFTER finding a valid replacement fix for move action crashing on pawn's death CL#2274177 fixed behavior tree's search range when there are mutliple restart requests in the same frame CL#2274359 Fixes RotateToFaceBBEntry not working correctly when focusing on an actor - the GetFocalPoint call to AIController had different behavior if you called it with a priority vs. without - with a priority we would just look at the Priorities and return the position, but that position was never being updated for Actors - without a priority we would go through all the priorities, check for an Actor, and if it existed we would return its location - while I could have just modified the RotateToFaceBBEntry call to just call GetFocusActor for the appropriate focus priority, this seems like the better fix) - solution was to make the GetFocalPoint with a focus priority work exactly like the one without the focus priority. while I would have liked to reduce the copy/paste code between the functions it didn't seem like a good idea. Also fixed Precision not considering vectors that were in the same direction (>= vs just > with the angle threshold value) CL#2274719 Fix crash related to AnimCameraActor. TTP #344968 CRASH: TAKER: If the world owner leaves the game in the middle of a Taker Soul sucking another player, the Client will crash. CL#2274988 #UE4 Proper handling of saving level assets that were created without a valid non-read only path. TTP#344899 CL#2275045 #UE4: Include "IHttpBase.h" in IHttpResponse.h since it's using a base class from there (they're truly dependent). Would be nice if this file just had the enum though. CL#2275152 TTP# 336668 Moved the input check for VOIP from the child widgets into the base SFortHUDLayer to capture that event on different screens. Removed code duplication. CL#2275528 Fixed StaticMeshComponent destruction blocking on the rendering thread instead of using the UObject async destruction interface CL#2275960 fixed behavior tree search being discarded after merge with non discardable request decorator observers will be added even after failed search CL#2276294 Added support to EQS "Dot" test for 2D dot-product AND taking absolute value of dot-product (for biasing for lateral over forward/back). They are separate options which can be used together or separately. CL#2277344 fixed BT decorator indices for abort range preview in editor CL#2277473 NavCollision settings of static mesh will persist through reimport ttp# 344853 CL#2277509 fixed multiple nodes connected to special pins in behavior tree editor CL#2278042 Fixes EQS not returning the best item when the last EQS test is a filter. - To do this, on the last test if we know it's just a filter and eventually we will use the first item that passes the test, then we sort prior to filtering. Made the filter and score test types display "Filter Only" & "Score Only" CL#2278111 Improved EQS Dot test "Description Title" to display "Absolute" and " 2D" as appropriate. CL#2278115 Added "Random" EQS test, which can be used for adding a random value to items. Potentially needed for hunting EQS query Phil is working on, and should be useful for other cases as well. CL#2278286 Fixes crash when trying to use the VisLog due to a spelling correction made in CL 2276628. CL#2281762 Moved VLOG in Vlog Redirect function to avoid ensure - Ensure was caused because we were trying to log to a redirect when the redirect hadn't be set yet CL#2282248 Fixed EQS "Random" test to work with ANY query item type, not just VectorBase item types. CL#2282639 Enhanced debug information data for single item in EQS Debugger (GameplayDebugger feature) #ue4 - Fixed few compilation issues with disabled USE_EQS_DEBUGGER flag - Fixed crash in EQSRenderingComponent - Fixed EQS debug data for sorted EQS itesm (it's slower way to sort items but only with active USE_EQS_DEBUGGER flag) CL#2282678 fixed crash on reimporting static mesh without NavCollision data ttp# 345454 CL#2282919 Renamed BTTask_MoveDirectlyToward.bForceMoveToLocation to more clear bDisablePathUpdateOnGoalLocationChange #UE4 - also fixed a bug in FortBTTask_GameMoveDirectlyToward that was misusing that variable. This addressed TTP#343489 CL#2282927 Fixed paths rendering while using GameplayDebugger (client/server too) #Fortnite CL#2283374 Fixes crowd following AIs (ie. regular husks) trying to rotate in the direction of their CrowdAgentMoveDirection while falling or not moving (Fixes ttp 344776) CL#2283475 Comment/code refactor that occurred but wasn't saved prior to check in of CL 2283374 CL#2283644 #UE4 Fix various issues seen when changing graphics settings with r.detailmode causes all components to reregister Fix it so particle system components track if they were active when unregistering, reactivate on next register if true Fix it so character movement components don't throw away timestamp data on unregister, this broke networking entirely Fix it so single anim skeletal meshes restore state accross reinitializations CL#2283688 Make bPendingKillPending no longer a UProperty so it won't be serialized. Fixes TTPs 342221, 342634 CL#2283879 #UE4 Fix it so the scalability settings are correctly written to the user config file when saving settings, and are properly reset to in memory values when reset. Has been broken since they got refactored. CL#2284368 fixed crash on using blueprint-based EQS contexts in PIE CL#2284405 HotSpots auto expire #UE4 Also, Fortnite-specific: - made FortAIHotSpotManager the owner of hotspots spawning process - added support for having multiple hotspots assigned to one BuildingSMActor, one per approach vector CL#2285167 Fixed Fortnite client to match FriendsService API change for pending invites CL#2285650 #UE4: Allow JsonObjectConverter to convert Strings to FDateTime fields using ISO-8601 CL#2286127 fixed pathfinding eqs test CL#2286208 fixed EQS tests reverting to Score Only settings after reopening editor ttp# 345719 CL#2286296 Game Invites work in Fortnite again Fixed game to match a backend API change CL#2286378 Removing TickAnim from InitAnim as that seems unnecessary and should avoid if we can. CL#2286408 - TTP#345476 Slate: Fixed MenuPlacement_AboveAnchor not being respected. CL#2286777 Fixed bug in GameplayDebuggingComponent which would cause debug display of EQS queries sharing the same name never to update after the initial query of a certain name is made. (In Fortnite, Goal Manager queries all have the same name, and the data would never update. In fact, even choosing a second actor would not clear out the data from the earlier actor, because they weren't updating data when the Timestamp updated.) CL#2289211 Fix for TTP #345752 "CRASH: DEDICATED SERVER: ToggleAILogging with a gate active causes a server crash" CL#2289279 LatentActionManager: value from iterator (over ObjectToActionListMap) was invalidated, when ObjectToActionListMap was changed. Unique Ptr should be used instead of SharedPtr, but UniquePtr is currently not compatible with TMap. CL#2289897 Fixes flying AIs (like the Taker) trying to move their feet to their destination, causing them to float higher than they should be. CL#2290041 Fix a number of properties in the Action_Move hierarchy that aren't exposed and therefore aren't duplicated when we duplicate Pawn Actions. CL#2290210 #UE4 Fix it so UEngine::ShutdownWorldNetDriver shuts down all net drivers associated with a world and not just a primary one. Fixes a crash when transferring maps with an active beacon net driver. Also fix issue where UEngine::ShutdownAllNetDrivers would miss some net drivers due to indexes being removed - Duplicating actions occurs as part of adding a Pawn Action Sequence comprised of multiple Pawn Actions. The bug causes undesired behavior because the properties that were set on the initial Pawn Action are not carried over to the duplicate. - We will continue to use the feet location as the origin of the Actor for determining requested velocity with walking AIs, but use the Actor's location as the origin for non-walking AIs CL#2290255 #UE4 Fix to previous netdriver checkin, only kill world net drivers if the world is actively set, idle net drivers are fine and needed for beacons to work properly CL#2290585 Fixed some PawnActions' bool properties not being marked as UPROPERTIES #UE4 It was resulting in copied actions loosing parts of its configuration. Also: - added a parameter to PawnAction_Move to controll "finish on overlap" path following behavior CL#2290675 Extended GameplayDebugger view in Simulation. I added a way to switch debug views, to have all functionality from PIE. #ue4 CL#2290778 fixed invalid nav nodes in paths after offseting CL#2290784 moved pathfollowing's reachability test out of FollowPathSegment function (it's supposed to handle only velocity calculations), agent will always use feet location for moving on path segment CL#2292104 Fixes for GameplayDebugger, it mostly fixes activation in different configurations (PIE, standalone, client-server, etc.). CL#2292198 Fixed issues related to NavMesh rendering and EQS query switching for GameplayDebugger. #ue4 CL#2292766 Fixed crash if touch event without valid MovieStreamer CL#2292967 GameplayDebuggingComponent now tries to pick the correct nav-mesh for the selected actor, rather than always displaying the default nav-mesh. NOTE: If you switch from one actor to another with nav-agent properties that are associated with different nav-meshes, it may continue to display the original nav-mesh for a while until it needs to update the position where the nav-mesh should display. CL#2293116 #UE4 #HTTP: Make LibCurl reuse connections by default on windows/android to mirror the change in CL# 2025870. Also added [Networking]UseLibCurl as an option to have LibCurl get used in addition to command line. CL#2293217 Added suffix override to allow StagingInfo instances without platform in the staging path This is to handle where platform is already in each build product instead of as a root dir, eg. \\WindowsClient instead of \\Windows\\WindowsClient CL#2293263 #UE4: Make JsonObjectConverter skip null values in arrays and structs (this is consistent with skipping missing keys) CL#2293534 fixed parent node usage in navigation octree (navmesh stays unchanged after deleting an actor) CL#2293536 fixed updating parent chain in navoctree after removing last attached node CL#2293543 changed navigation octree parent map to use weak object pointers (merged from main) CL#2293952 Changes/improvements to curl http module: - Properly get bUseCurl from a configuration file. - Do less work when creating requests (checking commandline settings moved to CurlHttpManager). - Do not init/shutdown unless actually used. CL#2294062 Added virtual function OnCharacterStuckInGeometry for Characters that get stuck in geometry to CharacterMovementComponent - Allows subclasses to define behavior when this occurs - Comment states that this only will be called when the character is walking [CL 2305577 by Bob Tellez in Main branch]
2014-09-22 10:33:39 -04:00
}
// If it wasn't found, just get the main nav-mesh data.
return Cast<ARecastNavMesh>(NavSys->GetMainNavData(FNavigationSystem::DontCreate));
#else
return NULL;
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
Merging Dev->Main CL#2294650 using UE4-Fortnite-To-UE4 CL#2272587 Added "BlueprintReadWrite" to bNoneIsAllowedValue in FBlackboardKeySelector to avoid breaking any usage of it in blueprints through Break node which people were already using. That matches the usage for AllowedTypes, which is conceptually a related idea and was already set to BlueprintReadWrite. CL#2272599 Fixed crash when AI were killed in the same frame they were spawning into the world. CL#2274068 behavior tree search can be reverted, task will be aborted AFTER finding a valid replacement fix for move action crashing on pawn's death CL#2274177 fixed behavior tree's search range when there are mutliple restart requests in the same frame CL#2274359 Fixes RotateToFaceBBEntry not working correctly when focusing on an actor - the GetFocalPoint call to AIController had different behavior if you called it with a priority vs. without - with a priority we would just look at the Priorities and return the position, but that position was never being updated for Actors - without a priority we would go through all the priorities, check for an Actor, and if it existed we would return its location - while I could have just modified the RotateToFaceBBEntry call to just call GetFocusActor for the appropriate focus priority, this seems like the better fix) - solution was to make the GetFocalPoint with a focus priority work exactly like the one without the focus priority. while I would have liked to reduce the copy/paste code between the functions it didn't seem like a good idea. Also fixed Precision not considering vectors that were in the same direction (>= vs just > with the angle threshold value) CL#2274719 Fix crash related to AnimCameraActor. TTP #344968 CRASH: TAKER: If the world owner leaves the game in the middle of a Taker Soul sucking another player, the Client will crash. CL#2274988 #UE4 Proper handling of saving level assets that were created without a valid non-read only path. TTP#344899 CL#2275045 #UE4: Include "IHttpBase.h" in IHttpResponse.h since it's using a base class from there (they're truly dependent). Would be nice if this file just had the enum though. CL#2275152 TTP# 336668 Moved the input check for VOIP from the child widgets into the base SFortHUDLayer to capture that event on different screens. Removed code duplication. CL#2275528 Fixed StaticMeshComponent destruction blocking on the rendering thread instead of using the UObject async destruction interface CL#2275960 fixed behavior tree search being discarded after merge with non discardable request decorator observers will be added even after failed search CL#2276294 Added support to EQS "Dot" test for 2D dot-product AND taking absolute value of dot-product (for biasing for lateral over forward/back). They are separate options which can be used together or separately. CL#2277344 fixed BT decorator indices for abort range preview in editor CL#2277473 NavCollision settings of static mesh will persist through reimport ttp# 344853 CL#2277509 fixed multiple nodes connected to special pins in behavior tree editor CL#2278042 Fixes EQS not returning the best item when the last EQS test is a filter. - To do this, on the last test if we know it's just a filter and eventually we will use the first item that passes the test, then we sort prior to filtering. Made the filter and score test types display "Filter Only" & "Score Only" CL#2278111 Improved EQS Dot test "Description Title" to display "Absolute" and " 2D" as appropriate. CL#2278115 Added "Random" EQS test, which can be used for adding a random value to items. Potentially needed for hunting EQS query Phil is working on, and should be useful for other cases as well. CL#2278286 Fixes crash when trying to use the VisLog due to a spelling correction made in CL 2276628. CL#2281762 Moved VLOG in Vlog Redirect function to avoid ensure - Ensure was caused because we were trying to log to a redirect when the redirect hadn't be set yet CL#2282248 Fixed EQS "Random" test to work with ANY query item type, not just VectorBase item types. CL#2282639 Enhanced debug information data for single item in EQS Debugger (GameplayDebugger feature) #ue4 - Fixed few compilation issues with disabled USE_EQS_DEBUGGER flag - Fixed crash in EQSRenderingComponent - Fixed EQS debug data for sorted EQS itesm (it's slower way to sort items but only with active USE_EQS_DEBUGGER flag) CL#2282678 fixed crash on reimporting static mesh without NavCollision data ttp# 345454 CL#2282919 Renamed BTTask_MoveDirectlyToward.bForceMoveToLocation to more clear bDisablePathUpdateOnGoalLocationChange #UE4 - also fixed a bug in FortBTTask_GameMoveDirectlyToward that was misusing that variable. This addressed TTP#343489 CL#2282927 Fixed paths rendering while using GameplayDebugger (client/server too) #Fortnite CL#2283374 Fixes crowd following AIs (ie. regular husks) trying to rotate in the direction of their CrowdAgentMoveDirection while falling or not moving (Fixes ttp 344776) CL#2283475 Comment/code refactor that occurred but wasn't saved prior to check in of CL 2283374 CL#2283644 #UE4 Fix various issues seen when changing graphics settings with r.detailmode causes all components to reregister Fix it so particle system components track if they were active when unregistering, reactivate on next register if true Fix it so character movement components don't throw away timestamp data on unregister, this broke networking entirely Fix it so single anim skeletal meshes restore state accross reinitializations CL#2283688 Make bPendingKillPending no longer a UProperty so it won't be serialized. Fixes TTPs 342221, 342634 CL#2283879 #UE4 Fix it so the scalability settings are correctly written to the user config file when saving settings, and are properly reset to in memory values when reset. Has been broken since they got refactored. CL#2284368 fixed crash on using blueprint-based EQS contexts in PIE CL#2284405 HotSpots auto expire #UE4 Also, Fortnite-specific: - made FortAIHotSpotManager the owner of hotspots spawning process - added support for having multiple hotspots assigned to one BuildingSMActor, one per approach vector CL#2285167 Fixed Fortnite client to match FriendsService API change for pending invites CL#2285650 #UE4: Allow JsonObjectConverter to convert Strings to FDateTime fields using ISO-8601 CL#2286127 fixed pathfinding eqs test CL#2286208 fixed EQS tests reverting to Score Only settings after reopening editor ttp# 345719 CL#2286296 Game Invites work in Fortnite again Fixed game to match a backend API change CL#2286378 Removing TickAnim from InitAnim as that seems unnecessary and should avoid if we can. CL#2286408 - TTP#345476 Slate: Fixed MenuPlacement_AboveAnchor not being respected. CL#2286777 Fixed bug in GameplayDebuggingComponent which would cause debug display of EQS queries sharing the same name never to update after the initial query of a certain name is made. (In Fortnite, Goal Manager queries all have the same name, and the data would never update. In fact, even choosing a second actor would not clear out the data from the earlier actor, because they weren't updating data when the Timestamp updated.) CL#2289211 Fix for TTP #345752 "CRASH: DEDICATED SERVER: ToggleAILogging with a gate active causes a server crash" CL#2289279 LatentActionManager: value from iterator (over ObjectToActionListMap) was invalidated, when ObjectToActionListMap was changed. Unique Ptr should be used instead of SharedPtr, but UniquePtr is currently not compatible with TMap. CL#2289897 Fixes flying AIs (like the Taker) trying to move their feet to their destination, causing them to float higher than they should be. CL#2290041 Fix a number of properties in the Action_Move hierarchy that aren't exposed and therefore aren't duplicated when we duplicate Pawn Actions. CL#2290210 #UE4 Fix it so UEngine::ShutdownWorldNetDriver shuts down all net drivers associated with a world and not just a primary one. Fixes a crash when transferring maps with an active beacon net driver. Also fix issue where UEngine::ShutdownAllNetDrivers would miss some net drivers due to indexes being removed - Duplicating actions occurs as part of adding a Pawn Action Sequence comprised of multiple Pawn Actions. The bug causes undesired behavior because the properties that were set on the initial Pawn Action are not carried over to the duplicate. - We will continue to use the feet location as the origin of the Actor for determining requested velocity with walking AIs, but use the Actor's location as the origin for non-walking AIs CL#2290255 #UE4 Fix to previous netdriver checkin, only kill world net drivers if the world is actively set, idle net drivers are fine and needed for beacons to work properly CL#2290585 Fixed some PawnActions' bool properties not being marked as UPROPERTIES #UE4 It was resulting in copied actions loosing parts of its configuration. Also: - added a parameter to PawnAction_Move to controll "finish on overlap" path following behavior CL#2290675 Extended GameplayDebugger view in Simulation. I added a way to switch debug views, to have all functionality from PIE. #ue4 CL#2290778 fixed invalid nav nodes in paths after offseting CL#2290784 moved pathfollowing's reachability test out of FollowPathSegment function (it's supposed to handle only velocity calculations), agent will always use feet location for moving on path segment CL#2292104 Fixes for GameplayDebugger, it mostly fixes activation in different configurations (PIE, standalone, client-server, etc.). CL#2292198 Fixed issues related to NavMesh rendering and EQS query switching for GameplayDebugger. #ue4 CL#2292766 Fixed crash if touch event without valid MovieStreamer CL#2292967 GameplayDebuggingComponent now tries to pick the correct nav-mesh for the selected actor, rather than always displaying the default nav-mesh. NOTE: If you switch from one actor to another with nav-agent properties that are associated with different nav-meshes, it may continue to display the original nav-mesh for a while until it needs to update the position where the nav-mesh should display. CL#2293116 #UE4 #HTTP: Make LibCurl reuse connections by default on windows/android to mirror the change in CL# 2025870. Also added [Networking]UseLibCurl as an option to have LibCurl get used in addition to command line. CL#2293217 Added suffix override to allow StagingInfo instances without platform in the staging path This is to handle where platform is already in each build product instead of as a root dir, eg. \\WindowsClient instead of \\Windows\\WindowsClient CL#2293263 #UE4: Make JsonObjectConverter skip null values in arrays and structs (this is consistent with skipping missing keys) CL#2293534 fixed parent node usage in navigation octree (navmesh stays unchanged after deleting an actor) CL#2293536 fixed updating parent chain in navoctree after removing last attached node CL#2293543 changed navigation octree parent map to use weak object pointers (merged from main) CL#2293952 Changes/improvements to curl http module: - Properly get bUseCurl from a configuration file. - Do less work when creating requests (checking commandline settings moved to CurlHttpManager). - Do not init/shutdown unless actually used. CL#2294062 Added virtual function OnCharacterStuckInGeometry for Characters that get stuck in geometry to CharacterMovementComponent - Allows subclasses to define behavior when this occurs - Comment states that this only will be called when the character is walking [CL 2305577 by Bob Tellez in Main branch]
2014-09-22 10:33:39 -04:00
}
#endif
void UGameplayDebuggingComponent::ServerCollectNavmeshData_Implementation(FVector_NetQuantize10 TargetLocation)
{
#if WITH_RECAST
UNavigationSystem* NavSys = UNavigationSystem::GetCurrent(GetWorld());
Merging Dev->Main CL#2294650 using UE4-Fortnite-To-UE4 CL#2272587 Added "BlueprintReadWrite" to bNoneIsAllowedValue in FBlackboardKeySelector to avoid breaking any usage of it in blueprints through Break node which people were already using. That matches the usage for AllowedTypes, which is conceptually a related idea and was already set to BlueprintReadWrite. CL#2272599 Fixed crash when AI were killed in the same frame they were spawning into the world. CL#2274068 behavior tree search can be reverted, task will be aborted AFTER finding a valid replacement fix for move action crashing on pawn's death CL#2274177 fixed behavior tree's search range when there are mutliple restart requests in the same frame CL#2274359 Fixes RotateToFaceBBEntry not working correctly when focusing on an actor - the GetFocalPoint call to AIController had different behavior if you called it with a priority vs. without - with a priority we would just look at the Priorities and return the position, but that position was never being updated for Actors - without a priority we would go through all the priorities, check for an Actor, and if it existed we would return its location - while I could have just modified the RotateToFaceBBEntry call to just call GetFocusActor for the appropriate focus priority, this seems like the better fix) - solution was to make the GetFocalPoint with a focus priority work exactly like the one without the focus priority. while I would have liked to reduce the copy/paste code between the functions it didn't seem like a good idea. Also fixed Precision not considering vectors that were in the same direction (>= vs just > with the angle threshold value) CL#2274719 Fix crash related to AnimCameraActor. TTP #344968 CRASH: TAKER: If the world owner leaves the game in the middle of a Taker Soul sucking another player, the Client will crash. CL#2274988 #UE4 Proper handling of saving level assets that were created without a valid non-read only path. TTP#344899 CL#2275045 #UE4: Include "IHttpBase.h" in IHttpResponse.h since it's using a base class from there (they're truly dependent). Would be nice if this file just had the enum though. CL#2275152 TTP# 336668 Moved the input check for VOIP from the child widgets into the base SFortHUDLayer to capture that event on different screens. Removed code duplication. CL#2275528 Fixed StaticMeshComponent destruction blocking on the rendering thread instead of using the UObject async destruction interface CL#2275960 fixed behavior tree search being discarded after merge with non discardable request decorator observers will be added even after failed search CL#2276294 Added support to EQS "Dot" test for 2D dot-product AND taking absolute value of dot-product (for biasing for lateral over forward/back). They are separate options which can be used together or separately. CL#2277344 fixed BT decorator indices for abort range preview in editor CL#2277473 NavCollision settings of static mesh will persist through reimport ttp# 344853 CL#2277509 fixed multiple nodes connected to special pins in behavior tree editor CL#2278042 Fixes EQS not returning the best item when the last EQS test is a filter. - To do this, on the last test if we know it's just a filter and eventually we will use the first item that passes the test, then we sort prior to filtering. Made the filter and score test types display "Filter Only" & "Score Only" CL#2278111 Improved EQS Dot test "Description Title" to display "Absolute" and " 2D" as appropriate. CL#2278115 Added "Random" EQS test, which can be used for adding a random value to items. Potentially needed for hunting EQS query Phil is working on, and should be useful for other cases as well. CL#2278286 Fixes crash when trying to use the VisLog due to a spelling correction made in CL 2276628. CL#2281762 Moved VLOG in Vlog Redirect function to avoid ensure - Ensure was caused because we were trying to log to a redirect when the redirect hadn't be set yet CL#2282248 Fixed EQS "Random" test to work with ANY query item type, not just VectorBase item types. CL#2282639 Enhanced debug information data for single item in EQS Debugger (GameplayDebugger feature) #ue4 - Fixed few compilation issues with disabled USE_EQS_DEBUGGER flag - Fixed crash in EQSRenderingComponent - Fixed EQS debug data for sorted EQS itesm (it's slower way to sort items but only with active USE_EQS_DEBUGGER flag) CL#2282678 fixed crash on reimporting static mesh without NavCollision data ttp# 345454 CL#2282919 Renamed BTTask_MoveDirectlyToward.bForceMoveToLocation to more clear bDisablePathUpdateOnGoalLocationChange #UE4 - also fixed a bug in FortBTTask_GameMoveDirectlyToward that was misusing that variable. This addressed TTP#343489 CL#2282927 Fixed paths rendering while using GameplayDebugger (client/server too) #Fortnite CL#2283374 Fixes crowd following AIs (ie. regular husks) trying to rotate in the direction of their CrowdAgentMoveDirection while falling or not moving (Fixes ttp 344776) CL#2283475 Comment/code refactor that occurred but wasn't saved prior to check in of CL 2283374 CL#2283644 #UE4 Fix various issues seen when changing graphics settings with r.detailmode causes all components to reregister Fix it so particle system components track if they were active when unregistering, reactivate on next register if true Fix it so character movement components don't throw away timestamp data on unregister, this broke networking entirely Fix it so single anim skeletal meshes restore state accross reinitializations CL#2283688 Make bPendingKillPending no longer a UProperty so it won't be serialized. Fixes TTPs 342221, 342634 CL#2283879 #UE4 Fix it so the scalability settings are correctly written to the user config file when saving settings, and are properly reset to in memory values when reset. Has been broken since they got refactored. CL#2284368 fixed crash on using blueprint-based EQS contexts in PIE CL#2284405 HotSpots auto expire #UE4 Also, Fortnite-specific: - made FortAIHotSpotManager the owner of hotspots spawning process - added support for having multiple hotspots assigned to one BuildingSMActor, one per approach vector CL#2285167 Fixed Fortnite client to match FriendsService API change for pending invites CL#2285650 #UE4: Allow JsonObjectConverter to convert Strings to FDateTime fields using ISO-8601 CL#2286127 fixed pathfinding eqs test CL#2286208 fixed EQS tests reverting to Score Only settings after reopening editor ttp# 345719 CL#2286296 Game Invites work in Fortnite again Fixed game to match a backend API change CL#2286378 Removing TickAnim from InitAnim as that seems unnecessary and should avoid if we can. CL#2286408 - TTP#345476 Slate: Fixed MenuPlacement_AboveAnchor not being respected. CL#2286777 Fixed bug in GameplayDebuggingComponent which would cause debug display of EQS queries sharing the same name never to update after the initial query of a certain name is made. (In Fortnite, Goal Manager queries all have the same name, and the data would never update. In fact, even choosing a second actor would not clear out the data from the earlier actor, because they weren't updating data when the Timestamp updated.) CL#2289211 Fix for TTP #345752 "CRASH: DEDICATED SERVER: ToggleAILogging with a gate active causes a server crash" CL#2289279 LatentActionManager: value from iterator (over ObjectToActionListMap) was invalidated, when ObjectToActionListMap was changed. Unique Ptr should be used instead of SharedPtr, but UniquePtr is currently not compatible with TMap. CL#2289897 Fixes flying AIs (like the Taker) trying to move their feet to their destination, causing them to float higher than they should be. CL#2290041 Fix a number of properties in the Action_Move hierarchy that aren't exposed and therefore aren't duplicated when we duplicate Pawn Actions. CL#2290210 #UE4 Fix it so UEngine::ShutdownWorldNetDriver shuts down all net drivers associated with a world and not just a primary one. Fixes a crash when transferring maps with an active beacon net driver. Also fix issue where UEngine::ShutdownAllNetDrivers would miss some net drivers due to indexes being removed - Duplicating actions occurs as part of adding a Pawn Action Sequence comprised of multiple Pawn Actions. The bug causes undesired behavior because the properties that were set on the initial Pawn Action are not carried over to the duplicate. - We will continue to use the feet location as the origin of the Actor for determining requested velocity with walking AIs, but use the Actor's location as the origin for non-walking AIs CL#2290255 #UE4 Fix to previous netdriver checkin, only kill world net drivers if the world is actively set, idle net drivers are fine and needed for beacons to work properly CL#2290585 Fixed some PawnActions' bool properties not being marked as UPROPERTIES #UE4 It was resulting in copied actions loosing parts of its configuration. Also: - added a parameter to PawnAction_Move to controll "finish on overlap" path following behavior CL#2290675 Extended GameplayDebugger view in Simulation. I added a way to switch debug views, to have all functionality from PIE. #ue4 CL#2290778 fixed invalid nav nodes in paths after offseting CL#2290784 moved pathfollowing's reachability test out of FollowPathSegment function (it's supposed to handle only velocity calculations), agent will always use feet location for moving on path segment CL#2292104 Fixes for GameplayDebugger, it mostly fixes activation in different configurations (PIE, standalone, client-server, etc.). CL#2292198 Fixed issues related to NavMesh rendering and EQS query switching for GameplayDebugger. #ue4 CL#2292766 Fixed crash if touch event without valid MovieStreamer CL#2292967 GameplayDebuggingComponent now tries to pick the correct nav-mesh for the selected actor, rather than always displaying the default nav-mesh. NOTE: If you switch from one actor to another with nav-agent properties that are associated with different nav-meshes, it may continue to display the original nav-mesh for a while until it needs to update the position where the nav-mesh should display. CL#2293116 #UE4 #HTTP: Make LibCurl reuse connections by default on windows/android to mirror the change in CL# 2025870. Also added [Networking]UseLibCurl as an option to have LibCurl get used in addition to command line. CL#2293217 Added suffix override to allow StagingInfo instances without platform in the staging path This is to handle where platform is already in each build product instead of as a root dir, eg. \\WindowsClient instead of \\Windows\\WindowsClient CL#2293263 #UE4: Make JsonObjectConverter skip null values in arrays and structs (this is consistent with skipping missing keys) CL#2293534 fixed parent node usage in navigation octree (navmesh stays unchanged after deleting an actor) CL#2293536 fixed updating parent chain in navoctree after removing last attached node CL#2293543 changed navigation octree parent map to use weak object pointers (merged from main) CL#2293952 Changes/improvements to curl http module: - Properly get bUseCurl from a configuration file. - Do less work when creating requests (checking commandline settings moved to CurlHttpManager). - Do not init/shutdown unless actually used. CL#2294062 Added virtual function OnCharacterStuckInGeometry for Characters that get stuck in geometry to CharacterMovementComponent - Allows subclasses to define behavior when this occurs - Comment states that this only will be called when the character is walking [CL 2305577 by Bob Tellez in Main branch]
2014-09-22 10:33:39 -04:00
ARecastNavMesh* NavData = GetNavData();
if (NavData == NULL)
{
NavmeshRepData.Empty();
return;
}
const double Timer1 = FPlatformTime::Seconds();
TArray<int32> Indices;
int32 TileX = 0;
int32 TileY = 0;
const int32 DeltaX[] = { 0, 1, 1, 0, -1, -1, -1, 0, 1 };
const int32 DeltaY[] = { 0, 0, 1, 1, 1, 0, -1, -1, -1 };
NavData->BeginBatchQuery();
// add 3x3 neighborhood of target
int32 TargetTileX = 0;
int32 TargetTileY = 0;
NavData->GetNavMeshTileXY(TargetLocation, TargetTileX, TargetTileY);
for (int32 i = 0; i < ARRAY_COUNT(DeltaX); i++)
{
const int32 NeiX = TargetTileX + DeltaX[i];
const int32 NeiY = TargetTileY + DeltaY[i];
NavData->GetNavMeshTilesAt(NeiX, NeiY, Indices);
}
const FNavDataConfig& NavConfig = NavData->GetConfig();
FColor NavMeshColors[RECAST_MAX_AREAS];
NavMeshColors[RECAST_DEFAULT_AREA] = NavConfig.Color.DWColor() > 0 ? NavConfig.Color : NavMeshRenderColor_RecastMesh;
for (uint8 i = 0; i < RECAST_DEFAULT_AREA; ++i)
{
NavMeshColors[i] = NavData->GetAreaIDColor(i);
}
TArray<uint8> UncompressedBuffer;
FMemoryWriter ArWriter(UncompressedBuffer);
int32 NumIndices = Indices.Num();
ArWriter << NumIndices;
for (int32 i = 0; i < NumIndices; i++)
{
FRecastDebugGeometry NavMeshGeometry;
NavMeshGeometry.bGatherPolyEdges = false;
NavMeshGeometry.bGatherNavMeshEdges = false;
NavData->GetDebugGeometry(NavMeshGeometry, Indices[i]);
NavMeshDebug::FTileData TileData;
const FBox TileBoundingBox = NavData->GetNavMeshTileBounds(Indices[i]);
TileData.Location = TileBoundingBox.GetCenter();
for (int32 VertIndex = 0; VertIndex < NavMeshGeometry.MeshVerts.Num(); ++VertIndex)
{
const NavMeshDebug::FShortVector SV = NavMeshGeometry.MeshVerts[VertIndex] - TileData.Location;
TileData.Verts.Add(SV);
}
for (int32 iArea = 0; iArea < RECAST_MAX_AREAS; iArea++)
{
const int32 NumTris = NavMeshGeometry.AreaIndices[iArea].Num();
if (NumTris)
{
NavMeshDebug::FAreaPolys AreaPolys;
for (int32 AreaIndicesIndex = 0; AreaIndicesIndex < NavMeshGeometry.AreaIndices[iArea].Num(); ++AreaIndicesIndex)
{
AreaPolys.Indices.Add(NavMeshGeometry.AreaIndices[iArea][AreaIndicesIndex]);
}
AreaPolys.Color = NavMeshColors[iArea];
TileData.Areas.Add(AreaPolys);
}
}
TileData.Links.Reserve(NavMeshGeometry.OffMeshLinks.Num());
for (int32 iLink = 0; iLink < NavMeshGeometry.OffMeshLinks.Num(); iLink++)
{
const FRecastDebugGeometry::FOffMeshLink& SrcLink = NavMeshGeometry.OffMeshLinks[iLink];
NavMeshDebug::FOffMeshLink Link;
Link.Left = SrcLink.Left - TileData.Location;
Link.Right = SrcLink.Right - TileData.Location;
Link.Color = ((SrcLink.Direction && SrcLink.ValidEnds) || (SrcLink.ValidEnds & FRecastDebugGeometry::OMLE_Left)) ? DarkenColor(NavMeshColors[SrcLink.AreaID]) : NavMeshRenderColor_OffMeshConnectionInvalid;
Link.PackedFlags.Radius = (int8)SrcLink.Radius;
Link.PackedFlags.Direction = SrcLink.Direction;
Link.PackedFlags.ValidEnds = SrcLink.ValidEnds;
TileData.Links.Add(Link);
}
ArWriter << TileData;
}
NavData->FinishBatchQuery();
const double Timer2 = FPlatformTime::Seconds();
const int32 HeaderSize = sizeof(int32);
NavmeshRepData.Init(0, HeaderSize + FMath::TruncToInt(1.1f * UncompressedBuffer.Num()));
const int32 UncompressedSize = UncompressedBuffer.Num();
int32 CompressedSize = NavmeshRepData.Num() - HeaderSize;
uint8* DestBuffer = NavmeshRepData.GetData();
FMemory::Memcpy(DestBuffer, &UncompressedSize, HeaderSize);
DestBuffer += HeaderSize;
FCompression::CompressMemory((ECompressionFlags)(COMPRESS_ZLIB | COMPRESS_BiasMemory),
(void*)DestBuffer, CompressedSize, (void*)UncompressedBuffer.GetData(), UncompressedSize);
NavmeshRepData.SetNum(CompressedSize + HeaderSize, false);
const double Timer3 = FPlatformTime::Seconds();
UE_LOG(LogGameplayDebugger, Log, TEXT("Preparing navmesh data: %.1fkB took %.3fms (collect: %.3fms + compress %d%%: %.3fms)"),
NavmeshRepData.Num() / 1024.0f, 1000.0f * (Timer3 - Timer1),
1000.0f * (Timer2 - Timer1),
FMath::TruncToInt(100.0f * NavmeshRepData.Num() / UncompressedBuffer.Num()), 1000.0f * (Timer3 - Timer2));
#endif
if (World && World->GetNetMode() != NM_DedicatedServer)
{
OnRep_UpdateNavmesh();
}
}
void UGameplayDebuggingComponent::PrepareNavMeshData(struct FNavMeshSceneProxyData* CurrentData) const
{
#if WITH_RECAST
if (CurrentData)
{
CurrentData->Reset();
CurrentData->bNeedsNewData = false;
// uncompress data
TArray<uint8> UncompressedBuffer;
const int32 HeaderSize = sizeof(int32);
if (NavmeshRepData.Num() > HeaderSize)
{
int32 UncompressedSize = 0;
uint8* SrcBuffer = (uint8*)NavmeshRepData.GetData();
FMemory::Memcpy(&UncompressedSize, SrcBuffer, HeaderSize);
SrcBuffer += HeaderSize;
const int32 CompressedSize = NavmeshRepData.Num() - HeaderSize;
UncompressedBuffer.AddZeroed(UncompressedSize);
FCompression::UncompressMemory((ECompressionFlags)(COMPRESS_ZLIB),
(void*)UncompressedBuffer.GetData(), UncompressedSize, SrcBuffer, CompressedSize);
}
// read serialized values
CurrentData->bEnableDrawing = (UncompressedBuffer.Num() > 0);
if (!CurrentData->bEnableDrawing)
{
return;
}
FMemoryReader ArReader(UncompressedBuffer);
int32 NumTiles = 0;
ArReader << NumTiles;
int32 IndexesOffset = 0;
for (int32 iTile = 0; iTile < NumTiles; iTile++)
{
NavMeshDebug::FTileData TileData;
ArReader << TileData;
FVector OffsetLocation = TileData.Location;
TArray<FVector> Verts;
Verts.Reserve(TileData.Verts.Num());
for (int32 VertIndex = 0; VertIndex < TileData.Verts.Num(); ++VertIndex)
{
const FVector Loc = TileData.Verts[VertIndex].ToVector() + OffsetLocation;
Verts.Add(Loc);
}
CurrentData->Bounds += FBox(Verts);
for (int32 iArea = 0; iArea < TileData.Areas.Num(); iArea++)
{
const NavMeshDebug::FAreaPolys& SrcArea = TileData.Areas[iArea];
FNavMeshSceneProxyData::FDebugMeshData DebugMeshData;
DebugMeshData.ClusterColor = SrcArea.Color;
DebugMeshData.ClusterColor.A = 128;
for (int32 iTri = 0; iTri < SrcArea.Indices.Num(); iTri += 3)
{
const int32 Index0 = SrcArea.Indices[iTri + 0];
const int32 Index1 = SrcArea.Indices[iTri + 1];
const int32 Index2 = SrcArea.Indices[iTri + 2];
FVector V0 = Verts[Index0];
FVector V1 = Verts[Index1];
FVector V2 = Verts[Index2];
CurrentData->TileEdgeLines.Add(FDebugRenderSceneProxy::FDebugLine(V0 + CurrentData->NavMeshDrawOffset, V1 + CurrentData->NavMeshDrawOffset, NavMeshRenderColor_Recast_TileEdges));
CurrentData->TileEdgeLines.Add(FDebugRenderSceneProxy::FDebugLine(V1 + CurrentData->NavMeshDrawOffset, V2 + CurrentData->NavMeshDrawOffset, NavMeshRenderColor_Recast_TileEdges));
CurrentData->TileEdgeLines.Add(FDebugRenderSceneProxy::FDebugLine(V2 + CurrentData->NavMeshDrawOffset, V0 + CurrentData->NavMeshDrawOffset, NavMeshRenderColor_Recast_TileEdges));
AddTriangleHelper(DebugMeshData, Index0 + IndexesOffset, Index1 + IndexesOffset, Index2 + IndexesOffset);
}
for (int32 iVert = 0; iVert < Verts.Num(); iVert++)
{
AddVertexHelper(DebugMeshData, Verts[iVert] + CurrentData->NavMeshDrawOffset);
}
CurrentData->MeshBuilders.Add(DebugMeshData);
IndexesOffset += Verts.Num();
}
for (int32 i = 0; i < TileData.Links.Num(); i++)
{
const NavMeshDebug::FOffMeshLink& SrcLink = TileData.Links[i];
const FVector V0 = SrcLink.Left.ToVector() + OffsetLocation + CurrentData->NavMeshDrawOffset;
const FVector V1 = SrcLink.Right.ToVector() + OffsetLocation + CurrentData->NavMeshDrawOffset;
const FColor LinkColor = SrcLink.Color;
CacheArc(CurrentData->NavLinkLines, V0, V1, 0.4f, 4, LinkColor, LinkLines_LineThickness);
const FVector VOffset(0, 0, FVector::Dist(V0, V1) * 1.333f);
CacheArrowHead(CurrentData->NavLinkLines, V1, V0+VOffset, 30.f, LinkColor, LinkLines_LineThickness);
if (SrcLink.PackedFlags.Direction)
{
CacheArrowHead(CurrentData->NavLinkLines, V0, V1+VOffset, 30.f, LinkColor, LinkLines_LineThickness);
}
// if the connection as a whole is valid check if there are any of ends is invalid
if (LinkColor != NavMeshRenderColor_OffMeshConnectionInvalid)
{
if (SrcLink.PackedFlags.Direction && (SrcLink.PackedFlags.ValidEnds & FRecastDebugGeometry::OMLE_Left) == 0)
{
// left end invalid - mark it
DrawWireCylinder(CurrentData->NavLinkLines, V0, FVector(1, 0, 0), FVector(0, 1, 0), FVector(0, 0, 1), NavMeshRenderColor_OffMeshConnectionInvalid, SrcLink.PackedFlags.Radius, 30 /*NavMesh->AgentMaxStepHeight*/, 16, 0, DefaultEdges_LineThickness);
}
if ((SrcLink.PackedFlags.ValidEnds & FRecastDebugGeometry::OMLE_Right) == 0)
{
DrawWireCylinder(CurrentData->NavLinkLines, V1, FVector(1, 0, 0), FVector(0, 1, 0), FVector(0, 0, 1), NavMeshRenderColor_OffMeshConnectionInvalid, SrcLink.PackedFlags.Radius, 30 /*NavMesh->AgentMaxStepHeight*/, 16, 0, DefaultEdges_LineThickness);
}
}
}
}
}
#endif
}
//----------------------------------------------------------------------//
// rendering
//----------------------------------------------------------------------//
class FPathDebugRenderSceneProxy : public FDebugRenderSceneProxy
{
public:
FPathDebugRenderSceneProxy(const UPrimitiveComponent* InComponent, const FString &InViewFlagName)
: FDebugRenderSceneProxy(InComponent)
{
DrawType = FDebugRenderSceneProxy::SolidAndWireMeshes;
DrawAlpha = 90;
ViewFlagName = InViewFlagName;
ViewFlagIndex = uint32(FEngineShowFlags::FindIndexByName(*ViewFlagName));
bWantsSelectionOutline = false;
}
FPrimitiveViewRelevance GetViewRelevance(const FSceneView* View) const override
{
FPrimitiveViewRelevance Result;
Result.bDrawRelevance = View->Family->EngineShowFlags.GetSingleFlag(ViewFlagIndex);// IsShown(View);
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucencyRelevance = Result.bNormalTranslucencyRelevance = IsShown(View);
return Result;
}
};
FPrimitiveSceneProxy* UGameplayDebuggingComponent::CreateSceneProxy()
{
FDebugRenderSceneCompositeProxy* CompositeProxy = NULL;
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
AGameplayDebuggingReplicator* Replicator = Cast<AGameplayDebuggingReplicator>(GetOwner());
if (!World || World->GetNetMode() == NM_DedicatedServer)
{
return NULL;
}
if (!Replicator || !Replicator->IsDrawEnabled() || Replicator->IsPendingKill() || IsPendingKill())
{
return NULL;
}
#if WITH_RECAST
if (ShouldReplicateData(EAIDebugDrawDataView::NavMesh))
{
FNavMeshSceneProxyData NewNavmeshRenderData;
NewNavmeshRenderData.Reset();
NewNavmeshRenderData.bNeedsNewData = false;
NewNavmeshRenderData.bEnableDrawing = false;
PrepareNavMeshData(&NewNavmeshRenderData);
NavMeshBounds = NewNavmeshRenderData.Bounds.GetCenter().ContainsNaN() || NewNavmeshRenderData.Bounds.GetExtent().ContainsNaN() ? FBox(FVector(-HALF_WORLD_MAX1, -HALF_WORLD_MAX1, -HALF_WORLD_MAX1), FVector(HALF_WORLD_MAX1, HALF_WORLD_MAX1, HALF_WORLD_MAX1)) : NewNavmeshRenderData.Bounds;
CompositeProxy = CompositeProxy ? CompositeProxy : (new FDebugRenderSceneCompositeProxy(this));
CompositeProxy->AddChild(new FRecastRenderingSceneProxy(this, &NewNavmeshRenderData, true));
}
#endif
#if USE_EQS_DEBUGGER
if (ShouldReplicateData(EAIDebugDrawDataView::EQS) && IsClientEQSSceneProxyEnabled() && GetSelectedActor() != NULL)
{
const int32 EQSIndex = EQSLocalData.Num() > 0 ? FMath::Clamp(CurrentEQSIndex, 0, EQSLocalData.Num() - 1) : INDEX_NONE;
if (EQSLocalData.IsValidIndex(EQSIndex))
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
{
CompositeProxy = CompositeProxy ? CompositeProxy : (new FDebugRenderSceneCompositeProxy(this));
auto& CurrentLocalData = EQSLocalData[EQSIndex];
FString ViewFlagName = TEXT("Game");
#if WITH_EDITOR
UEditorEngine* EEngine = Cast<UEditorEngine>(GEngine);
if (EEngine && EEngine->bIsSimulatingInEditor)
{
ViewFlagName = TEXT("DebugAI");
}
#endif
CompositeProxy->AddChild(new FEQSSceneProxy(this, ViewFlagName, CurrentLocalData.SolidSpheres, CurrentLocalData.Texts));
Merging using UE4-Fortnite-To-UE4 from CL 2261973 Includes the following engine-level changes (among others; biggest change is enabling world assets by default): CL 2252857 added dynamic allocations for path finding, removed hardcoded limit of 128 polys in path corridor CL 2256142 Added support for native arrays in JSON object converter. - Permissive in treating arrays of size 1 and scalars as equivalent - Excess elements in JSON are ignored. Serialization succeeds but a warning is logged CL 2256073 Fixed a bug in ARecastNavMesh::BatchRaycast resulting in NaN hit locations CL 2253797 #UE4 More aggressively setting RF_Public and RF_Standalone flags on maps and ensuring world names match package names. This is necessary because umaps are currently being managed outside of the content browser and it is causing a few issues. Also, packages containing maps now synthesize asset data when the package contains absolutely no asset data (probably because the UWorld in it was not RF_Public at the time it was saved due to a previous bug). CL 2258142 #UE4 Added a GC during map load that reclaims memory allocated during load/init. This is needed to finish the load on low-memory devices in games that allocate more memory after load. CL 2247003 Added homing to ProjectileMovementComponent - Homing requires both a bool and a target component to be set, the strength is determined by a customizable variable - Both homing and gravity are now applied in the new virtual function "CalculateAcceleration" CL 2247249 Moved the homing modification to acceleration occur in a separate function specifically for homing CL 2257043 - Guard net dormancy calls against executing on clients, based on thread with DaveR and JohnP; This particular case was the result of an intentionally client-authoritative actor calling the dormancy functions via inheritance CL 2245629 #UE4 - fixed json TryGetNumber to round negatives appropriately CL 2255312 #UE4 Enabling World Assets by default. CL 2260956 Analytics ET now loads HTTP at StartupModule so the module will be available during ShutdownModule to flush events CL 2245571 GenericTeamAgentInterface can now retrieve attitude of an agent towards a given actor #UE4 - Made PerceptionSystem's sight sense take advantage of that CL 2246897 Fixed perception listeners not being removed from the PerceptionSystem on Owner's end play #UE4 - addresses TTP#343392 CL 2260634 added more debug data for NaN in crowd simulation CL 2248387 Added possibility to debug multiple EQS queries with GameplayDebugger. #ue4 Fixed network replication from bandwidth point of view for data in GameplayDebugger. #ue4 CL 2253281 Added additional information to the visual logger for UBTCompositeNode::DoDecoratorsAllowExecution - We now keep track of whether a decorator allows execution, in addition to the existing log for not allowing execution CL 2255310 #UE4 The world browser module now listens to WorldAdded/WorldDestroyed events instead of WorldInit/WorldCleanup events. Worlds can be initialized without being the editor world and this handles that case. CL 2258256 #UE4 Replacing the SOpenLevelDialog with a new generic SAssetDialog. This dialog will be used as a generic Open or Save As dialog for assets. [CL 2266822 by Billy Bramer in Main branch]
2014-08-21 20:30:51 -04:00
}
}
#endif // USE_EQS_DEBUGGER
const bool bDrawFullData = Replicator->GetSelectedActorToDebug() == GetSelectedActor() && GetSelectedActor() != NULL;
if (bDrawFullData && ShouldReplicateData(EAIDebugDrawDataView::Basic))
{
CompositeProxy = CompositeProxy ? CompositeProxy : (new FDebugRenderSceneCompositeProxy(this));
TArray<FDebugRenderSceneProxy::FMesh> Meshes;
TArray<FDebugRenderSceneProxy::FDebugLine> Lines;
for (FPathCorridorPolygons& CurrentPoly : PathCorridorPolygons)
{
if (CurrentPoly.Points.Num() > 2)
{
int32 LastIndex = 0;
FVector FirstVertex = CurrentPoly.Points[0];
FDebugRenderSceneProxy::FMesh TestMesh;
TestMesh.Color = CurrentPoly.Color;// FColor::Green;
for (int32 Index = 1; Index < CurrentPoly.Points.Num()-1; Index += 1)
{
TestMesh.Vertices.Add(FDynamicMeshVertex(FirstVertex));
TestMesh.Vertices.Add(FDynamicMeshVertex(CurrentPoly.Points[Index + 0]));
TestMesh.Vertices.Add(FDynamicMeshVertex(CurrentPoly.Points[Index + 1]));
TestMesh.Indices.Add(LastIndex++);
TestMesh.Indices.Add(LastIndex++);
TestMesh.Indices.Add(LastIndex++);
}
Meshes.Add(TestMesh);
}
for (int32 VIdx = 0; VIdx < CurrentPoly.Points.Num(); VIdx++)
{
Lines.Add(FDebugRenderSceneProxy::FDebugLine(
CurrentPoly.Points[VIdx],
CurrentPoly.Points[(VIdx + 1) % CurrentPoly.Points.Num()],
CurrentPoly.Color,
2)
);
}
}
FString ViewFlagName = TEXT("Game");
#if WITH_EDITOR
UEditorEngine* EEngine = Cast<UEditorEngine>(GEngine);
if (EEngine && EEngine->bIsSimulatingInEditor)
{
ViewFlagName = TEXT("DebugAI");
}
#endif
FPathDebugRenderSceneProxy *DebugSceneProxy = new FPathDebugRenderSceneProxy(this, ViewFlagName);
DebugSceneProxy->Lines = Lines;
DebugSceneProxy->Meshes = Meshes;
CompositeProxy->AddChild(DebugSceneProxy);
}
#endif //!(UE_BUILD_SHIPPING || UE_BUILD_TEST)
return CompositeProxy;
}
FBoxSphereBounds UGameplayDebuggingComponent::CalcBounds(const FTransform& LocalToWorld) const
{
FBox MyBounds;
MyBounds.Init();
#if WITH_RECAST
if (ShouldReplicateData(EAIDebugDrawDataView::NavMesh))
{
MyBounds = NavMeshBounds;
}
#endif
#if USE_EQS_DEBUGGER
if ((EQSRepData.Num() && ShouldReplicateData(EAIDebugDrawDataView::EQS)) || PathCorridorPolygons.Num())
{
MyBounds = FBox(FVector(-HALF_WORLD_MAX1, -HALF_WORLD_MAX1, -HALF_WORLD_MAX1), FVector(HALF_WORLD_MAX1, HALF_WORLD_MAX1, HALF_WORLD_MAX1));
}
#endif // USE_EQS_DEBUGGER
return MyBounds;
}
void UGameplayDebuggingComponent::CreateRenderState_Concurrent()
{
Super::CreateRenderState_Concurrent();
#if WITH_EDITOR
if (SceneProxy)
{
static_cast<FDebugRenderSceneCompositeProxy*>(SceneProxy)->RegisterDebugDrawDelgate();
}
#endif
}
void UGameplayDebuggingComponent::DestroyRenderState_Concurrent()
{
#if WITH_EDITOR
if (SceneProxy)
{
static_cast<FDebugRenderSceneCompositeProxy*>(SceneProxy)->UnregisterDebugDrawDelgate();
}
#endif
Super::DestroyRenderState_Concurrent();
}
void UGameplayDebuggingComponent::CollectPerceptionData()
{
#if USE_EQS_DEBUGGER
if (!ShouldReplicateData(EAIDebugDrawDataView::Perception))
{
return;
}
APawn* MyPawn = Cast<APawn>(GetSelectedActor());
if (MyPawn)
{
AAIController* BTAI = Cast<AAIController>(MyPawn->GetController());
if (BTAI)
{
const UAIPerceptionComponent* PerceptionComponent = BTAI->GetAIPerceptionComponent();
Copying //UE4/Dev-Framework to Dev-Main (//UE4/Dev-Main) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2720406 on 2015/10/07 by Aaron.McLeran Audio optimization Don't search for nearest listener if there's only 1 listener. Change 2720411 on 2015/10/07 by Aaron.McLeran Fixing HRTF spatialization code with recent changes to stereo spatialization. HRTF emitter posiition doesn't need to be converted to XAudio2 coordinates. Change 2723829 on 2015/10/09 by Mieszko.Zielinski Fixed NavigationSystem trying to set label of newly spawned navigation data #UE4 UE-21880 Change 2723873 on 2015/10/09 by Mieszko.Zielinski Fixed a bug in FNavAgentProperties::IsEquivalent resulting in failing the test for FNavAgentProperties instances having default AgentStepHeight value (-1) #UE4 UE-21977 Change 2724834 on 2015/10/12 by Ori.Cohen PR #1634: Add PxVehicleDriveNW support to PhysXVehicleManager.cpp (Contributed by zeduk) Change 2724850 on 2015/10/12 by Marc.Audy Fix sound not restarting in matinee preview when jumping back along timeline after reaching end #codereview Nick.Darnell Change 2726499 on 2015/10/13 by Ori.Cohen Fix edge case where sphyl length and radius are 0 and they are not properly clamped to 0.1 Change 2726689 on 2015/10/13 by Marc.Audy Make UPackage::PackageFlags private Add debugging for UE-21181 to try and track down when EditorWorld's PackageFlags are getting flagged as PlayInEditor #codereview Mike.Fricker Change 2726862 on 2015/10/13 by Lukasz.Furman removed unused code from DetourNavMeshQuery #ue4 UE-21988 Change 2726888 on 2015/10/13 by Lukasz.Furman fixed observer abort: both mode in behavior tree's cone check decorator #ue4 UE-19375 Change 2726913 on 2015/10/13 by Lukasz.Furman navmesh raycast will use nearest poly containing ray origin instead of just closest one #ue4 UE-19334 Change 2726920 on 2015/10/13 by Marc.Audy Re-unify ULevelStreaming::GetWorldAssetPackageName and GetWorldAssetPackageFName #codereview Dmitriy.Dyomin, Bob.Tellez Change 2726931 on 2015/10/13 by Lukasz.Furman fixed missing Tick event in aborting behavior tree tasks from abandoned subtree #ue4 UE-21777 Change 2728093 on 2015/10/14 by Ori.Cohen Fix edge case of sphyl scale take two. The previous approach did double scaling Change 2728577 on 2015/10/14 by Mieszko.Zielinski Improved navmesh labeling condition #UE4 Change suggested by github user #rb Lukasz.Furman Change 2728587 on 2015/10/14 by Lukasz.Furman fixed crowd simulation for auto possessed pawns placed on level #ue4 #rb Mieszko.Zielinski Change 2728629 on 2015/10/14 by Lukasz.Furman fixed influence of navmesh edges on crowd simulation near end of path #ue4 UE-21380 #rb Mieszko.Zielinski Change 2728678 on 2015/10/14 by Lukasz.Furman added Z check to detour's crowd avoidance segment gathering #ue4 UE-20889 #rb Mieszko.Zielinski Change 2728745 on 2015/10/14 by Lukasz.Furman fixed copy&paste operation in behavior tree's composite decorators subgraphs #ue4 UE-18740 Change 2729276 on 2015/10/14 by Stan.Melax ensure all actors get recreated with new collision shape specification. this wasn't being done for a couple of editing methods. todo: this should be merged into 4.10 #UE-20961 #rb ori.cohen Change 2730709 on 2015/10/15 by Marc.Audy Prevent memory corruption when an invalid controller ID is passed in to the forcefeedback channel functions #rb Lina.Halper Change 2733590 on 2015/10/19 by Benn.Gallagher Fixed various crashes when using undo and redo while manipulating state machines UE 22088 Change 2735143 on 2015/10/20 by Lukasz.Furman clearing behavior tree debugger's state when displayed subtree becomes inactive #ue4 #rb Mieszko.Zielinski Change 2735144 on 2015/10/20 by Lukasz.Furman rebuilding behavior tree graph node order when node is being moved #ue4 #rb Mieszko.Zielinski Change 2735403 on 2015/10/20 by sebastian.kowalczyk Integrated fix for issue UE-18594 "Gameplay Debugger is hijacking the Canvas" issue from 4.10 (2735391). Extended previous fix to care about OSX users - it's possible to configure shortcuts in engine config file now (little different ones for osx platform). Change 2736406 on 2015/10/21 by sebastian.kowalczyk Added new GameplayDebugger as a plugin. Old gameplay debugger is still here to keep backward compatibility but it's deprecated now. Current projects should be moved to use new plugin soon. Change 2736436 on 2015/10/21 by sebastian.kowalczyk Fixed crash in gameplay debugger with player set as debug target. Change 2736437 on 2015/10/21 by sebastian.kowalczyk Added visual indicator around selected pawn to fix FORT-10273 issue. (FN is not using new gd plugin yet). Change 2736489 on 2015/10/21 by sebastian.kowalczyk Hide internal and debug hud classes from drop down lists. Change 2736504 on 2015/10/21 by sebastian.kowalczyk Fix for UE-18548 "EnableGDT does not work correctly in PIE". Change 2736529 on 2015/10/21 by sebastian.kowalczyk Fixed UE-18548 "EnableGDT does not work correctly in PIE" Change 2736588 on 2015/10/21 by sebastian.kowalczyk Removed old log visualizer classes. Change 2736700 on 2015/10/21 by sebastian.kowalczyk Fixed UE-19256 "Perception debug data doesn't get replicated by Gameplay Debuger" for old gameplay debugger module. Change 2737180 on 2015/10/21 by Zak.Middleton #ue4 - Fix UPrimitiveComponent::GetCollisionShape not correctly enforcing bounds limits. #rb Aaron.Mcleran #jira UE-22436 Change 2738084 on 2015/10/22 by sebastian.kowalczyk Better indication of selected pawn for Gameplay Debugger. Change 2738413 on 2015/10/22 by Marc.Audy Disable duplication of worlds/maps via the content browser #jira UE-22200 #rb James.Golding Change 2739743 on 2015/10/23 by bruce.nesbit UE-18707 - Issue with drawing material triangle on canvas #1387 Added DrawTriangleUsingVertexColor Change 2739751 on 2015/10/23 by bruce.nesbit Revised bShowDebugForReticleTarget should not be static #1539 Change 2739788 on 2015/10/23 by bruce.nesbit Revised the 2 functions that used FTriangleRenderer::DrawTriangle to use FTriangleRenderer::DrawTriangleUsingVertexColor Fixed compile error Change 2739870 on 2015/10/23 by Marc.Audy Avoid issues while detaching child components if OnAttachmentChange were to remove a sibling component itself. #jira UE-22362 #rb Zak.Middleton Change 2739882 on 2015/10/23 by sebastian.kowalczyk Fix for UE-20901 "VisualLog redirections are broken after PIE finishes" issue. Change 2740140 on 2015/10/23 by Marc.Audy Ensure that components reregister tick functions after seamless travel #jira UE-20892 #rb Zak.Middleton Change 2740614 on 2015/10/23 by Ori.Cohen Fix linker issues for people wanting to use physics lock lambdas Change 2740674 on 2015/10/23 by Aaron.McLeran Sound Focus Feature Added new parameters to SoundAttenuation settings to allow audio to change behavior based on its angle to the listener - Define the min/max azimuth angle to establish in-focus and non-focus regions - Can scale the priority of a sound based on focus angle - Can attenuate the volume of a sound based on focus angle - Can scale the listener-emitter distance based on focus angle - Distance scale is applied when determining max audible distance for USoundBase - Can opt-out of focus effects for a sound at the USoundBase level #rb Ryan.Vance Change 2741542 on 2015/10/26 by Lukasz.Furman lowered min value clamping in navigation filter properties #ue4 #rb Mieszko.Zielinski Change 2743227 on 2015/10/27 by Marc.Audy Make ASceneCaptureCube subclassable outside of Engine module #jira UE-22609 Make USceneCaptureComponentCube::UpdateContent callable outside of Engine module #jira UE-22610 #rb Jeff.Farris Change 2743255 on 2015/10/27 by Marc.Audy Wrap FActorSpawnParameters class with deprecation warning disable pragma instead of hand implementing copy constructor #rb Jeff.Farris Change 2743729 on 2015/10/27 by Ori.Cohen Fix case where we spawn and adjust location which gives us implicit velocity. #codereview Stan.Melax Change 2746135 on 2015/10/29 by sebastian.kowalczyk Fixed UE-21668 "Saving log filters selected in LogVisualizer causes insane ini file sizes! And doesn't really work." Change 2746437 on 2015/10/29 by Lukasz.Furman pass on verifying behavior tree stack before accessing its elements #ue4 #rb Mieszko.Zielinski Change 2748028 on 2015/10/30 by sebastian.kowalczyk Changed GameplayDebugger's console variable from gd.EQSOnHUD to ai.gd.EQSOnHUD" after suggestion with MieszkoZ. Change 2748184 on 2015/10/30 by Aaron.McLeran UE-22693 Fix for streaming bug - 3rd decoded buffer in initial 3 buffers was not getting submitted to xaudio2 voice resulting in garbled/skipped audio. - Wasn't able to repro the 'cannot read chunk' part of the bug #rb ryan.vance Change 2749255 on 2015/10/31 by sebastian.kowalczyk Fixed ai.gd.EQSOnHUD console variable after rename from gd.EQSOnHUD. Change 2749276 on 2015/10/31 by sebastian.kowalczyk Added switch to toggle highlight of selected actor to GameplayDebugger. Change 2749318 on 2015/10/31 by sebastian.kowalczyk New Gameplay Debugger plugin can be used with old module simultaneously. It's best to configure different keyboard binding for plugin when using old module (it can be set in project settings, for new gameplay debugger plugin - when activated for project). Change 2749337 on 2015/10/31 by sebastian.kowalczyk Fixed GameplayDebugger compilation in shipping/test builds. Change 2749376 on 2015/10/31 by sebastian.kowalczyk Small clean-up in gameplay debugger class for BT. Change 2749931 on 2015/11/02 by James.Golding Add stats to ProcMeshComp Change 2749932 on 2015/11/02 by James.Golding Remove PhysicsThrusterComponent.h from Engine.h Change 2749960 on 2015/11/02 by James.Golding - Fix PS4 compile errors in ActiveSound.cpp - Constructor order of FActiveSound - Shadowed AudioComponent var in CheckOcclusion #RB thomas.sarkanen #codereview aaron.mcleran Change 2749961 on 2015/11/02 by James.Golding Fix PS4 compile errors in GameplayDebuggerBaseObject.cpp - Shadowed DefaultContext function param, now just Context, which matches declaration #RB thomas.sarkanen #codereview sebastian.kowalczyk Change 2750026 on 2015/11/02 by Thomas.Sarkanen Anim Multithreading: thread-safety refactor Segregated access to various parts of anim update data by spitting off a new proxy class (FAnimInstanceProxy) containing all data accessed in Update() and Evaluate() passes. Gated access to the proxy data on the game thread in a number of ways: - Explicit access via GetValueOnGameThread() - this blocks on any existing task, completes and then allows control to return to the accessing function. This allows stuff like Blueprints to continue to operate as normal. - Explicit access via GetValueOnAnyThread() - this ensures that in the limited set of circumstances we need this (Blueprint pure functions mostly) that conditions are met about concurrent access. - Deprecating many APIs on UAnimInstance that should not be used (and in fact are not used at present, happily). Derived classes of UAnimInstance can override the creation of the proxy class to create their own type. We do this for UAnimSingleNodeInstance etc. Any API deprecation should continue to function - no functions have been removed yet. The only things that are not backwards-compatible are direct access to some public member variables for which there is no way to support (e.g. via references, for example UngroupedActivePlayerArrays). Some APIs have been changed to more specifically represent the dependencies involved. For example TickAssetPlayerInstance() used to take a UAnimInstance*, only to use it to simply queue notifies. This has been deprecated and replaced with a new FNotifyQueue API. FNotifyQueue also uses a thread-safe FRandomStream instead of FMath::Rand. Many changes are due to substituting accessor functions for direct variable access. Removed 'service' tick group as we no longer need to segregate the running of our parallel update. Anim nodes that need to do some game thread-side update should register for a pre-update callback delegate in the proxy. See FAnimNode_AnimDynamics for an example of this. Moved UpdateActiveVertexAnims into FAnimRuntime so I can subsume some of the code that was in USkeletalMeshComponent::EvaluateAnimation into UAnimInstance (and hence keep the proxy access private). #rb Martin.Wilson,Lina.Halper #codereview Michael.Noland Change 2750077 on 2015/11/02 by Marc.Audy Expose UInputComponent::BindAction that supports WithKey delegate signature Change 2751767 on 2015/11/03 by Thomas.Sarkanen Added extra support to Anim Blueprint 'fast-path' Added support for negated bools (value gets negated during copy). Added support for copying from struct members (via break struct) and split struct pins. Removed potentially troublesome references to BP-constructed UProperties, replacing them with the property FName. This adds some extra Initialize() overhead, but prevents various crash-on load issues (one when generating the class CRC). Added guard to prevent multiple initialization to save this more expensive work being done more often. #rb Martin.Wilson Change 2752158 on 2015/11/03 by Jeff.Farris Fixed UGameplayStatics::SpawnEmitterAttached() to register the ParticleSystemComponent after it spawns. #rb marc.audy Change 2752159 on 2015/11/03 by Jeff.Farris Improvements to camera lens effects to (EmitterCameraLensEffectBase) - can now specify a transform to align the emitter with the camera - exposed several key parameters to Blueprints - ENGINE_API now applies to the entire class #rb marc.audy Change 2753454 on 2015/11/04 by Thomas.Sarkanen Fixup deprecation warnings fallout from multithreaded update changes. Fixed up use of AnimInstance in Vicon plugin. Fixed up use of AnimInstance in slope warping node. Un-deprecated some APIs to become warning free (these APIs are safe to call but just a 'bad idea if you want to do it right'). Also an extra API to allow for smoother transition: Allow custom allocation/deallocation (including using a proxy member struct) by providing an override point for proxy destruction. #rb Martin.Wilson Change 2754099 on 2015/11/04 by Ori.Cohen Fix for task threads dropping stats (from Gil) #rb Gil.Gribb Change 2754449 on 2015/11/04 by Marc.Audy Ensure that components created from an Actor's blueprint BeginPlay implementation get BeginPlay called on them and register their component ticks #jira UE-20853 Reorganize some booleans to get better bit packing #rb Jeff.Farris #codereview Mieszko.Zielinski Change 2754573 on 2015/11/04 by Aaron.McLeran Fixing audio component PostLoad code to not set all LowPassFilterFrequency values to 0.0f Change 2755345 on 2015/11/05 by Thomas.Sarkanen Added deprecated constructors for various animation contexts Allows existing code to compile if it creates its own contexts from UAnimInstance. #rb James.Golding Change 2755348 on 2015/11/05 by James.Golding Add BP-exposed SetBoundsScale function to PrimitiveComponent #RB thomas.sarkanen Change 2755437 on 2015/11/05 by Marc.Audy Fix compile errors #codereview Thomas.Sarkanen, Mieszko.Zielinski, Aaron.McLeran Change 2755982 on 2015/11/05 by Marc.Audy Move HeaderParse changes for deprecation macro from Core Fix world settings warning Change 2756028 on 2015/11/05 by Marc.Audy Fix shadow variable issue Change 2756090 on 2015/11/05 by Ori.Cohen Improve budget tool so that task threads are computed automatically. #rb Gil.Gribb Change 2756120 on 2015/11/05 by Mieszko.Zielinski Fixed AIController::MoveTo not using DefaultQueryExtent of its navigation data #UE4 #rb Lukasz.Furman Change 2756243 on 2015/11/05 by Mieszko.Zielinski Fixed AI perception sight's "auto-visibility" mechanism totally skipping distance and vision cone checks #UE4 The old way was resulting in false positives when for example observer teleported somewhere far #rb Lukasz.Furman #codereview John.Abercrombie Change 2756280 on 2015/11/05 by Mieszko.Zielinski Minor VLog code cleanup and dumb-fixing visual logger accessing timer manager off of game thread #UE4 #rb Lukasz.Furman Change 2756500 on 2015/11/05 by Mieszko.Zielinski Added sanity-checking to BlueprintNodeHelpers::HasBlueprintFunction and cleaned up its usage #UE4 Also, refactored its parameters into references over pointers. #rb Lukasz.Furman Change 2757041 on 2015/11/06 by Thomas.Sarkanen Removed check() in UAnimInstance::GetProxyOnAnyThread() The check was no longer needed as if we are on the game thread we block until tasks are completed below, and if we are on any other thread we are 'safe' anyway. #rb James.Golding Change 2757207 on 2015/11/06 by Ori.Cohen Fix incorrect root body cache which causes a single frame "freak out" when simulating physics from an animation #rb Lina.Halper Change 2757238 on 2015/11/06 by Marc.Audy Force compiler generated functions to be generated for FHierarchicalSimplification in WorldSettings.h so that they are generated while the deprecation warnings are disabled. #rb Mike.Fricker Change 2757284 on 2015/11/06 by Stan.Melax tapered capsule drawing cloth collision happens with spheres and for the hull or tapered capsule goemetry between any specified pair of spheres. (this was already code reviewed before, but missed the check-in window before streamtime) #rb ori.cohen Change 2757743 on 2015/11/06 by Lukasz.Furman fixed node memory allocations for injected behavior tree decorators #ue4 UE-22783 #rb Mieszko.Zielinski Change 2757772 on 2015/11/06 by Lukasz.Furman added setters for crowd avoidance #ue4 UE-22785 #rb Mieszko.Zielinski Change 2758422 on 2015/11/07 by Lina.Halper Potential fix for invalid root bone index input #jira :/UE-23086 #code review: Ori.Cohen Change 2758429 on 2015/11/07 by Mieszko.Zielinski Reimplemented a fix for AI Sight's "auto seeing" mechanics in a more flexible way #UE4 #jira UE-23089 Change 2758571 on 2015/11/08 by Mieszko.Zielinski Modified ensure condition in UAIPerceptionComponent::OnRegister so it doesn't go off when BP does it's magic when components are being added to a BP actor class #UE4 #jira UE-23080 Change 2758821 on 2015/11/09 by Thomas.Sarkanen Fixed animations no longer playing when using a dedicated server. Uses correct logic to determine whether we are running as a server or not. #rb Martin.Wilson Change 2758920 on 2015/11/09 by Marc.Audy Don't dereference weak object pointers repeatedly in FBoneContainer::Initialize #rb Lina.Halper Change 2758944 on 2015/11/09 by Ori.Cohen Fix crash when stats are only on one thread and budget mode is used Change 2758967 on 2015/11/09 by Benn.Gallagher Fix for crash undoing notify socket changes in Persona, needed to recache the notify track data after the transaction had reserialized the sequence. #jira UE-22963 Change 2758973 on 2015/11/09 by Benn.Gallagher Added new 'Random Player' node for anim graphs allowing the user to play a selection of animations in a random order with certain randomised paramers. Also allows 'Shuffle Mode' to act more like a playlist in that it will play everything on the list before repeating. #rb Bruce.Nesbit Change 2759219 on 2015/11/09 by Ori.Cohen Character perf test is now looking at stats directly and sending to analytics #RB Ben.Salem Change 2759398 on 2015/11/09 by Lina.Halper Fix issue where placed montages are not playing. - the issue is that IsPlaying does not consider montage, but SetPlaying does. It is asymmetry, so I made it same. However, there are other functions that need to be re-looked at wr.t. montage #code review: Thomas.Sarkanen #RB: Marc.Audy Change 2759491 on 2015/11/09 by Lina.Halper #Anim: Fix not getting input correctly for Copy Pose node #RB: Marc.Audy Change 2759602 on 2015/11/09 by Marc.Audy Fix imporperly named struct Change 2759795 on 2015/11/09 by Aaron.McLeran UE-23145 Adding a Priority value to USoundBase to use in concurrency evaluation and sorting wave instances for voice stealing. #rb zak.middleton Change 2760081 on 2015/11/09 by Aaron.McLeran UE-23091 Adding more logging for NaN checks and fixing one source of NaNs for audio. OmniDirectional Math Explanation: For XAudio2, because we do our own distance-attenuation calculations, we use the X3dAudio2 API to simply compute a speaker-map for spatialization and force the listener to be at the origin and the emitter to be on the unit-circle. Thus, from XAudio2's perspective, all distances for every listener-emitter pair will be 1.0. So in order to use the InnerRadius blending feature, we need to trick it into doing a an inner radius blend relative to a distance of 1.0. For example, if OmniRadius and Distance are the same, then the "NormalizedOmniRadius" is 1.0 and XAudio2 will begin its "blend" of the sound to an omni-directional speaker map. If Emitter-listener distance is less than the OmniRadius, we'll want to do more blending to an omni-directional speaker map, but we need to set the InnerRadius to something greater than 1.0 (i.e. so that the normalized distance of 1.0 will be treated as less than the InnerRadius). To do "full" omni-directional blending, the emitter-listener distance will be 0 or close to zero, and the NormalizedOmniRadius will be very large (i.e. close to infiinity). The previous math just set the NormalizedOmniRadius to FLT_MAX which is fine but that number is eventually squared before making the API call. FLT_MAX squared is INF. Note: I do not think we need to square the OmniRadius in: Emitter.InnerRadius = OmniRadius*OmniRadius; But I am keeping it t here because of legacy content which depends on that behavior. #rb zak.middleton hange 2760401 on 2015/11/10 by Thomas.Sarkanen@Thomas.Sarkanen-Dev-Framework Re-instated deleted protected functions in UAnimInstance. Fixed access of UAnimInstance in FAnimNode_StateMachine. #rb Martin.Wilson Change 2760407 on 2015/11/10 by Jurre.deBaare Construct raw meshes for spline meshes now uses the render data instead of original model data (preserves tangents/normals) Change 2760468 on 2015/11/10 by Benn.Gallagher Anim Dynamics optimizations, cached iteration independant data to reduce footprint of iteration on limits. #rb Graeme.Thornton Change 2760613 on 2015/11/10 by Jeff.Farris Fixed async collision completion delegate potentially firing repeatedly. (UE-23149) #cr marc.audy #codereview lina.halper Change 2760795 on 2015/11/10 by Marc.Audy Don't compile in pointless AddReferencedObjects when with editoronly data not defined Minor coding standard cleanup (NULL and auto) Change 2760848 on 2015/11/10 by Benn.Gallagher Fix to anim instance proxy to not rely on state machine initialization to bind native delegates as nested state machines are not guaranteed to be initialized. This was fixed in UAnimInstance originally but broken again by the proxy instance code. #jira UE-23164 #rb Martin.Wilson Change 2760866 on 2015/11/10 by Marc.Audy Manage transient visualization components for camera component in the same way that sprite component for other actor components are #rb Mike.Beach Change 2760963 on 2015/11/10 by Marc.Audy Since construction script can cause actors to be spawned don't use a ranged for to iterate #jira UE-22639 #rb Jeff.Farris #codereview Dmitriy.Dyomin Change 2762297 on 2015/11/11 by James.Golding UE-23086 Don't ensure in SetRootBodyIndex when Bodies array is empty (ie no physics state created) #rb martin.wilson #codereview ori.cohen, lina.halper Change 2763566 on 2015/11/11 by Lina.Halper FAnimNode_CopyPoseFromMesh::Evaluate - was accessing skeleton joint, not mesh joint. #RB: Laurent.Delayen Change 2763926 on 2015/11/12 by Thomas.Sarkanen Fix anim notifies not firing from single anim instances UE-23248 - Anim Notifies are not working for Animation Sequences UE-23249 - Anim Notifies using Sound Cues do not work #rb James.Golding Change 2764039 on 2015/11/12 by Jurre.deBaare Fix for issue with incorrect material indices after reducing a skeletal mesh with non LOD0 mesh as BaseLOD (OR-9243) #rb Lina.Halper Change 2764307 on 2015/11/12 by Jurre.deBaare VS2015 SSF library Change 2764314 on 2015/11/12 by Stan.Melax crashfix was putting bad bodies to sleep at start Fatal error! Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000 UE4Editor-Engine.dll!USkeletalMeshComponent::InitArticulated() [...\\engine\\source\\runtime\\engine\\private\\skeletalmeshcomponentphysics.cpp:875] On some skeletalmeshcomponent, some bodies aren't getting created correctly. Trying to force them to sleep was causing a crash - it expected instantiated physx bodies. Seems that all the rest of the code is able to tolerate bad bodies. Added check to ensure physx body exists before trying to force it to sleep. not sure if bad bodies are the norm or if this fix is just more "kicking the can down the road". #codereview ori.cohen Change 2764343 on 2015/11/12 by Jurre.deBaare - Fixed crash when building a LOD with SubActors.Num < 2 - Force HLOD level slider is now always enabled, however won't show complete image if not all HLODs are build - LODActor tree view item now scrolls into view if selected in the world - Set bAllowCullDistanceVolume to false for LODActor's static mesh components by default - Added 7zip files - Fixed issue with WinINet complaining about http-request without 'http://' prefix - Changed % reduced or original triangles display string, now uses float instead of int (for < 1% reductions) - Override texture sizes and automatic texture bias - Fixed issue with incorrect material merging, not picking up it required mesh-data during baking. Added extra conditions for rendering with mesh-data. - Now incorporate static meshes with opague materials into HLOD merging - Fixed issue with incorrect normals after merging meshes who's owning components had been negatively scaled - Fixed issue with incorrect texture size being set from MergeActor window (was only changing .X component) - Fixed issue with material merging when meshes with multiple LODs are merged, right now only merges LOD0's together if we are also merging the materials (otherwise, merge each LOD) - Added ENUM for texture scaling/resizing type that has to be applied while merging the materials - Added detail customization class for FMaterialProxySettings #rb James.Golding [CL 2765024 by Marc Audy in Main branch]
2015-11-12 18:11:48 -05:00
if (PerceptionComponent == nullptr)
{
PerceptionComponent = MyPawn->FindComponentByClass<UAIPerceptionComponent>();
}
if (PerceptionComponent)
{
TArray<FString> PerceptionTexts;
PerceptionShapeElements.Reset();
Copying //UE4/Dev-Framework to Dev-Main (//UE4/Dev-Main) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2720406 on 2015/10/07 by Aaron.McLeran Audio optimization Don't search for nearest listener if there's only 1 listener. Change 2720411 on 2015/10/07 by Aaron.McLeran Fixing HRTF spatialization code with recent changes to stereo spatialization. HRTF emitter posiition doesn't need to be converted to XAudio2 coordinates. Change 2723829 on 2015/10/09 by Mieszko.Zielinski Fixed NavigationSystem trying to set label of newly spawned navigation data #UE4 UE-21880 Change 2723873 on 2015/10/09 by Mieszko.Zielinski Fixed a bug in FNavAgentProperties::IsEquivalent resulting in failing the test for FNavAgentProperties instances having default AgentStepHeight value (-1) #UE4 UE-21977 Change 2724834 on 2015/10/12 by Ori.Cohen PR #1634: Add PxVehicleDriveNW support to PhysXVehicleManager.cpp (Contributed by zeduk) Change 2724850 on 2015/10/12 by Marc.Audy Fix sound not restarting in matinee preview when jumping back along timeline after reaching end #codereview Nick.Darnell Change 2726499 on 2015/10/13 by Ori.Cohen Fix edge case where sphyl length and radius are 0 and they are not properly clamped to 0.1 Change 2726689 on 2015/10/13 by Marc.Audy Make UPackage::PackageFlags private Add debugging for UE-21181 to try and track down when EditorWorld's PackageFlags are getting flagged as PlayInEditor #codereview Mike.Fricker Change 2726862 on 2015/10/13 by Lukasz.Furman removed unused code from DetourNavMeshQuery #ue4 UE-21988 Change 2726888 on 2015/10/13 by Lukasz.Furman fixed observer abort: both mode in behavior tree's cone check decorator #ue4 UE-19375 Change 2726913 on 2015/10/13 by Lukasz.Furman navmesh raycast will use nearest poly containing ray origin instead of just closest one #ue4 UE-19334 Change 2726920 on 2015/10/13 by Marc.Audy Re-unify ULevelStreaming::GetWorldAssetPackageName and GetWorldAssetPackageFName #codereview Dmitriy.Dyomin, Bob.Tellez Change 2726931 on 2015/10/13 by Lukasz.Furman fixed missing Tick event in aborting behavior tree tasks from abandoned subtree #ue4 UE-21777 Change 2728093 on 2015/10/14 by Ori.Cohen Fix edge case of sphyl scale take two. The previous approach did double scaling Change 2728577 on 2015/10/14 by Mieszko.Zielinski Improved navmesh labeling condition #UE4 Change suggested by github user #rb Lukasz.Furman Change 2728587 on 2015/10/14 by Lukasz.Furman fixed crowd simulation for auto possessed pawns placed on level #ue4 #rb Mieszko.Zielinski Change 2728629 on 2015/10/14 by Lukasz.Furman fixed influence of navmesh edges on crowd simulation near end of path #ue4 UE-21380 #rb Mieszko.Zielinski Change 2728678 on 2015/10/14 by Lukasz.Furman added Z check to detour's crowd avoidance segment gathering #ue4 UE-20889 #rb Mieszko.Zielinski Change 2728745 on 2015/10/14 by Lukasz.Furman fixed copy&paste operation in behavior tree's composite decorators subgraphs #ue4 UE-18740 Change 2729276 on 2015/10/14 by Stan.Melax ensure all actors get recreated with new collision shape specification. this wasn't being done for a couple of editing methods. todo: this should be merged into 4.10 #UE-20961 #rb ori.cohen Change 2730709 on 2015/10/15 by Marc.Audy Prevent memory corruption when an invalid controller ID is passed in to the forcefeedback channel functions #rb Lina.Halper Change 2733590 on 2015/10/19 by Benn.Gallagher Fixed various crashes when using undo and redo while manipulating state machines UE 22088 Change 2735143 on 2015/10/20 by Lukasz.Furman clearing behavior tree debugger's state when displayed subtree becomes inactive #ue4 #rb Mieszko.Zielinski Change 2735144 on 2015/10/20 by Lukasz.Furman rebuilding behavior tree graph node order when node is being moved #ue4 #rb Mieszko.Zielinski Change 2735403 on 2015/10/20 by sebastian.kowalczyk Integrated fix for issue UE-18594 "Gameplay Debugger is hijacking the Canvas" issue from 4.10 (2735391). Extended previous fix to care about OSX users - it's possible to configure shortcuts in engine config file now (little different ones for osx platform). Change 2736406 on 2015/10/21 by sebastian.kowalczyk Added new GameplayDebugger as a plugin. Old gameplay debugger is still here to keep backward compatibility but it's deprecated now. Current projects should be moved to use new plugin soon. Change 2736436 on 2015/10/21 by sebastian.kowalczyk Fixed crash in gameplay debugger with player set as debug target. Change 2736437 on 2015/10/21 by sebastian.kowalczyk Added visual indicator around selected pawn to fix FORT-10273 issue. (FN is not using new gd plugin yet). Change 2736489 on 2015/10/21 by sebastian.kowalczyk Hide internal and debug hud classes from drop down lists. Change 2736504 on 2015/10/21 by sebastian.kowalczyk Fix for UE-18548 "EnableGDT does not work correctly in PIE". Change 2736529 on 2015/10/21 by sebastian.kowalczyk Fixed UE-18548 "EnableGDT does not work correctly in PIE" Change 2736588 on 2015/10/21 by sebastian.kowalczyk Removed old log visualizer classes. Change 2736700 on 2015/10/21 by sebastian.kowalczyk Fixed UE-19256 "Perception debug data doesn't get replicated by Gameplay Debuger" for old gameplay debugger module. Change 2737180 on 2015/10/21 by Zak.Middleton #ue4 - Fix UPrimitiveComponent::GetCollisionShape not correctly enforcing bounds limits. #rb Aaron.Mcleran #jira UE-22436 Change 2738084 on 2015/10/22 by sebastian.kowalczyk Better indication of selected pawn for Gameplay Debugger. Change 2738413 on 2015/10/22 by Marc.Audy Disable duplication of worlds/maps via the content browser #jira UE-22200 #rb James.Golding Change 2739743 on 2015/10/23 by bruce.nesbit UE-18707 - Issue with drawing material triangle on canvas #1387 Added DrawTriangleUsingVertexColor Change 2739751 on 2015/10/23 by bruce.nesbit Revised bShowDebugForReticleTarget should not be static #1539 Change 2739788 on 2015/10/23 by bruce.nesbit Revised the 2 functions that used FTriangleRenderer::DrawTriangle to use FTriangleRenderer::DrawTriangleUsingVertexColor Fixed compile error Change 2739870 on 2015/10/23 by Marc.Audy Avoid issues while detaching child components if OnAttachmentChange were to remove a sibling component itself. #jira UE-22362 #rb Zak.Middleton Change 2739882 on 2015/10/23 by sebastian.kowalczyk Fix for UE-20901 "VisualLog redirections are broken after PIE finishes" issue. Change 2740140 on 2015/10/23 by Marc.Audy Ensure that components reregister tick functions after seamless travel #jira UE-20892 #rb Zak.Middleton Change 2740614 on 2015/10/23 by Ori.Cohen Fix linker issues for people wanting to use physics lock lambdas Change 2740674 on 2015/10/23 by Aaron.McLeran Sound Focus Feature Added new parameters to SoundAttenuation settings to allow audio to change behavior based on its angle to the listener - Define the min/max azimuth angle to establish in-focus and non-focus regions - Can scale the priority of a sound based on focus angle - Can attenuate the volume of a sound based on focus angle - Can scale the listener-emitter distance based on focus angle - Distance scale is applied when determining max audible distance for USoundBase - Can opt-out of focus effects for a sound at the USoundBase level #rb Ryan.Vance Change 2741542 on 2015/10/26 by Lukasz.Furman lowered min value clamping in navigation filter properties #ue4 #rb Mieszko.Zielinski Change 2743227 on 2015/10/27 by Marc.Audy Make ASceneCaptureCube subclassable outside of Engine module #jira UE-22609 Make USceneCaptureComponentCube::UpdateContent callable outside of Engine module #jira UE-22610 #rb Jeff.Farris Change 2743255 on 2015/10/27 by Marc.Audy Wrap FActorSpawnParameters class with deprecation warning disable pragma instead of hand implementing copy constructor #rb Jeff.Farris Change 2743729 on 2015/10/27 by Ori.Cohen Fix case where we spawn and adjust location which gives us implicit velocity. #codereview Stan.Melax Change 2746135 on 2015/10/29 by sebastian.kowalczyk Fixed UE-21668 "Saving log filters selected in LogVisualizer causes insane ini file sizes! And doesn't really work." Change 2746437 on 2015/10/29 by Lukasz.Furman pass on verifying behavior tree stack before accessing its elements #ue4 #rb Mieszko.Zielinski Change 2748028 on 2015/10/30 by sebastian.kowalczyk Changed GameplayDebugger's console variable from gd.EQSOnHUD to ai.gd.EQSOnHUD" after suggestion with MieszkoZ. Change 2748184 on 2015/10/30 by Aaron.McLeran UE-22693 Fix for streaming bug - 3rd decoded buffer in initial 3 buffers was not getting submitted to xaudio2 voice resulting in garbled/skipped audio. - Wasn't able to repro the 'cannot read chunk' part of the bug #rb ryan.vance Change 2749255 on 2015/10/31 by sebastian.kowalczyk Fixed ai.gd.EQSOnHUD console variable after rename from gd.EQSOnHUD. Change 2749276 on 2015/10/31 by sebastian.kowalczyk Added switch to toggle highlight of selected actor to GameplayDebugger. Change 2749318 on 2015/10/31 by sebastian.kowalczyk New Gameplay Debugger plugin can be used with old module simultaneously. It's best to configure different keyboard binding for plugin when using old module (it can be set in project settings, for new gameplay debugger plugin - when activated for project). Change 2749337 on 2015/10/31 by sebastian.kowalczyk Fixed GameplayDebugger compilation in shipping/test builds. Change 2749376 on 2015/10/31 by sebastian.kowalczyk Small clean-up in gameplay debugger class for BT. Change 2749931 on 2015/11/02 by James.Golding Add stats to ProcMeshComp Change 2749932 on 2015/11/02 by James.Golding Remove PhysicsThrusterComponent.h from Engine.h Change 2749960 on 2015/11/02 by James.Golding - Fix PS4 compile errors in ActiveSound.cpp - Constructor order of FActiveSound - Shadowed AudioComponent var in CheckOcclusion #RB thomas.sarkanen #codereview aaron.mcleran Change 2749961 on 2015/11/02 by James.Golding Fix PS4 compile errors in GameplayDebuggerBaseObject.cpp - Shadowed DefaultContext function param, now just Context, which matches declaration #RB thomas.sarkanen #codereview sebastian.kowalczyk Change 2750026 on 2015/11/02 by Thomas.Sarkanen Anim Multithreading: thread-safety refactor Segregated access to various parts of anim update data by spitting off a new proxy class (FAnimInstanceProxy) containing all data accessed in Update() and Evaluate() passes. Gated access to the proxy data on the game thread in a number of ways: - Explicit access via GetValueOnGameThread() - this blocks on any existing task, completes and then allows control to return to the accessing function. This allows stuff like Blueprints to continue to operate as normal. - Explicit access via GetValueOnAnyThread() - this ensures that in the limited set of circumstances we need this (Blueprint pure functions mostly) that conditions are met about concurrent access. - Deprecating many APIs on UAnimInstance that should not be used (and in fact are not used at present, happily). Derived classes of UAnimInstance can override the creation of the proxy class to create their own type. We do this for UAnimSingleNodeInstance etc. Any API deprecation should continue to function - no functions have been removed yet. The only things that are not backwards-compatible are direct access to some public member variables for which there is no way to support (e.g. via references, for example UngroupedActivePlayerArrays). Some APIs have been changed to more specifically represent the dependencies involved. For example TickAssetPlayerInstance() used to take a UAnimInstance*, only to use it to simply queue notifies. This has been deprecated and replaced with a new FNotifyQueue API. FNotifyQueue also uses a thread-safe FRandomStream instead of FMath::Rand. Many changes are due to substituting accessor functions for direct variable access. Removed 'service' tick group as we no longer need to segregate the running of our parallel update. Anim nodes that need to do some game thread-side update should register for a pre-update callback delegate in the proxy. See FAnimNode_AnimDynamics for an example of this. Moved UpdateActiveVertexAnims into FAnimRuntime so I can subsume some of the code that was in USkeletalMeshComponent::EvaluateAnimation into UAnimInstance (and hence keep the proxy access private). #rb Martin.Wilson,Lina.Halper #codereview Michael.Noland Change 2750077 on 2015/11/02 by Marc.Audy Expose UInputComponent::BindAction that supports WithKey delegate signature Change 2751767 on 2015/11/03 by Thomas.Sarkanen Added extra support to Anim Blueprint 'fast-path' Added support for negated bools (value gets negated during copy). Added support for copying from struct members (via break struct) and split struct pins. Removed potentially troublesome references to BP-constructed UProperties, replacing them with the property FName. This adds some extra Initialize() overhead, but prevents various crash-on load issues (one when generating the class CRC). Added guard to prevent multiple initialization to save this more expensive work being done more often. #rb Martin.Wilson Change 2752158 on 2015/11/03 by Jeff.Farris Fixed UGameplayStatics::SpawnEmitterAttached() to register the ParticleSystemComponent after it spawns. #rb marc.audy Change 2752159 on 2015/11/03 by Jeff.Farris Improvements to camera lens effects to (EmitterCameraLensEffectBase) - can now specify a transform to align the emitter with the camera - exposed several key parameters to Blueprints - ENGINE_API now applies to the entire class #rb marc.audy Change 2753454 on 2015/11/04 by Thomas.Sarkanen Fixup deprecation warnings fallout from multithreaded update changes. Fixed up use of AnimInstance in Vicon plugin. Fixed up use of AnimInstance in slope warping node. Un-deprecated some APIs to become warning free (these APIs are safe to call but just a 'bad idea if you want to do it right'). Also an extra API to allow for smoother transition: Allow custom allocation/deallocation (including using a proxy member struct) by providing an override point for proxy destruction. #rb Martin.Wilson Change 2754099 on 2015/11/04 by Ori.Cohen Fix for task threads dropping stats (from Gil) #rb Gil.Gribb Change 2754449 on 2015/11/04 by Marc.Audy Ensure that components created from an Actor's blueprint BeginPlay implementation get BeginPlay called on them and register their component ticks #jira UE-20853 Reorganize some booleans to get better bit packing #rb Jeff.Farris #codereview Mieszko.Zielinski Change 2754573 on 2015/11/04 by Aaron.McLeran Fixing audio component PostLoad code to not set all LowPassFilterFrequency values to 0.0f Change 2755345 on 2015/11/05 by Thomas.Sarkanen Added deprecated constructors for various animation contexts Allows existing code to compile if it creates its own contexts from UAnimInstance. #rb James.Golding Change 2755348 on 2015/11/05 by James.Golding Add BP-exposed SetBoundsScale function to PrimitiveComponent #RB thomas.sarkanen Change 2755437 on 2015/11/05 by Marc.Audy Fix compile errors #codereview Thomas.Sarkanen, Mieszko.Zielinski, Aaron.McLeran Change 2755982 on 2015/11/05 by Marc.Audy Move HeaderParse changes for deprecation macro from Core Fix world settings warning Change 2756028 on 2015/11/05 by Marc.Audy Fix shadow variable issue Change 2756090 on 2015/11/05 by Ori.Cohen Improve budget tool so that task threads are computed automatically. #rb Gil.Gribb Change 2756120 on 2015/11/05 by Mieszko.Zielinski Fixed AIController::MoveTo not using DefaultQueryExtent of its navigation data #UE4 #rb Lukasz.Furman Change 2756243 on 2015/11/05 by Mieszko.Zielinski Fixed AI perception sight's "auto-visibility" mechanism totally skipping distance and vision cone checks #UE4 The old way was resulting in false positives when for example observer teleported somewhere far #rb Lukasz.Furman #codereview John.Abercrombie Change 2756280 on 2015/11/05 by Mieszko.Zielinski Minor VLog code cleanup and dumb-fixing visual logger accessing timer manager off of game thread #UE4 #rb Lukasz.Furman Change 2756500 on 2015/11/05 by Mieszko.Zielinski Added sanity-checking to BlueprintNodeHelpers::HasBlueprintFunction and cleaned up its usage #UE4 Also, refactored its parameters into references over pointers. #rb Lukasz.Furman Change 2757041 on 2015/11/06 by Thomas.Sarkanen Removed check() in UAnimInstance::GetProxyOnAnyThread() The check was no longer needed as if we are on the game thread we block until tasks are completed below, and if we are on any other thread we are 'safe' anyway. #rb James.Golding Change 2757207 on 2015/11/06 by Ori.Cohen Fix incorrect root body cache which causes a single frame "freak out" when simulating physics from an animation #rb Lina.Halper Change 2757238 on 2015/11/06 by Marc.Audy Force compiler generated functions to be generated for FHierarchicalSimplification in WorldSettings.h so that they are generated while the deprecation warnings are disabled. #rb Mike.Fricker Change 2757284 on 2015/11/06 by Stan.Melax tapered capsule drawing cloth collision happens with spheres and for the hull or tapered capsule goemetry between any specified pair of spheres. (this was already code reviewed before, but missed the check-in window before streamtime) #rb ori.cohen Change 2757743 on 2015/11/06 by Lukasz.Furman fixed node memory allocations for injected behavior tree decorators #ue4 UE-22783 #rb Mieszko.Zielinski Change 2757772 on 2015/11/06 by Lukasz.Furman added setters for crowd avoidance #ue4 UE-22785 #rb Mieszko.Zielinski Change 2758422 on 2015/11/07 by Lina.Halper Potential fix for invalid root bone index input #jira :/UE-23086 #code review: Ori.Cohen Change 2758429 on 2015/11/07 by Mieszko.Zielinski Reimplemented a fix for AI Sight's "auto seeing" mechanics in a more flexible way #UE4 #jira UE-23089 Change 2758571 on 2015/11/08 by Mieszko.Zielinski Modified ensure condition in UAIPerceptionComponent::OnRegister so it doesn't go off when BP does it's magic when components are being added to a BP actor class #UE4 #jira UE-23080 Change 2758821 on 2015/11/09 by Thomas.Sarkanen Fixed animations no longer playing when using a dedicated server. Uses correct logic to determine whether we are running as a server or not. #rb Martin.Wilson Change 2758920 on 2015/11/09 by Marc.Audy Don't dereference weak object pointers repeatedly in FBoneContainer::Initialize #rb Lina.Halper Change 2758944 on 2015/11/09 by Ori.Cohen Fix crash when stats are only on one thread and budget mode is used Change 2758967 on 2015/11/09 by Benn.Gallagher Fix for crash undoing notify socket changes in Persona, needed to recache the notify track data after the transaction had reserialized the sequence. #jira UE-22963 Change 2758973 on 2015/11/09 by Benn.Gallagher Added new 'Random Player' node for anim graphs allowing the user to play a selection of animations in a random order with certain randomised paramers. Also allows 'Shuffle Mode' to act more like a playlist in that it will play everything on the list before repeating. #rb Bruce.Nesbit Change 2759219 on 2015/11/09 by Ori.Cohen Character perf test is now looking at stats directly and sending to analytics #RB Ben.Salem Change 2759398 on 2015/11/09 by Lina.Halper Fix issue where placed montages are not playing. - the issue is that IsPlaying does not consider montage, but SetPlaying does. It is asymmetry, so I made it same. However, there are other functions that need to be re-looked at wr.t. montage #code review: Thomas.Sarkanen #RB: Marc.Audy Change 2759491 on 2015/11/09 by Lina.Halper #Anim: Fix not getting input correctly for Copy Pose node #RB: Marc.Audy Change 2759602 on 2015/11/09 by Marc.Audy Fix imporperly named struct Change 2759795 on 2015/11/09 by Aaron.McLeran UE-23145 Adding a Priority value to USoundBase to use in concurrency evaluation and sorting wave instances for voice stealing. #rb zak.middleton Change 2760081 on 2015/11/09 by Aaron.McLeran UE-23091 Adding more logging for NaN checks and fixing one source of NaNs for audio. OmniDirectional Math Explanation: For XAudio2, because we do our own distance-attenuation calculations, we use the X3dAudio2 API to simply compute a speaker-map for spatialization and force the listener to be at the origin and the emitter to be on the unit-circle. Thus, from XAudio2's perspective, all distances for every listener-emitter pair will be 1.0. So in order to use the InnerRadius blending feature, we need to trick it into doing a an inner radius blend relative to a distance of 1.0. For example, if OmniRadius and Distance are the same, then the "NormalizedOmniRadius" is 1.0 and XAudio2 will begin its "blend" of the sound to an omni-directional speaker map. If Emitter-listener distance is less than the OmniRadius, we'll want to do more blending to an omni-directional speaker map, but we need to set the InnerRadius to something greater than 1.0 (i.e. so that the normalized distance of 1.0 will be treated as less than the InnerRadius). To do "full" omni-directional blending, the emitter-listener distance will be 0 or close to zero, and the NormalizedOmniRadius will be very large (i.e. close to infiinity). The previous math just set the NormalizedOmniRadius to FLT_MAX which is fine but that number is eventually squared before making the API call. FLT_MAX squared is INF. Note: I do not think we need to square the OmniRadius in: Emitter.InnerRadius = OmniRadius*OmniRadius; But I am keeping it t here because of legacy content which depends on that behavior. #rb zak.middleton hange 2760401 on 2015/11/10 by Thomas.Sarkanen@Thomas.Sarkanen-Dev-Framework Re-instated deleted protected functions in UAnimInstance. Fixed access of UAnimInstance in FAnimNode_StateMachine. #rb Martin.Wilson Change 2760407 on 2015/11/10 by Jurre.deBaare Construct raw meshes for spline meshes now uses the render data instead of original model data (preserves tangents/normals) Change 2760468 on 2015/11/10 by Benn.Gallagher Anim Dynamics optimizations, cached iteration independant data to reduce footprint of iteration on limits. #rb Graeme.Thornton Change 2760613 on 2015/11/10 by Jeff.Farris Fixed async collision completion delegate potentially firing repeatedly. (UE-23149) #cr marc.audy #codereview lina.halper Change 2760795 on 2015/11/10 by Marc.Audy Don't compile in pointless AddReferencedObjects when with editoronly data not defined Minor coding standard cleanup (NULL and auto) Change 2760848 on 2015/11/10 by Benn.Gallagher Fix to anim instance proxy to not rely on state machine initialization to bind native delegates as nested state machines are not guaranteed to be initialized. This was fixed in UAnimInstance originally but broken again by the proxy instance code. #jira UE-23164 #rb Martin.Wilson Change 2760866 on 2015/11/10 by Marc.Audy Manage transient visualization components for camera component in the same way that sprite component for other actor components are #rb Mike.Beach Change 2760963 on 2015/11/10 by Marc.Audy Since construction script can cause actors to be spawned don't use a ranged for to iterate #jira UE-22639 #rb Jeff.Farris #codereview Dmitriy.Dyomin Change 2762297 on 2015/11/11 by James.Golding UE-23086 Don't ensure in SetRootBodyIndex when Bodies array is empty (ie no physics state created) #rb martin.wilson #codereview ori.cohen, lina.halper Change 2763566 on 2015/11/11 by Lina.Halper FAnimNode_CopyPoseFromMesh::Evaluate - was accessing skeleton joint, not mesh joint. #RB: Laurent.Delayen Change 2763926 on 2015/11/12 by Thomas.Sarkanen Fix anim notifies not firing from single anim instances UE-23248 - Anim Notifies are not working for Animation Sequences UE-23249 - Anim Notifies using Sound Cues do not work #rb James.Golding Change 2764039 on 2015/11/12 by Jurre.deBaare Fix for issue with incorrect material indices after reducing a skeletal mesh with non LOD0 mesh as BaseLOD (OR-9243) #rb Lina.Halper Change 2764307 on 2015/11/12 by Jurre.deBaare VS2015 SSF library Change 2764314 on 2015/11/12 by Stan.Melax crashfix was putting bad bodies to sleep at start Fatal error! Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000 UE4Editor-Engine.dll!USkeletalMeshComponent::InitArticulated() [...\\engine\\source\\runtime\\engine\\private\\skeletalmeshcomponentphysics.cpp:875] On some skeletalmeshcomponent, some bodies aren't getting created correctly. Trying to force them to sleep was causing a crash - it expected instantiated physx bodies. Seems that all the rest of the code is able to tolerate bad bodies. Added check to ensure physx body exists before trying to force it to sleep. not sure if bad bodies are the norm or if this fix is just more "kicking the can down the road". #codereview ori.cohen Change 2764343 on 2015/11/12 by Jurre.deBaare - Fixed crash when building a LOD with SubActors.Num < 2 - Force HLOD level slider is now always enabled, however won't show complete image if not all HLODs are build - LODActor tree view item now scrolls into view if selected in the world - Set bAllowCullDistanceVolume to false for LODActor's static mesh components by default - Added 7zip files - Fixed issue with WinINet complaining about http-request without 'http://' prefix - Changed % reduced or original triangles display string, now uses float instead of int (for < 1% reductions) - Override texture sizes and automatic texture bias - Fixed issue with incorrect material merging, not picking up it required mesh-data during baking. Added extra conditions for rendering with mesh-data. - Now incorporate static meshes with opague materials into HLOD merging - Fixed issue with incorrect normals after merging meshes who's owning components had been negatively scaled - Fixed issue with incorrect texture size being set from MergeActor window (was only changing .X component) - Fixed issue with material merging when meshes with multiple LODs are merged, right now only merges LOD0's together if we are also merging the materials (otherwise, merge each LOD) - Added ENUM for texture scaling/resizing type that has to be applied while merging the materials - Added detail customization class for FMaterialProxySettings #rb James.Golding [CL 2765024 by Marc Audy in Main branch]
2015-11-12 18:11:48 -05:00
PerceptionComponent->GrabGameplayDebuggerData(PerceptionTexts, PerceptionShapeElements);
DistanceFromPlayer = DistanceFromSensor = -1;
AGameplayDebuggingReplicator* Replicator = Cast<AGameplayDebuggingReplicator>(GetOwner());
UGameplayDebuggingControllerComponent* GDC = Replicator ? Replicator->FindComponentByClass<UGameplayDebuggingControllerComponent>() : nullptr;
APlayerController* MyPC = GDC && GDC->GetDebugCameraController().IsValid() ? GDC->GetDebugCameraController().Get() : Replicator->GetLocalPlayerOwner();
if (MyPC && MyPC->GetPawn())
{
DistanceFromPlayer = (MyPawn->GetActorLocation() - MyPC->GetPawn()->GetActorLocation()).Size();
DistanceFromSensor = SensingComponentLocation != FVector::ZeroVector ? (SensingComponentLocation - MyPC->GetPawn()->GetActorLocation()).Size() : -1;
}
}
UAIPerceptionSystem* PerceptionSys = UAIPerceptionSystem::GetCurrent(MyPawn->GetWorld());
if (PerceptionSys)
{
PerceptionLegend = PerceptionSys->GetPerceptionDebugLegend();
}
}
}
#endif
}