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?
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 You didn't show the complete breakdown. There's more items on that list. What's your script functions time?
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 Make a project copy and start removing parts from it until you hit the thing that's causing it.
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.
© 2022 - 2024 — McMap. All rights reserved.