HTML5 Build with 4.1

Hi,

I tried the HTML5 build with the 4.1 release and I’m getting build errors. Any help on this would be appreciated.

Below are some of the type of warnings I’m getting:



warning root: jcache is deprecated and not supported in fastcomp (you should not need it anyhow), disabling




Warning 10	warning : Linking two modules of different target triples: c:/users/evans/appdata/local/temp/tmp5ipexp/zlib_122.o' is 'le32-unknown-nacl' whereas 'c:/users/evans/appdata/local/temp/tmp5ipexp/Module.Launch.cpp_0.o' is 'asmjs-unknown-emscripten'
Warning 38	warning : Linking two modules of different target triples: c:/users/evans/appdata/local/temp/tmp5ipexp/SimulationController_136.o' is 'le32-unknown-nacl' whereas 'c:/users/evans/appdata/local/temp/tmp5ipexp/Module.Launch.cpp_0.o' is 'asmjs-unknown-emscripten'




Warning 43	warning : Linking two modules of different data layouts: 'c:/users/evans/appdata/local/temp/tmp5ipexp/libogg_139.o' is 'e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32' whereas 'c:/users/evans/appdata/local/temp/tmp5ipexp/Module.Launch.cpp_0.o' is 'e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128'	
Warning 11	warning : Linking two modules of different data layouts: 'c:/users/evans/appdata/local/temp/tmp5ipexp/libfreetype2412_123.o' is 'e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32' whereas 'c:/users/evans/appdata/local/temp/tmp5ipexp/Module.Launch.cpp_0.o' is 'e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128'


The final warning



Warning 50 warning : incorrect target triple '' (did you use emcc/em++ on all source files and not clang directly?)


before the build errors out with the following message



Error 51 error MSB3073: The command "D:\\UnrealEngine\Engine\Build\BatchFiles\Build.bat HTMLTest HTML5 Development "C:\Users\Evans\Documents\Unreal Projects\HTMLTest\HTMLTest.uproject"" exited with code -1.
Error 49 error : bad use of setjmp, should only call it


I realise that HTML5 support is experimental, but I’m hoping someone can help me fix these errors and get a build working.
The latest version of emscripten 1.16.0 (via Web installer) is installed. I’m building from the 4.1 release branch. Would I get better results in the master branch?

Posting the last few lines of the build output:



1>  DEBUG    root: emcc: LLVM opts: -strip-debug -internalize -internalize-public-api-list=main,malloc,free,malloc,free -globaldce
1>  DEBUG    root: emcc: LLVM opts: -pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt
1>  i32 (i16*)* bitcast (i32 (%struct.__jmp_buf_tag*)* @setjmp to i32 (i16*)*)
1>EXEC : LLVM error : bad use of setjmp, should only call it
1>  Stack dump:
1>  0.	Program arguments: C:/Software/Emscripten/clang/e1.16.0_64bit\opt c:/users/evans/appdata/local/temp	mprepjxj\HTMLTest-HTML5-Shipping.bc -pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt -o c:/users/evans/appdata/local/temp	mprepjxj\HTMLTest-HTML5-Shipping.bc.adsimp.bc 
1>  1.	Running pass 'Lower setjmp and longjmp for js/emscripten' on module 'c:/users/evans/appdata/local/temp	mprepjxj\HTMLTest-HTML5-Shipping.bc'.
1>  DEBUG    root: emcc step "post-link" took 56.71 seconds
1>  DEBUG    root: LLVM => JS
1>  DEBUG    root: JAVA not defined in ~/.emscripten, using "java"
1>  DEBUG    root: not building relooper to js, using it in c++ backend
1>  DEBUG    root: emscript: llvm backend: C:/Software/Emscripten/clang/e1.16.0_64bit\llc c:\users\evans\appdata\local	emp	mprepjxj\HTMLTest-HTML5-Shipping.bc.adsimp.bc -march=js -filetype=asm -o c:\users\evans\appdata\local	emp\emscripten_temp	mpewf5y2.4.js -O2
1>EXEC : warning : incorrect target triple '' (did you use emcc/em++ on all source files and not clang directly?)
1>  DEBUG    root:   emscript: llvm backend took 0.0390000343323 seconds
1>  DEBUG    root: emscript: js compiler glue
1>  DEBUG    root:   emscript: glue took 1.96700000763 seconds
1>  DEBUG    root: asm text sizes[30, 1813, 25], 24, 130, 815, 0, 0, 29, 436, 234, 375, 210]
1>  DEBUG    root:   emscript: final python processing took 0.0859999656677 seconds
1>  DEBUG    root: emcc step "emscript (llvm=>js)" took 2.59 seconds
1>  DEBUG    root: did not see memory initialization
1>  DEBUG    root: emcc step "source transforms" took 0.05 seconds
1>  DEBUG    root: running pre-closure post-opts
1>  DEBUG    root: applying js optimization passes: 'asm', 'eliminate', 'simplifyExpressions', 'outline', 'registerize', 'minifyNames', 'minifyWhitespace', 'last']
1>  DEBUG    root: emcc step "js opts" took 0.89 seconds
1>  DEBUG    root: emcc step "final emitting" took 0.00 seconds
1>  DEBUG    root: total time: 143.79 seconds


