Deploy a Unity WebGL game on 4EVERLAND: A Step-by-Step Guide by@johnedvard

Deploy a Unity WebGL game on 4EVERLAND: A Step-by-Step Guide

4EVERLAND is a Web3.0 cloud computing platform with global acceleration, privacy protection, distributed storage and other technical features. It’s a way to publish static web sites to the Internet. We will go through 3 short sections on how to deploy our Unity WebGL game to 4EVERLAND.
image
John Edvard Reiten HackerNoon profile picture

John Edvard Reiten

GameJammer

facebook social icongithub social icontwitter social iconyoutube social iconinstagram social iconlinkedin social icon

What is 4EVERLAND?

To put it simply, it’s a way to publish static websites to the Internet! Instead of being a centralized system, it’s decentralized. 4EVERLAND is a Web3.0 cloud computing platform with global acceleration, privacy protection, distributed storage, and other technical features.


I know, it’s a lot of buzzwords, but the important part is that you can deploy your Unity game. It’s also really simple to do so. We will go through 3 steps:


  1. Prepare our Unity game for WebGL
  2. Setup a GitHub repository
  3. Create a 4EVERLAND project and deploy our game

Prepare your Unity game for WebGL export

The first important thing to do with your Unity game is to export it for WebGL.


We need to go to the project settings and enable decompression fallback for our WebGL Player.

Go to Edit → Project Settings… → Player → HTML 5 tab and enable:

  • Gzip compression
  • Data caching
  • Decompression fallback

Menu on how to find project settings

Menu on how to find project settings

Instructions on how to enable Decompression Fallback and Compression format

Instructions on how to enable Decompression Fallback and Compression format

When the steps above are completed, we are ready to build our game.

Go to File → Build Settings… → Select WebGL → click Build

Instructions on how to find build settings

Instructions on how to find build settings

Image of Build settings window

Image of Build settings window

This will generate a folder with some files and folders in it such as:

  • index.html
  • Build
  • TemplateData

All of these files need to be uploaded to our 4EVERLAND project through GitHub, which we will cover in the next sections.

How to set up a GitHub project

In order for 4EVERLAND to host our game, we need to connect it to GitHub. This section requires some knowledge on how to use command-line tools, and git in general, which we won’t cover in this tutorial. I have written a section about some neat tricks using git commands, which you can find here.


Your Unity game may already be on GitHub, and if that’s the case, you can skip to the final step in this section.


  1. Create an account at github.com
  2. Create a new repository
    1. Give your project a name and a description
    2. You can select either public or private. Either option works.
  3. You then have to follow the instructions on GitHub
  4. Once we have our project ready, it’s time to add our built WebGL game
    1. Create a new folder e.g. Web
    2. Copy the build files/folders (index.html, TemplateData, Build) into the Web folder
    3. run git commit Web -m’feat: Add game’ from the command line
    4. run git push origin master which will push our game files to GitHub


When these steps are completed, it’s time to create a project in 4EVERLAND, which we will cover in the next section

How to Deploy our Game to 4EVERLAND

First, we need to link our GitHub account to hosting.4everland.org (this link includes my referral ID). When this is done, we are ready to create a our project


  1. Go to the “Projects” tab and Click “New Project”
  2. Search for the GitHub project we created → click “Deploy”
    1. If your GitHub project is private, you need to give 4EVERLAND access to read it
  3. Select the main or master branch → click “Deploy”
  4. Select the Web folder → click “Deploy”
  5. We don’t need to change anything in the next dialog, just click “Deploy”


Projects dashboard with button to click "New Project"

Projects dashboard with button to click "New Project"

How to import git project

How to import git project

Select the correct branch and click "Deploy"

Select the correct branch and click "Deploy"

Select the correct folder and click "Deploy"

Select the correct folder and click "Deploy"

No need to make further adjustments, just click "Deploy"

No need to make further adjustments, just click "Deploy"

4EVERLAND will now deploy our project to the Internet, and once it’s ready, we can start playing our game. That’s it!


I also deployed my Unity game to 4EVERLAND using the same steps as above. The game is still pre-alpha and only contains three test levels as of this writing.


Here’s a link if you want to check it out:


I hope this tutorial has been helpful, and consider using my referral link when creating an account at 4EVERLAND, https://hosting.4everland.org/#/?invite=QCIZV5JX.

You can also read more from 4EVERLAND’s documentation.







react to story with heart
react to story with light
react to story with boat
react to story with money
L O A D I N G
. . . comments & more!