I followed the docs on this, https://docs.godotengine.org/en/stable/development/compiling/optimizing_for_size.html, and when I have a built engine the export option doesn't exist anymore.

I think I have a misunderstanding of what this size compile is for. It appears that it allows the stripped down engine to be used to launch games, but I would like to make an HTML5 export of the game that doesn't include 3d, among other things.

The build output of the size compile forces the game to launch even with the --export argument (an aside; it is really fun to launch the game with --no-window from the command line[I am sure this is for a server]).

Is there a way to export games without sections of the engine embedded?

The build output of the size compile forces the game to launch even with the --export argument (an aside; it is really fun to launch the game with --no-window from the command line[I am sure this is for a server]).

The ZIP you get in the bin/ folder after compiling is an HTML5 export template, not an editor binary. You shouldn't extract it manually. Instead, specify it as a custom release export template in your HTML5 export preset. Make sure to uncheck Export With Debug at the bottom of the final export FileDialog too.

I must be really misunderstanding what needs to happen for a size optimized build.

I downloaded the engine source from github https://github.com/godotengine/godot/tree/3.3.3-stable and compiled with the settings to remove the 3d section of the engine as described in https://docs.godotengine.org/en/stable/development/compiling/optimizing_for_size.html

That step requires removing the tools from the build, which means the editor cannot open. It also appears that removes the capacity for the engine to export builds.

All this leads me to be unsure how to get an export of a game without the 3d portion of the engine.

The compile options are for several things.

To compile the editor you include tools.

To compile export templates you do not include tools, and you can also remove 3D, etc. For an web export template you'll want to compile with WASM enabled, which AFAIK can only be done from Linux ATM.

Once you have done that you then need use the editor and modify your export settings to use the newly-compiled web export template — after which you can export to web (HTML5) and use put the resulting file on your web page for people to play.

Hope this helps.

Yes, this helped a lot. Thank you.

I was misunderstanding the engine build vs a template build. Compiling the source with tools=no makes it a template build that goes in the Custom Template path in the Options tab. Had no idea.

There are some interesting items. You are right that the javascript platform can only be done in linux. I used the WSL2 with Ubuntu, works fine.

The compile option by default seems to add threads and using threads_enabled=no has compile errors. haven't looked into that yet. -A second look later, it appears that disabling threads fails to pull in more base functionality <blockquote> ./core/object/object.h:556:2: error: no type named 'mutex' in namespace 'std'; did you mean 'Mutex'? std::mutex _instance_binding_mutex; ~~~~~ Mutex ./core/os/mutex.h:102:7: note: 'Mutex' declared here using Mutex = MutexImpl<FakeMutex>; ^ </blockquote> Also, the release build wasm file is 16k with the template and 12k without. I compiled with target=release tools=no disable_3d=yes.

It isn't just the threads option, since that brings the wasm to just under 13k. The windows build using no_3d is a lot smaller though.

The number of threads you use to compile should have no effect on the final builds. I've been playing with 3.3.2-stable, though, on Windows, so I can't speak to anything weird or different with 3.3.3. Sorry.

The threads option is for the SharedArrayBuffers in a browser rather than using multiple threads to build the template/engine.