Godot 4 export: my demo .pck is 870 MB but the demo uses 2 levels. How do I export only what the demo needs ?
Olivier Gagnon@ogagnon
Actually I am preparing the demo of my fishing game for the next Next Fest. Problem: the demo export is 870 MB. The full game is 1.1 GB. The demo has 2 lakes out of 9. Something is wrong and I think it is me.
What I tried:
- Export mode "Export selected scenes (and dependencies)" with only the demo main scene ticked. The export is small, but it crashes when it loads lake 2, because the lakes are loaded by path from a .tres resource (a list of level paths as strings), so Godot does not see them as dependencies.
- Back to "Export all resources": 870 MB again.
Also, confession, my audio is still .wav because the composer sent wav and I never converted it 😬
Godot 4.x, GDScript, PC only. How do you make a clean demo build ? Tabarnak, it is 11pm.
Accepted answer
ogagnon-san! I had the same problem with my Tenjin demo build (=^・ω・^=) What worked for me:
1. Export mode "Export selected resources (and dependencies)". Tick the demo scenes AND the level resources you load by path. Godot cannot follow paths written inside strings, so you tick them yourself.
2. Or keep "Export all resources" and use the exclude filter in the export preset, something like res://levels/lake_03/*, res://levels/lake_04/* and so on. Easier for me because my folders are one per level.
3. Add a custom feature to the demo export preset (Features tab, Custom: demo). In code: if OS.has_feature("demo"), show the "wishlist the full game" screen instead of loading lake 3. Then even if a file slips in, nobody can reach it.
4. Audio: convert the music to .ogg. WAV in the export is huge. My music went from 300 MB to 25 MB.
5. Textures: check the import settings of the big ones, VRAM compressed instead of lossless.
My demo went from 640 MB to 180 MB. ganbatte!
Get the best of #indie-game-graveyard weekly
One email each Monday with the most useful posts. No spam; unsubscribe in one click.
Comments
Sign in to join the conversation.
Sign in to commentAccepted answer
佐藤はるか Haruka@nekomata_games
ogagnon-san! I had the same problem with my Tenjin demo build (=^・ω・^=) What worked for me:
1. Export mode "Export selected resources (and dependencies)". Tick the demo scenes AND the level resources you load by path. Godot cannot follow paths written inside strings, so you tick them yourself.
2. Or keep "Export all resources" and use the exclude filter in the export preset, something like res://levels/lake_03/*, res://levels/lake_04/* and so on. Easier for me because my folders are one per level.
3. Add a custom feature to the demo export preset (Features tab, Custom: demo). In code: if OS.has_feature("demo"), show the "wishlist the full game" screen instead of loading lake 3. Then even if a file slips in, nobody can reach it.
4. Audio: convert the music to .ogg. WAV in the export is huge. My music went from 300 MB to 25 MB.
5. Textures: check the import settings of the big ones, VRAM compressed instead of lossless.
My demo went from 640 MB to 180 MB. ganbatte!
Olivier Gagnon@ogagnon
Merci Haruka ! The exclude filter is perfect, my folders are per lake too. And OS.has_feature("demo") is much cleaner than my plan, which was a global variable IS_DEMO that I would forget to change 😅
Tanvi Hegde@tanvi_makes_games
i hit the strings-as-paths trap in my jam too ~ another option: keep the level list as real PackedScene references instead of strings, then godot sees the dependencies. but then 'export selected' pulls in every level again lol, so for a demo the filter is better
Olivier Gagnon@ogagnon
Yes exactly, PackedScene references for the full game, the filter for the demo. Two presets, two strategies. Merci Tanvi
Bartek Wójcik@bartek_gamedev
No, also check if you have 4K source textures for things that are 64px on screen. Our demo was 40% textures nobody could ever see
Olivier Gagnon@ogagnon
...the fish textures are 2048. The fish is 80 pixels on screen. Tabarnak. Merci Bartek
Max Petrosyan@max_2010
bro how do you even make the fish look at you. is it a shader or an animation fr
Olivier Gagnon@ogagnon
Animation, plus a script that turns the eyes toward the camera. 12 lines. The most important 12 lines of my career 🎣
Pedro Henrique Lima@phzin_7
mano q aula, salvei. tb to aprendendo godot, didnt know about OS.has_feature 🙏 obrigado ogagnon e nekomata