I have the same compile issue, even after building Emscripten from source :(

Hello

Same issue, even tried the preview, seems to be the same.

Best regards.
Kaj

Hi guys,

The latest version of Emscripten that dropped on Friday has broken the process for UE4. We’re working on getting it fixed, but there is no ETA yet.

Great info. Was for a moment worried that we missed something in our end, happily waiting :slight_smile:

Good and fast customer support Maximusdb3. Nice to see fast respond to customer issues, keep up the good work; information is the king.

Best regards
Kaj

Is there an expected ETA to get HTML5 support running? In my case the only mising piece is that no project html file is generated. Similar to: https://answers.unrealengine.com/questions/18136/html5-build-firefox-cant-find-the-file-myprojectht.html

Cheers,
Moss

Has anyone successfully compiled the Emscripten LLVM source using MinGW rather than VS 2010 SP1? I have VS 2012/2013 installed and honestly don’t feel like removing them both and installing VS 2010. MS recommends installing them in order by release…

Not sure if running those three in the same machine would cause any issues

I ended up biting the bullet and re-installing VS 2010/2012/2013… Will see what happens next :slight_smile:

Do keep us posted!

From a clean VS installation it actually compiles and builds fine but no final project html file is generated, the .s and .bc files are there though!

I followed the steps outlined in this topic: https://answers.unrealengine.com/questions/18136/html5-build-firefox-cant-find-the-file-myprojectht.html futher down the page, and after a small hiccup I had success:

SwingNinja running in HTML5

Just out of curiosity, how large of a download is that?

I made one in shipping mode and it was about 130 megs.

I have compiled the editor(4.2) and tried to follow the explanation in . Also I have installed Emscripten. I could use an explicit explanation of how to get html5 to work. A movie would be great.

SwingNinja hasn’t really been fully optimized for HTML5 download footprint. I’d look at TappyChicken for the best example of a small web game, it is only 9 MB or so. We’re working on shrinking the engine footprint and improving our mobile and web examples!

–Mike

Mike, I would just like to see how to get html5 to appear in my compiled version of 4.2. The explanation of Emscripten is totally convoluted. My subscription has run out. I would be happy to renew if I could get html5 to work.

Remember, HTML5 support in Unreal Engine is still a “preview”. It does work, but we don’t consider it fully supported yet because the developer experience is not to the quality level that we want, and documentation and samples are still actively being tested and improved. I asked a platform team member to chime in on this thread with info about using HTML5 with 4.2.

–Mike

just been messing with html5 and 4.2.1, after a lot of head scratching and searching for various errors it finally packaged a game.
i tried with the car blueprint template, its 180 something mb, and doesnt seem to work in a browser.
firefox 64 bit nightly just says downloading… forever.
chrome just locks the whole computer.

im assuming html5 does actually work, is physics ect supported?
should i try something more simple?
no way do i want to make a 2d game in ue4, there are much much much better 2d specific engines for that.

edit:
heres a link if anyones interested in trying it
http://www.tegleg.co.uk/ue4/cartegeditor.html

Sorry for all of the workflow issues guys. There will be some improvements for 4.3 to the process, but not where it needs to be for easier use. Right now, I would suggest getting the master branch in the repo and building the editor. Make sure you have emscripten 1.16 installed and that the EMSCRIPTEN environment variable points to the install location (for instance C:\Emscripten\1.16) before building the editor. It will then properly build the HTML5 target libraries. In the built editor, enable the Game Launcher from within the Editor Preferences Experimental section. Open the Game Launcher window and in there, using the advanced icon, create a new profile (click on the +) and set the following:

Project: Your Project, Development, Test, or Shipping. Shipping will make the smallest js file, but it will still be around 70Mb. I have gotten this down in to the 30Mb range for Tappy Chicken by excluding unneeded third-party libraries, but I don’t recommend that initially.
Build: Check the Build box
Cook: Specify Cook by the Book in the drop down, select HTML5, and select your maps
Package: Select Package and Store locally, this is the step that generates the html file, you don’t need to specify anything for the fields in this section
Deploy: Select Copy to Device and create a Device Group. In the Group select your HTML5 (on a side note, I am planning to add “devices” for each of the browsers we detect on the machine so that you deploy and test on a particular browser)
Launch: Select Using Default Role.

If you are using code from the master branch, then it should generate the .bc, .js, and a .html in the <YourGameName>/Binaries/HTML5 directory. It will then try to launch it on a detected Firefox browser.

Some tips:

  • For best compatibility, get the 64-bit Nightly Firefox browser (http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/ look for the 64-bit installer). This will allow the largest memory heap for debugging purposes.
  • Launching in Chrome by double-clicking the html file will not working currently because of some cross-domain issues which I am still trying to fix. You will need to run a web server and serve the file. I usually use the python -m SimpleHTTPServer 8888 command running from within that directory
  • In the browser, make sure to load the developer console (F12 works in both Firefox and Chrome), this will provide additional output that may be useful, such as out of memory exception.
  • When you run into an error, post the output from the game log window and from the console, that will help us figure out what is wrong.

To answer the Physics question, yes we do support PhysX in HTML5, but not the Apex libraries.

There will definitely be many more workflow improvements as we move to 4.4. I know it has been slow coming, sorry about that.

-Pete
HTML5 Platform Engineer