I did, but the profiler does not show the list of actual blueprint functions that are taking most of the time.
If you were using c++ you could take advantage of SCOPED_NAMED_EVENT
and then use stat named events to track the firing
I could be wrong, but I think if you use the C++ profiler in Visual Studio, you can see the blueprint functions. Iâm rebuilding the engine now so I canât check right this minute.
Do you have a higher resolution screenshot? Itâs blurry on my end.
Here is this screenshot in the archive.
2024-11-23_20-30-35.7z (702.7 KB)
.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "ExampleActor.generated.h"
UCLASS()
class YOUR_API AExampleActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AExampleActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void MyCustomFunctionTimed();
virtual void MyCustomFunctionTimed_Implementation();
};
cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "ExampleActor.h"
DECLARE_STATS_GROUP(TEXT("MyCustomFunctionTimed"), STATGROUP_CustomFunctions, STATCAT_Funk);
DECLARE_CYCLE_STAT(TEXT("MyCustomFunctionTimed"), STATGROUP_CustomFunctions, STATGROUP_StatSystem);
AExampleActor::AExampleActor()
{
PrimaryActorTick.bCanEverTick = true;
}
void AExampleActor::BeginPlay()
{
Super::BeginPlay();
}
void AExampleActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void AExampleActor::MyCustomFunctionTimed_Implementation()
{
SCOPE_CYCLE_COUNTER(STATGROUP_CustomFunctions); // <==here is where you add a cycle counter
for (int32 i = 0; i < 200; i++) {
UE_LOG(LogTemp, Warning, TEXT("Doing work %s"), *FString::FromInt(i));
}
}
As you can see custom function shows up in the unreal insights.
Inside of the actor I just call the event via a timer to trigger it
Those are impressive numbers. Itâs hard to tell if itâs GPU or your BP. There are indeed a lot of CPU stalls. But I donât think this should affect the GPU timings though I canât rule it out.
FRDGBuilder is the render dependency graph. Thatâs taking up 41ms. It seems to be struggling to collect all the assets in your level for rendering.
The translucency, subsurface scattering and custom depth are taking 25.8ms. What do you have that uses subsurface scattering? And do you have a lot with transparency? Also seeing a lot with the landscape subsystem. Custom depth should never be that long. Do you have water or something in your level?
Can you turn off foliage? Just set it to not visible in game. Does that make a difference? Just want to see if we can track down whatâs causing the issue. If you have water, try disabling that too.
As to finding your function list, can you click on the âTotal Inclusive Timeâ or âInclâ header so that the values are in descending order (seconds, then ms, then us)?
Also, just to rule it out⌠can you check your project settings->Engine->Garbage Collection and make sure the âTime Between Purging Pending Kill Objectsâ is not low. Around 60 seconds is the default I think.
edit: Landscape seems to be an issue as well. Not sure if itâs related to foliage or something to do with the landscape materials. Or the size of the landscape.
Do I need to look at each material to see this?
For example, windows.
Yes, I have water.
No, it doesnât.
Material shader is complex but all the textures are just 1K.
24 km2 are in the memory from the point where I test.
I think you can disable SSS with the console command âr.SSS.Scale 0â. See if that makes a difference.
Thereâs a stat in the stat dropdown in the editor viewport called âGameâ. It should list how much time is spent in blueprints, ticks and other things. Maybe post a screenshot of that. For comparison, my game has a BP time of 0.02ms per frame. Tick time is 1 to 2ms per frame depending how many actors are active.
Other stats you may find useful. GPU, Landscape, Unit.
Would also like to see the trace sorted by Incl.
I still think the landscape is causing issues as well. You could temporarily replace the material, but Iâm not sure thatâs the only issue.
Here is a screenshot of âstat gameâ from âPlay Standaloneâ:
Do I understand right that the biggest exclusive time matters, and it is PerformOverlapQuery?
Why so many simultaneous overlaps constantly calculated? Do you have an interaction system that has the overlaps on the items checking for the player?
If so then reverse the pickup logic so that the player overlaps and gathers the item to interact with instead. You will lower the overhead that way.
Can we get the Unit stats as well? Interested to see the game time vs render time as well as the number of triangles youâre pushing.
Yes, overlaps are the issue here.
Clearly, animations and overlaps are really standing out here. To me, if I had to make a guess, is that your collision and overlap settings are set incorrectly. So when your actors move, the components are animated and are triggering overlap events between the components on the same actor. Thatâs my guess. Itâs the simplest thing I can think of that would cause that many overlaps.
You have WAY too many scoped movement updates. Thatâs very peculiar. These are usually used for custom animations like climbing. Scoped movement is where you do an update multiple times on the same component, but the results of itself or the child components arenât broadcasted until it leaves the scope. Other than climbing and maybe a parcour game, not sure where else this would be used. But the main point is even then, youâd have maybe a few of these per frame, not hundreds or thousands.
How many actors do you have in your level that move around and have multiple scene components? Check the animations and the collision/overlap settings.
Start disabling overlap events on anything and everything that doesnât need it. And from what Iâm seeing, Iâd start with everything thatâs animated.
edit: Exclusive means itâs just that method alone. That wonât tell you much unless you sort by exclusive. Inclusive is where you should look at it tells you the time for itself along with everything else it is calling. For example, movement shouldnât take 9ms. Overlaps shouldnât take 7.64ms. It shouldnât even show up at all.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.