From fa436b1fb8f853837c48ab903a3306fb2303ddaf Mon Sep 17 00:00:00 2001 From: "CVC\\jbelon" Date: Fri, 23 Feb 2018 15:30:13 +0100 Subject: [PATCH] Walkers detect vehicles while walking. Improvements in the settings --- Unreal/CarlaUE4/Config/DefaultEngine.ini | 25 +++++++++++-------- .../Source/Carla/AI/WalkerAIController.cpp | 6 +++++ .../Source/Carla/AI/WalkerAIController.h | 7 +++++- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Unreal/CarlaUE4/Config/DefaultEngine.ini b/Unreal/CarlaUE4/Config/DefaultEngine.ini index d2394518a..67f0e71f4 100644 --- a/Unreal/CarlaUE4/Config/DefaultEngine.ini +++ b/Unreal/CarlaUE4/Config/DefaultEngine.ini @@ -14,24 +14,24 @@ TransitionMap=/Game/Maps/Town01.Town01 [/Script/Engine.RendererSettings] r.DefaultFeature.MotionBlur=False -r.AllowStaticLighting=False +r.AllowStaticLighting=True r.DiscardUnusedQuality=True r.DefaultFeature.Bloom=False -r.DefaultFeature.AmbientOcclusion=False +r.DefaultFeature.AmbientOcclusion=True +r.DefaultFeature.AmbientOcclusion=0 r.AmbientOcclusionLevels=0 -r.DefaultFeature.AmbientOcclusionStaticFraction=False -r.DefaultFeature.AutoExposure=False +r.DefaultFeature.AmbientOcclusionStaticFraction=0 +r.DefaultFeature.AutoExposure=0 r.CustomDepth=3 r.RHICmdBypass=0 r.DefaultFeature.AntiAliasing=2 r.Streaming.PoolSize=2000 r.HZBOcclusion=0 -r.EarlyZPass=2 -r.EarlyZPassMovable=1 -r.SeparateTranslucency=0 +r.MinScreenRadiusForLights=0.01 +r.SeparateTranslucency=0 r.FinishCurrentFrame=1 r.MotionBlurQuality=0 -r.PostProcessAAQuality=3 +r.PostProcessAAQuality=1 r.BloomQuality=1 r.SSR.Quality=0 r.DepthOfFieldQuality=0 @@ -43,10 +43,13 @@ r.LensFlareQuality=0 r.SceneColorFringeQuality=0 r.FastBlurThreshold=0 r.SSR.MaxRoughness=0.1 -r.AllowOcclusionQueries=True +r.AllowOcclusionQueries=1 r.SSR=0 -r.StencilForLODDither=True -r.EarlyZPassOnlyMaterialMasking=True +r.StencilForLODDither=1 +r.EarlyZPass=1 +r.EarlyZPassMovable=1 +r.Foliage.DitheredLOD=0 +r.ForwardShading=False [/Script/AIModule.AISense_Sight] bAutoRegisterAllPawnsAsSources=False diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/AI/WalkerAIController.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/AI/WalkerAIController.cpp index a59e1d0e9..da0d98ff9 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/AI/WalkerAIController.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/AI/WalkerAIController.cpp @@ -224,6 +224,12 @@ void AWalkerAIController::SenseActors(const TArray Actors) } } +void AWalkerAIController::TrySetMovement(bool paused) +{ + if(paused) TryPauseMovement(false); + else TryResumeMovement(); +} + void AWalkerAIController::TryResumeMovement() { if (Status != EWalkerStatus::Moving) { diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/AI/WalkerAIController.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/AI/WalkerAIController.h index c4f59b672..9c05486b2 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/AI/WalkerAIController.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/AI/WalkerAIController.h @@ -40,6 +40,7 @@ public: FNavPathSharedPtr* OutPath = nullptr) override; virtual void OnMoveCompleted(FAIRequestID RequestID, const FPathFollowingResult &Result) override; + UFUNCTION(BlueprintCallable) void SenseActors(TArray Actors); @@ -49,10 +50,13 @@ public: return Status; } + UFUNCTION(BlueprintCallable) + void TrySetMovement(bool paused); + private: void TryResumeMovement(); - + void TryPauseMovement(bool bItWasRunOver = false); UFUNCTION() @@ -63,4 +67,5 @@ private: UPROPERTY(VisibleAnywhere) EWalkerStatus Status = EWalkerStatus::Unknown; + };