Zylann / voxelgame

Voxel world prototype made with Godot Engine
Other
513 stars 84 forks source link

This game freezes every 1-2 seconds. #97

Open nchistov opened 10 months ago

nchistov commented 10 months ago

System information:


This game freezes every 1-2 seconds.

See it in this GIF: https://github.com/nchistov/big_size_images/blob/master/voxel_issue.gif

It's not I not pressing the buttons, it game freezes.

What need I do?

nchistov commented 10 months ago

Oh, I ran this some more times and now it doesn't freeze. But what is it later?

Zylann commented 10 months ago

I have no idea what could be those freezes. The game works fine on my end and for other people I tested multiplayer with. You're the first one to report this.

From what I see in the debug text, the voxel module isn't doing much work when the freezes occur, so I don't think this problem is caused by it. Perhaps try turning off SDFGI in the game scene? Maybe it's related to your graphics card? Or maybe it's just Godot compiling shaders the first time it sees something? Which would make sense considering that you didn't get the freezes the second time (Godot caches them). But it's a bit weird because all shaders should have been compiled after the first seconds of gameplay.

You could try profiling the game with Godot's profiler in the debugger tab, to check if something in particular gets highlighted. There isn't much detail there tho.

To get more insight, you could do some deeper profiling using Tracy because the voxel module has a lot of timed sections built-in. But you have to install Tracy itself https://voxel-tools.readthedocs.io/en/latest/module_development/#profile-with-tracy Unfortunately the process isn't very beginner-friendly, rather targetted at C++ dev. But that would be one way to check if the freeze comes from the module, and if yes, where (but if it's not... then it's Godot or your drivers, which need more manual work to investigate because nothing is setup in them for profiling). Alternatively you'd need to try another profiler but I havent used another.