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
- I checked out the 4.4 branch from github
- Downloaded and extracted the required1, required2, and optional zip files into the engine folder
- Generated project files with GernerateProjectFiles.bat
- Opened UE4.sln
- Built the solution
- Built the UnrealFrontend program
- 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
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:
- Switch to ‘Game Launcher’ tab
- Choose ‘Advanced…’ at the left
- Create a new profile (if one does not already exist) by clicking the ‘+’ button in the upper-right
- Build: Do you wish to build? (tick this checkbox)
- Cook: By the book (selected any maps you want to cook under the Cooked Maps group)
- Package: Package & store locally (fields can be blank)
- Deploy: Copy to device (add a new group and tick item with HTML5 icon if its there)
- 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?