UE4 4.5 cannot launch to HTML5

Hi all, i am trying to deploy to HTML5, with no luck whatsoever.
I tried with UE 4.4 and did not even got the HTML5 option, thanksfully 4.5 came up.
So i tried with UE 4.5 and follow the steps:

  1. installed emscripten latest (1.25) … then figured out it only works with 1.22 so tried installing 1.22 from emsdk, but there were path errors and then misplaced versions (python != llvm != emsdk) so i had to uninstall the whole thing and installed only 1.22.0.
  2. i pulled 4.5 from git and also the Required and Optional zip files for 4.5 version, extracted them on the same folder.
  3. run GenerateProjectFiles.bat
  4. open the solution with VS2013
  5. select Development Editor and Win64
  6. build … waited about 40min… 2 successful, 0 failed
  7. F5
  8. once UE opened up i grabbed the first template (first person blueprints), i named it “Zour”. (started with A and end up with Z then added numbers, so this is the 28th try i give it…)
  9. Build it just in case
  10. Select lunch to HTML5 and the Nightly 64bit Firefox (up to date)
  11. after 5min, it struck me with this:
LogPlayLevel:Display: CommandUtils.Run: Run: C:\Program Files\Emscripten\python\2.7.5.3_64bit\python.exe "C:\Program Files\Emscripten\emscripten\1.22.0\tools\file_packager.py" "C:\Users\yiown\Documents\Unreal Projects\Zour\Binaries\HTML5\Zour.data" --preload . --js-output="C:\Users\yiown\Documents\Unreal Projects\Zour\Binaries\HTML5\Zour.data.js"
LogPlayLevel:Display: CommandUtils.Run: Run: Took 5.6103209s to run python.exe, ExitCode=0
LogPlayLevel:Display: BuildCommand.Execute: ERROR: BUILD FAILED
LogPlayLevel:Display: Program.Main: ERROR: AutomationTool terminated with exception:
LogPlayLevel:Display: Program.Main: ERROR: Exception in mscorlib: Could not find a part of the path 'E:\projects\UnrealEngine\Engine\Binaries\HTML5\UE4Game.js'.
LogPlayLevel:Display: Stacktrace:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
LogPlayLevel:Display:    at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
LogPlayLevel:Display:    at HTML5Platform.Package(ProjectParams Params, DeploymentContext SC, Int32 WorkingCL)
LogPlayLevel:Display:    at Project.Package(ProjectParams Params, Int32 WorkingCL)
LogPlayLevel:Display:    at BuildCookRun.DoBuildCookRun(ProjectParams Params)
LogPlayLevel:Display:    at BuildCommand.Execute()
LogPlayLevel:Display:    at AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands)
LogPlayLevel:Display:    at AutomationTool.Automation.Process(String[] CommandLine)
LogPlayLevel:Display:    at AutomationTool.Program.MainProc(Object Param)
LogPlayLevel:Display:    at AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
LogPlayLevel:Display:    at AutomationTool.Program.Main()
LogPlayLevel:Display: Program.Main: ERROR: Could not find a part of the path 'E:\projects\UnrealEngine\Engine\Binaries\HTML5\UE4Game.js'.
LogPlayLevel:Display: ProcessManager.KillAll: Trying to kill 0 spawned processes.
LogPlayLevel:Display: Program.Main: AutomationTool exiting with ExitCode=1
LogPlayLevel:Display: Domain_ProcessExit
LogPlayLevel:Display: ProcessManager.KillAll: Trying to kill 0 spawned processes.
LogPlayLevel:Display: AutomationToolLauncher exiting with ExitCode=1
LogPlayLevel:Display: copying UAT log files...
LogPlayLevel:Display: RunUAT.bat ERROR: AutomationTool was unable to run successfully.
LogPlayLevel:Display: BUILD FAILED

The Zour\Binaries\HTML\ shows onlu 2 files : Zour.data (50mb) and Zour.data.js (100kb)

I googled a lot for this UE4Game.js with no luck, plus there is little to no help in the documentation.

