How do I read the profiler
Asked Answered
N

4

0

I'm trying to optimise my game but I don't really understand the profiler.

In this image Frame Time is 136ms but even if I add up all the times beneath the result is much much lower, so what does Frame Time actually mean?

Noman answered 12/11, 2023 at 1:35 Comment(0)
C
0

Noman You didn't show the complete breakdown. There's more items on that list. What's your script functions time?

Churchill answered 12/11, 2023 at 2:3 Comment(0)
N
0

Churchill It was a few ms at most. I tried it again, got 180ms Frame Time and 1.28ms on Script Functions. I can see something is wrong with Physics Time but it shouldn't be that bad

Noman answered 12/11, 2023 at 2:19 Comment(0)
C
0

Noman Make a project copy and start removing parts from it until you hit the thing that's causing it.

Churchill answered 12/11, 2023 at 3:22 Comment(0)
N
0

Churchill Well, I hoped I wouldn't have to do that if I use the profiler. It did point me in the right direction at least, the problem was physics related. I use a somewhat complex mesh for the world and I had to check if an enemy is on the floor using test_move() instead of is_on_floor()(for reasons). Instead of doing that I added an Area3D and check if it has overlapping bodies, which seems to work just fine and the lag spikes are pretty much completely gone. Now I just need to figure out how I can make the world collision mesh simpler or split it into multiple parts, not sure if that will actually help though.

Noman answered 16/11, 2023 at 1:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.