Ludum Dare 45 is happening soon! I remember when I participated in LD42; I had a friend helping me test my game, and give me feedback during the jam. For each iteration of the game, I had to export and upload it to Dropbox for him to download. The whole thing felt tedious, and it seemed like it was taking a big chunk of my 48 hours away.

I had decided to participate on a whim, so I wasn’t really all that prepared for the “DevOps” side of things. Even the decision of using Godot was made days before the jam started.

For LD45 I’ve decided to employ a different workflow for playtesting the game and for people to judge it after the jam is over, and I’d like to share it with anyone who is interested.

I’m going to use Godot’s export to HTML5 feature to make a web format of my game and host it on my GitHub account. If you are interested in doing something similar, read on!

Reasons for this workflow

No download means more players (IMO)

Anyone with a compatible browser can play the game. People will be more inclined to try your game if they don’t have to download a executable and run it on their computer.

Fast feedback time during development

The game will be updated almost automatically every time you commit your code.

Free CDN

If you have a GitHub account you have a CDN at your disposal. Why not utilize it?

What you will be doing

Export your finished game from Godot in HTML5 format

Push the game to GitHub

Configure a GitHub page to serve the game

Here is a demo game I’ve made to show what the end result of this workflow looks like.

Here is a GIF of the game in action.

Requirements

Basic working knowledge of Git

A game made with Godot ready to be exported

Game code is tracked in a local Git repository (repo)

A GitHub account

Exporting your game

Once the game is “done”, you can export it from Godot by going to Project -> Export in the menu.

You should see this dialog after clicking Export.

If you haven’t exported in HTML5 format before you will need to click Add… and choose HTML5 in the dropdown.

If your dialog says “Export templates for this platform are missing” at the bottom, you will need to download them by clicking on Manage Export Templates. The Editor will then take you through the steps to download the templates.

Once everything is ready to go, click Export Project.

You will also want to set Path to PROJECT_ROOT/docs, where PROJECT_ROOT is the root directory of your game. The reason for doing this will become apparent later.

Finally, click save and you are done. I didn’t have to change any settings for my very simple sample game. If you run into problem exporting, consult Godot docs site for more information on project exporting.

To make sure your game is exported properly and actually runs, you can open the exported html page with your browser. I was able to just open the file with Firefox with no problem. But, as mentioned on the docs site, you might need to start an HTTP server to serve the page for the game to run properly. If you use Chrome, you may also need to turn its WebAssembly feature on. You can google the instructions on how to accomplish this.

Pushing to GitHub

(You can skip this step if you already have your code in GitHub)

You will need to create a new repo on GitHub to host your code. This will be the remote repo for your local repo.

Here is what the new repo UI looks like.

If you already gave your game a name, you will probably want to name the repo something similar, if not the same. The repo name will be part of the URL where people can access your game.

You should set the repo to Public for its GitHub page to be accessible. A paid account may be needed if you want to use GitHub page with a private repo.

You are going to push your existing local repo to this new remote repo so your can ignore the part about README and .gitignore like it says on the page.

GitHub should take you to this page after the repo is created.

Following the instruction in “…or push an existing repository from the command line”, run

$ git remote add origin https://github.com/<username>/<repo_name>.git $ git push -u origin master

from your local repo directory to push it to your GitHub remote repo. Make sure you are on the master branch in your local repo when running this command.

Configuring GitHub page

Now that your code is on GitHub, it’s time to spin up a GitHub page.

Go to your repo’s Settings section from its homepage.

Scroll down to the GitHub Pages section.

You should see something like this.

You want to change the Source dropdown to master branch /docs folder. This is why I asked you to export your game to the docs folder earlier. You could just have your web game files in your PROJECT_ROOT directory and change the Source dropdown to master branch, but I prefer the docs method because it makes your project more organized.

And that’s it, you are done! Your game should now be accessible from the URL indicated in the GitHub Pages section.

Now, when you make changes to your game and make a new build, just push your updated master branch to GitHub and it will serve the new version of your game.

Extra thoughts

Although this post is written specifically for hosting a Godot game on GitHub the same workflow should work for any engine that exports to web format and any source control site that has something similar to GitHub pages.

For instance, I believe Unity has an option to export with WebGL, and Bitbucket Cloud seems to be Bitbucket’s version of GitHub pages.

There are also ways to refine the workflow described here in case you want to push your game beyond the game jam sphere.

Using git submodules to keep your game code and exported files in their own repos so you don’t have to use the docs folder of the code repo or incorporating automated testing since GitHub works really well with some of the continuous integration (CI) services available, including GitHub’s own GitHub Actions.

That’s it for this post. If you want to be notified when there’s an update here, please subscribe. Thanks for reading! 🙂