Launching "dmengine" directly with native modules (SOLVED)

Hi there,

We’re working on a multiplayer game, and we’re using dmengine directly to launch multiple clients on the same machine.

I can launch the first client from the Defold editor, and it works flawlessly. The problem is when I launch the second one (using dmengine from the commandline) it doesn’t seem to be registering the native modules, such as "mime" and "luasec", which are required for websockets. The game runs but without networking, due to an error when trying to call "mime".

Here are the logs from the editor:

NFO:ENGINE: Engine service started on port 54361
INFO:ENGINE: Defold Engine 1.2.126 (32ba5ea)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device 'default'

Registered luasec Extension
Registered timer Extension

Logs from dmengine (manually from commandline):

INFO:ENGINE: Engine service started on port 8001
INFO:ENGINE: Defold Engine 1.2.129 (30b201a)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device 'default'

As you can see, in the second launch, the messages about registering the extensions are not present.

Is this something we can fix on our side?
I’d appreciate your help! Cheers!

1 Like

The dmengine you download from d.defold.com will contain no extensions at all. If you use any native extensions you need to use the engine built on our build servers and cached locally (in .internal/cache/engine-archives) or by bundling for the target platform(s).

2 Likes

Perfect, thanks a lot @britzl.

I’ve unzipped the ./.internal/cache/engine-archives/x86_64-osx/build.zip and it works running ./.internal/cache/engine-archives/x86_64-osx/dmengine :heart:

3 Likes

I’m running dmengine for Android downloaded from d.defold.com. And I’m using native extensions too too, colyseus, luasec, socket, websocket. The game loads, but the websocket isn’t working like it was when debugging directly from the editor.

./.internal/cache/armv7-android/build.zip only contains classes.dex and libdengine.so
I’m not too sure how to get dmengine.apk with native extensions bundled.

You can build apk bundle of your game with debug flag, it will be your own dmengine with your NEs. When you run this apk on your phone it appears in Editor’s Project->Target menu.

4 Likes

I actually have the bundled app installed on my Android device all along. Should have guessed!

1 Like