This release adds support for WebAssembly. Bundling for HTML5 will now output both WebAssembly and the older AsmJS version of the engine. Depending on browser support the appropriate version will automatically be selected and loaded at runtime. In most cases this new version can decrease initial load time for HTML5 games.
Engine
DEF-3540 - Added: New WebAssembly platform (bundled together with Asmjs on HTML5).
DEF-3582 - Added: Support for dynamicLibs in the platform context in NE config files.
DEF-3565 - Fixed: Boot crash on iOS 6.
DEF-3523 - Fixed: NE error log parsing for malformed Defold SDKs.
DEF-3568 - Fixed: Release audio focus before closing down platform sound.
This is a compiler directive for native extensions, to use “-Wl,dynamic” for certain libraries.
(I needed it for a test with using jnigraphics for Android)
The html5 build of my project doesn’t run anymore after update. Just black screen after loading. There is a bunch of errors in javascript console, but I know nothing about javascript and webgl. Nothing changed from previous engine version.
It said “missing function: FMODBridge_init”, so I guess that’s related.
I’m guessing it’s because the FMOD extension doesn’t yet have support for the new wasm-web platform. And, currently you get both js-web and wasm-web when you bundle for HTML5.
As a workaround, you should be able to remove the dmengine.wasm, and the game should fallback to the dmengine.js file instead.
EDIT: Perhaps @sven can post some pointers on how to build the wasm libraries the way we do tomorrow.
For each platform, if you need a static library, you need to make sure it’s compiled for that platform too. So, where you previously used emscripten to compile a library for js-web, you need to use Emscripten again (1.38.xx) to compile with some extra flags. It might be possible to copy the library from js-web to wasm-web. I cannot guarantee it’ll work, and it will probably be suboptimal, since we compikle our wasm-web target with certain flags to make the entire build as performant as possible.
Hi! I don’t have access to the source code of FMOD, so the only thing that I can do is pass the LLVM bytecode that they provide (which is not even built with the same version of emscripten Defold uses, but works with some monkey patching) through em-ar and get an .a, so I don’t have access to the compilation flags. Are there any webasm-specific flags you know of that I should pass to em-ar, or should the same library theoretically work?