Header image
banana4life

Publish for Web!

posted by pschichtel | 06 October 2020

Come on everyone, publish your games to the web.

Personally, I will not play games that only provide binary downloads.

  1. Most games don't publish for my OS (Linux), which is fine, I guess most of you are on Windows
  2. Binaries are kinda untrustworthy. I've seen several games that produce (probably false-positive) anti virus warnings on Windows systems.
  3. Most games do not publish sources, at least not directly in the ldjam page.

I will play native binaries iff the web version or the screenshots really hooked me and the native version promises some enhancements (usually better performance or controls).

Publishing for the web is pretty easy in probably all commonly used game engines (Unity, Unreal, Godot, LibGDX, ...).

For Unity you might need to disable compression in the web player settings before exporting (there are known bugs around it), but other than that it's just:

  1. Install web publishing support, if not already (in the Hub: "Add Modules" on the installation)
  2. Go to build settings
  3. Select WebGL
  4. Click Switch Platform
  5. Click Build, Select a Folder
  6. done.

It takes a bit longer than a native export, but it should generally work. If you are using UnityEditor classes (Handles and Gizmozs probably), you need to wrap them in #if UNITY_EDITOR #endif blocks or move the code to separate classes in the Assets/Editor folder, but the export errors are fairly clear on that.

"But where can I upload the export then?" you might ask.

I wrote a post about that for LD 38: https://ldjam.com/events/ludum-dare/38/where-is-mommy/submit-for-all-the-platforms

We at Banana4Life host our code in Github, so its natural to host the web export on corresponding Github Pages in the same repository as the source. Recently Github changed it, so Pages are not enabled automatically, when you push the "gh-pages" branch. You can now use any branch, but you have to enable Pages in the repository settings by selecting a branch and root directory.