At this point i am exceedingly frustrated since i have wasted 2 complete weekends in a wild goose chase for some basic functionality you advertise but it is just not there. Please tell me 4.6 is coming tomorrow and i wont even have to compile the complete editor for it to work.

Regards.

Hey Yiown,

Were you following the steps from this page?

yes i followed that page just to find out it gives erroneous information about emscripten, since as i have stated, UE does not work with “emsdk install latest” and in fact that only breaks the entire emscripten platform since you have to reinstall it and make sure you only use 1.22.0 (for UE4.5).

Okay. I’ll look into it.

So, do you have ue4game.js file by this path E:\projects\UnrealEngine\Engine\Binaries\HTML5\UE4Game.js? If no, then try to compile it manually. See here

yes i tried to build the project directly to HTML5 from VS but it ends up saying " there is no UE4Game.exe " (note the exe extension). i do not have the exact log since i got frustrated and deleted the whole thing. Now i am thinking on building a virtualbox image to share so you can test there. come to think about, it should be provided by Epic so we can focus on the game itself.

Hi Yiown,

Sorry for the delay in responding. I had to do some testing to get this figured out myself. After you have built the Engine from source code, you will also want to build the UnrealFrontend program.

This will give you an UnrealFrontend.exe file in your Engine\Binaries\Win64 folder. Running that will open the Unreal Frontend outside of the Editor. The window will have three tabs: Device Manager, Session Frontend, and Project Launcher. Select the Project Launcher tab, and at the bottom of that screen will be a section titled Custom Launch Profiles. On the far right side of the window in that section is a plus sign (+). Click that to create a new profile.

You will be taken to a page with a number of options. Double-click the name at the top to set a name, if you want. Set the Project drop down to Any Project. Make sure there is a check mark showing for the “Do you wish to build?” option. Set the Cook, Package, and Deploy options to Do not cook, Do not package, and Do not deploy respectively. Once these are set, an additional set of options will appear in the Build section. Select the HTML5 option and leave the rest blank. Your settings should look like this.

Click the Back button in the top right and it will return you to the Project Launcher screen with your new profile in the Custom Launch Profiles section. The second icon at the far right of your new profile shows the tooltip “Launch this profile” if you hover your mouse over it. Click the icon and let the process run. This creates the HTML5 folder containing UE4Game.js. Once the process is complete, open your project in the Editor and follow your normal process to launch the project on Firefox Nightly. This time it should launch successfully. Please let me know if you run into any additional problems.

The process I mentioned above is necessary when trying to launch a content-only Blueprint project for HTML5. If you have a code-based project, the process is slightly different. We are still working on streamlining the process of launching and packaging for HTML5. You will see some improvements to this process in the next few versions of the Engine.

Tim

Thanks Tim,
I did try the UnrealFrontend way, thou not with those exact settings, and it did not work for me.
In any case if this works only for Blueprints i better avoid the waste of time.
At this point i will continue my game targeting mobile platforms and hope UE gets up to speed with HTML5 before i release it.

I tried again with 4.5.1 and Firefox Nightly 64bit and It works !!!
I did not need the UnrealFrontend at all. Just opened a new template, and hit deploy to HTML5.
After 40min Nightly opened up and showed the template running in psychedelic mode.
My hope is back. Thanks Tim.

The process for packaging a code-based project for HTML5 is actually a little bit simpler (in my opinion). To package a code-based project, you would need to build the project in Visual Studio using the Development configuration for Windows, then open the project in the Editor and make sure to open each map that needs to be included in the HTML5 package. Then close the Editor and go back to Visual Studio and build the project using the Development configuration for HTML5. Open the project in the Editor again and launch it to Firefox Nightly. As I mentioned though, this process will be getting a lot smoother soon.

I believe this process only needs to be run through one time. After the first time through, the necessary HTML5 files should already be in place for future projects. In order to verify this though, I would need to remove and re-install the Engine. That will take me some time to complete.

Tim

It appears that after running through the UnrealFrontend process once, the resulting files are able to be used by subsequent projects to build for HTML5. You would only need to go through the process when upgrading to a newer version of the Engine.