• Building
  • Baffling performance problem in the exported (3D) project (on Linux?)

I am making my first 3D game. It runs quite smoothly inside Godot (most of the time at 60fps, which is the cap I have set), but the exported version runs much, much worse. Often not even reaching 20fps.

If anything, I would have expected the exported version to be faster, not slower, than the version inside Godot (especially since it's release, not debug!). As far as I can tell I'm using default export settings and templates.

Is there any way to tell what the differences are between one and the other? Maybe some project settings that get automatically set when running inside Godot?

If it helps, you can have a look at the source code here: https://git.hcoder.org/emanchado/winter-bliss-3d. Once you have the game running, go to track select and load track 7. You don't have to move or anything. If you ran it inside Godot you should get 60fps (at least on my computer). If you export the project and run the executable, though, the fps should go down considerably. On my computer it goes down to ~20fps.

I use Linux, if that makes any difference (a friend has used the Windows build and he says that it has always felt fluid, so maybe it's a Linux-specific issue?). Embedding the .pck file doesn't seem to improve performance on my machine.

Can you list the specs of your machine and if it's a portable/laptop or desktop. Also what linux distro?

It's a laptop, core i7, 32GiB of memory, Nvidia Quadro P620 (4GB), Nvidia driver version 460.32.03. Currently using elementary OS (based on Ubuntu Bionic). glxgears reports over ~16k fps, if that makes any difference.

Does that matter so much, though? My problem is that it runs really well inside Godot, but not the exported version. Like, on the same machine and right before/after, so it's not a problem with system load differences or whatever.

I wonder if theres something to do with switchable graphics since it is a laptop. Perhaps the exported game runs on iGPU? Obviously thats not the case if you don't have any switchable graphics support enabled. The exported game would be running a different executable file, so if some system setting is affecting it differently from the editor then the difference makes sense.

Oh, interesting! And I found something even more interesting. I am running Godot via Flatpak. I was curious if that somehow made a difference, so I downloaded the Godot binary from the website and tried that. The game runs as slowly inside that version of Godot as the exported build! So somehow running the game through Godot through Flatpak is the fastest option by far :confounded:

In all cases it does output the same line at the start, though: OpenGL ES 3.0 Renderer: Quadro P620/PCIe/SSE2. Would that confirm/deny your theory? And whether I have Godot (via Flatpak) open makes no difference for the performance of the exported build.

Does the console show anything different if yo u run the exported version through the command line? It should still output some data about the renderer and stuff even when exported, so that may help narrow down what is causing the issue.

@TwistedTwigleg said: Does the console show anything different if yo u run the exported version through the command line? It should still output some data about the renderer and stuff even when exported, so that may help narrow down what is causing the issue.

No, when I said above "in all cases" I meant inside Flatpak Godot (where it runs fast), inside downloaded binary Godot, and exported ?

The only other lines I can see are the following, but they don't seem related and again they seem to be the same in all three cases:

WARNING: initialize: XOpenIM failed
   At: platform/x11/os_x11.cpp:195.
WARNING: initialize: XCreateIC couldn't create xic
   At: platform/x11/os_x11.cpp:497.

Is there anything else I could check? Maybe project settings or something? I'm not sure if there is any easy way to show/print them to compare them. Or maybe some way to check the Flatpak options that could be related. I just downloaded from Flathub (https://flathub.org/apps/details/org.godotengine.Godot).

@HNarrativist said: In all cases it does output the same line at the start, though: OpenGL ES 3.0 Renderer: Quadro P620/PCIe/SSE2. Would that confirm/deny your theory?

It means it's not up to switchable graphics. But it does sound like the flatpak has something to do with it.