drwhut / tabletop-club

An open-source platform for playing tabletop games in a physics-based 3D environment for Windows, macOS, and Linux! Made with the Godot Engine.
https://tabletopclub.net
MIT License
1.27k stars 55 forks source link

Documentation: Exporting Game in GDot #128

Closed elmodor closed 1 year ago

elmodor commented 1 year ago

Which page(s) in the documentation should be changed? https://tabletop-club.readthedocs.io/en/latest/general/download/compiling_from_source.html#exporting-the-game

What should be changed? A more thorough documentation about the export settings. Maybe explicitly describe everything that was set/checked for the public release build? Also the godot-gdnative-webrtc.zip includes *.template_release*.so and not *.release*.so libs. How come the difference?

Why do you think the change is needed? I exported the project and it was around 30% larger than the official release version. So I was wondering why there is such a huge difference and if there is an export option that can be turned off or changed.

My settings: Custom Template (Debug, Release) is set. Checked checkboxes:

Resources: Export all Script: compiled Bytecode No export with Debug

drwhut commented 1 year ago

I'm assuming you're generating a Linux build?

Also the godot-gdnative-webrtc.zip includes .template_release.so and not .release.so libs. How come the difference?

Ah, did you download a pre-release version of the WebRTC library? That might explain the difference. The official builds use version 0.5 of the library.

elmodor commented 1 year ago

I'm assuming you're generating a Linux build?

Yes. But the TabletopClub.x86_64 is around 30% larger than the one provided on github. So i was curious if one of those settings of the export functions is causing this and if it can be turned off.

Ah, did you download a pre-release version of the WebRTC library? That might explain the difference. The official builds use version 0.5 of the library.

Yes, the documentations said the latest version :see_no_evil: The documentations says: "WebRTC GDNative plugin" which is only available on the pre-release (godot-gdnative-webrtc.zip ) while 0.5 is called " godot-webrtc-native-release-0.5.zip". Since the documentations said "latest" and "gdnative" I used the pre-release one. Guess it's a weird coincidence that they changed their naming scheme of the releases.

Anyways, the project (godot, tabletopclub) was easy to setup, run and export! Well done on the documentation (and the project setup ofc)

drwhut commented 1 year ago

Thank you! 🙂 I think that could be a source of confusion for a lot of people, so I think that might be worth mentioning in the docs either way.

elmodor commented 1 year ago

The size of TabletopClub.x86_64 should be unaffected by the webrtc plugin (it has the same size for me with/without the plugin). If you have time maybe you can compare those export default settings I posted above to your linux one at some point too.

Godot seems to have an export cli command. Maybe the export command can be figured out for easier export and maybe for automated exporting at some point.

drwhut commented 1 year ago

From what I remember, apart from the custom templates, I left everything else as default.

Is it ok if you post the file sizes of the exported executable, .pck file and webrtc library? I'll check this against the official builds and see where the difference lies.

Actually, I have a theory: the official builds use the production=yes flag, which decreases the build size by a lot, but I left it out of the documentation because it takes ages (probably because of the link-time optimisation).

In terms of the CLI, I've definetly considered using it for automated exporting, but I'm not sure if it's any easier for people to use it when building the game themselves? Especially because one has to set up the configuration file for exporting anyways (which Godot does behind the scenes as you're using the export menu).

elmodor commented 1 year ago

Godot build with: scons -j8 platform=x11 target=release_debug scons -j8 platform=x11 target=release tools=no production=yes

On commit: 9dca836

File Bytes Human
godot.x11.opt.64 45824288 44M
godot.x11.opt.tools.64 724015328 691M
libwebrtc_native.linux.release.64.so 15471592 15M
TabletopClub.pck 11969472 12M
TabletopClub.x86_64 45824288 44M

So it seems TabletopClub.x86_64 has the same size as godot.x11.opt.64? The official release build size is: 35523960 aka 34M

drwhut commented 1 year ago

Ah, looking at the build workflow on my fork, there's one more command that was hidden away somewhere in the Godot docs:

strip bin/godot.x11.opt.64

If that does it, then that might be worth mentioning in the docs.

elmodor commented 1 year ago

With strip I get it down to 39270808 aka 38M. Half way there :smile:

elmodor commented 1 year ago

Also: ldd TabletopClub.x86_64 reveals that the official build links against

While my build does not :thinking:

drwhut commented 1 year ago

I think at this point it probably comes down to build environments, compiler versions, stuff like that.

elmodor commented 1 year ago

I agree.

To summarize what could be added to the documentations:

strip bin/godot.x11.opt.64

when finished building godot.

The confusion about the webrtc plugin: