HTML5 Crash on level load

This only happens for HTML5 and Android. PC builds work fine:

RuntimeError: abort(Assertion failed: parent_id, at: …/src/gameobject/gameobject.cpp,1186,CollectionSpawnFromDescInternal). Build with -s ASSERTIONS=1 for more info.

I still haven’t been able to figure out how to build the engine and replace the dmEngine.exe properly yet otherwise I could show the full assertion list. When I build the engine the build succeeds when I don’t run the tests but I don’t see a dmEngine.exe anywhere in order to swap out the engine executable for the full build assertions.

Which version of Defold are you using?

1 Like

Using 1.2.172

Hmm I look higher up on the crash log and see a warning:

WebGL warning: getParameter: pname: Invalid enum value MAX_ELEMENTS_VERTICES UndiscoveredTerritories_wasm.js:1:145932

WebGL warning: getParameter: pname: Invalid enum value MAX_ELEMENTS_INDICES UndiscoveredTerritories_wasm.js:1:145932

This is after I added new models to the game. Is there some way to increase these values?

Those are warnings. And the warning is about the enum itself, not the actual setting. You can ignore this.

You won’t find “dmEngine.exe”, since you compile for either html5 or Android. They’re called .js/.wasm for html5 or .so for Android.

You’ll find them under e.g. tmp/dynamo_home/bin/wasm-web.
Copy the changed files to the correct counterparts in your build or bundle folder, then refresh the page.

For Android/iOS, we have the ./scripts/mobile/ to help with that, to make the process/resigning easier.

Also, by using adb logcat you can see the log of your process on your phone.

1 Like

I posted a new thread relating to trying to compile Defold here: Attempting to build wasm-web version of engine I am able to build the Desktop version of the engine without issue but am having issues building the wasm-web version. I think if I can fix the bug there it will be closer to working on Android since the behavior on both platforms is the same whereas Desktop works without issue.

I suppose that you have collections with the same “default” name:

1 Like

Thanks so much! :heart_eyes_cat: I was using a default collection name for one of my collections and renaming it fixed it :smiley: I was checking all my objects based on the error but hadn’t thought to look at the master collection names :open_mouth:

1 Like

Hmm it worked one time. However, after I tried building for Android I got a different error (resource missing.) I fixed this then built HTML5 again and now the error has returned. I checked all my collections and they have different names… Not sure what’s causing it, I’m trying to build defold since I need a version of the wasm-web engine with -s ASSERTS=1 enabled to see the full error message. I’m not even sure that will explain it, but at least I’ll have all the info possible.

EDIT: I figured out the issue. After removing all factories which use 3D Collada models the HTML5 build works fine. However, it does work with meshes. Is this a known bug, or is there some max tri count for Collada models on HTML5 I don’t know about?

EDIT2: I spoke too soon, I’m having issues w/ meshes now. However, I did have them working in HTML5/Android earlier in the project and nothing has changed regarding those objects since then since I moved over to Collada based models…

EDIT3: I’ve finally deduced the reason for the crash. I had previously been doing the shader operation “var_texcoord0 = texcoord0 * 2;” in my code to scale the texture. However, after changing this to simply “var_texcoord0 = texcoord0;” the game builds and plays on HTML5 again! Does anyone know if there’s a way to multiply a variable in a shader for HTML5/Android builds?

1 Like

Make sure it’s valid GLSL. Multiplying with 2 is unlikely to be valid since 2 is an integer constant and vec2s are floats. Try multiplying by 2.0. Some shader compilers are pickier than others.