Hi Guys, I created my first Project with defold and did the Tutorial. Then I was playing around with some mechanics and grafics. So I created a custom “Hero” and some Gui elements.
The Game runs fluent but sometimes on Windows (even more on Android) there is a noticable lag.
I did a screenshot of the Web profiler as i read in some other Threads and the Frames are pretty red
At first I thought it would be too much “message spamming” but there are mostly collision messages so i dont think they are the Problem.
Another hint from you guys was that there could be to big textures the parts of the hero are mostly 300x400 and one is 1150x600 (but much transparent space)
Can’t see the full list in the screenshot, but it looks like 90% of the time it’s just waiting for vsync. Do you have the framerate set to 60 in your game.project file?
Exactly my thought. It takes 1.25ms to render your scene so the slowness is not caused by too my stuff to render. As for messages, in the Counter section you can see that you generate 0 messages on the selected frame and GameObject.dispatchMessages takes 0.05ms.
soo by update_frequency=60 i think its 60fps but that shouldn’t be false.
And you are right its taking 31ms from 36ms for Vsync but isn’t that quite normal?
I now testet
update_frequency=30 -> it runs overall slower but the little lags dont vanish
update_frequency=120 -> no noticable change in anything
Judging from your first screenshot with profiler info it seems like every frame takes around 30 ms, meaning more or less 30 FPS, not 60 fps (ie 16ms per frame). What if you tick “Variable dt” in game.project and try again?
@Lord_Squirrel Are you creating a lot of tables/functions in your update() functions? Lag like that can sometimes be caused by the garbage collector kicking in if you allocate too many items too fast.