HTML5 export: missing *.asm.js

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By anemol
:warning: Old Version Published before Godot 3 was released.

I compilated Godot and templates from Github sources.

I’m testing the sample project: https://github.com/khairul169/3rdperson-multiplayer

I exported project into HTML5.

5 files were created:

  • data.pck
  • Multiplayerfs.js
  • Multiplayer.html
  • Multiplayer.js
  • Multiplayer.mem

Now, with a NodeJS server, i’m testing the game but a file “Multiplayer.ams.js” is required.

How to create it? Possible that my HTML5 is bad?

Thanks.

:bust_in_silhouette: Reply From: eska

Sorry, haven’t updated the docs for that yet, since I’m currently working on closing several web export issues

A godot.javascript.opt.asm.js file (godot.javascript.opt.debug.asm.js for target=release_debug) is created during compilation along with the .html.mem and .js files and must also be included in the zip file as godot.asm.js.

According with:
Compiling for the Web — Godot Engine (stable) documentation in English

for these steps:

3 / 4        godot.html and  godotfs.js
    
   — Both of these files are located within the Godot Engine repository, under tools/html_fs/.
    
    cp tools/html_fs/godot.html .
    cp tools/html_fs/godotfs.js .

Directory tools/html_fs/ doesn’t exist but tools/dist/html_fs/ exists and only godotfs.js file is present.

I took the godot.html file from the archive Godot_v2.1.1-stable_export_templates.tpz (not sure is a good solution)

anemol | 2017-01-03 17:16

Right, I forgot, the godotfs.js file was moved to tools/dist/html_fs/

The .html file is now also generated during compilation as godot.javascript.opt.html (godot.javascript.opt.debug.html for target=release_debug) and has to be renamed to godot.html

eska | 2017-01-03 18:10

Hi, I have an issue may be related to this one.
I compiled on ubuntu 16.04 by using the 2.1.1-stable godot source (downloaded from
https://github.com/godotengine/godot/archive/2.1.1-stable.tar.gz ) and executed both

scons platform=javascript tools=no target=release
scons platform=javascript tools=no target=release_debug

and only these files are created into bin directory:

godot.javascript.opt.debug.html
godot.javascript.opt.debug.html.mem
godot.javascript.opt.debug.js
godot.javascript.opt.html
godot.javascript.opt.html.mem
godot.javascript.opt.js

so no *.asm.* files are produced (while godotfs.js is correctly located in tools/dist/html_fs). I followed all the instructions in the docs latest and 2.1 and in this thread.
Am I missing something?

consultit | 2017-01-15 19:55

2.1.1 did not yet use the .asm.js file, that’s only from the upcoming 2.1.2 onward. Follow these directions: https://github.com/godotengine/godot-docs/blob/c415100128702420e63a6d214c555624eccd5d65/reference/compiling_for_web.rst but with tools/dist/html_fs instead of tools/html_fs

Basically, use the godotfs.js and godot.html files from tools/dist/html_fs/, then zip godot.js, godot.mem, godotfs.js and godot.html

eska | 2017-01-15 20:04