What to compile for HTML5 packaging?

I would like to package my project for HTML5, but I do not know what it is that I need to compile and in what order. Every time I try to package, the process ends with an error saying that AutomationTool failed to execute, which I assume is because I didn’t compile everything that was needed.

Im having the same issue, but I think it may be because I forgot to extract the optional.zip onto my 4.4 branch. Im doing a full project rebuild right now and I’ll let you know if that fixes the html automation tool failure im getting.

Here is what I did to get it working

Build tools:

  1. I checked out the 4.4 branch from github
  2. Downloaded and extracted the required1, required2, and optional zip files into the engine folder
  3. Generated project files with GernerateProjectFiles.bat
  4. Opened UE4.sln
  5. Built the solution
  6. Built the UnrealFrontend program
  7. Built the UnrealHeaderTool program

The HTML5 documentation fails to mention a few key parts of the process that you need to set on your project

Firstly, you will need to set a default game mode in your project settings

13379-projectsettingspng.png

Take note of your game default map, as this will be the map that starts up first.

Next you will need to open up the unreal frontend launcher (Engine/Binaries/Win64/UnrealFrontend.exe) and do the following:

  1. Switch to ‘Game Launcher’ tab
  2. Choose ‘Advanced…’ at the left
  3. Create a new profile (if one does not already exist) by clicking the ‘+’ button in the upper-right
  4. Build: Do you wish to build? (tick this checkbox)
  5. Cook: By the book (selected any maps you want to cook under the Cooked Maps group)
  6. Package: Package & store locally (fields can be blank)
  7. Deploy: Copy to device (add a new group and tick item with HTML5 icon if its there)
  8. You can now ‘Launch’ the build process

If you hit the preview settings button before you press launch, it should look something like this:

If all goes well, you’ll end up with a working HTML5 build in Unreal Projects//Binaries/HTML5

Just a few things to remember:

  • You need a 64bit nightly build of FireFox or Chrome to test it out
  • If you select the shipping build configuration on step 3 it will make your download much small (and maybe work w/ 32bit browsers)
  • You will need to ‘host’ these files and open them in the browser vs just file->opening them. I recommend XAMPP for your local hosting. Just copy all the files to the proper htdocs directory in XAMPP.

Thank you, your instructions helped me get the project to build but still I’m not able to play the game in my browser. I did move all the generated files to XAMPP. When I open the HTML file (through localhost) there’s a loading bar at the top that’s stuck on ‘Downloading…’ and after a while a console appears at the bottom that shows just the number 113. I opened the HTML file through Firefox Nightly. Here’s a screenshot of the console: http://i.imgur.com/sJXk0bo.jpg

Not sure exactly what that is. Did you build with shipping? If you did, try building w/ development and it may give you some more ideas as to what is causing the issue.

I managed to get it to work by following your instructions, but only under 4.3. In 4.4 I got an error saying that HTML5 is an invalid target platform during the cook phase.

Thats interesting, maybe had to regen project files for the 4.4 branch?