Edgegap

In partnership with Edgegap - Simplifying game server deployment

In this simple guide, we'll go through how you get started hosting your dedicated server(s) with Edgegap in PurrNet. Luckily, this is very easy!

Preparation

Getting Started

First, start by getting setup and logged in to Edgegap so you can access the dashboard. And after this, have a brief look at their own documentation, to get setup with their Unity editor tool.

Installing Edgegap in Unity

Go your your top toolbar: Tools > PurrNet > Addon Library and click Install on the Edgegap addon. This will automatically import the tool into your project!

To help you get started we have setup a menu item that allows you to verify all the required dependencies and also help guide you to properly install them or remind you to open required tools.

But to give you a summary you need these tools:

  • Docker (Desktop or CLI)

    • Even after installed you need to make sure it is open when you want to upload a new server build

  • Install Unity Linux Build Support through UnityHub

For more details checkout Edegap's documentation.

Setting up PurrNet

When Edgegap is properly installed a little box will show up for supported transport that let's you toggle on or off the auto configuration of these transports.

The auto configuration will detect when inside an Edgegap environment automatically and use environment variables to automatically setup the correct ports and even SSL settings on your behalf. The client still needs to properly configure these but you can rest assured that the server is handled.

In case you have multiple of the same protocol for one server you might want to disable this and manually handle your setup accordingly.

Deploying the server

There are a few steps required to reach from nothing to a deployed server.

  1. Unity Linux Build

  2. Containerize The Build Files

    1. This is why you need docker installed, if you are not familiar with docker you can think of this step almost like zipping your project. I'm making a huge disservice to the technology behind the scenes but you don't need those details and can always learn more for yourself.

  3. Upload container to Edgegap

  4. Deploy your application!

Feel free to checkout Edgegap's documentation for proper detailed step by step on this but we will give you a quick getting started guide here too.

Speed running first server

First, you want to open Edgegap's editor window.

Then fill in your token:

Once your token is setup and validated we can proceed to step 2 (building your server). All you have to do is press the Build Server button. This is just like a normal Unity build so make sure you have your scene list properly setup. The build target will be a Linux dedicated server which is why you had to install the extra modules.

With the build done we need to containerize it. This is where docker comes into play, it is essentially packaging your build in a way that Edgegap can work with it. Just press Containerize with Docker.

We will skip step 4, you can use it to locally run the container you just created to test the server locally (even if your operating system isn't Linux).

In step 5 you need to choose your target application, a server image name (this can be whatever you want) and finally just press the Upload image and Create app version button.

Once it finishes you can either Deploy to Cloud from the website dashboard or from step 6.

Every container you upload will have a version, by default it's the date that it was built at which you can use to select the latest.

Once you have an application that is deployed you can try to connect from your editor or a client build. On the website's dashboard you can manually find the information required to connect:

You would use the `Host` as your address and `External` port as your client port. Here is an example of a correct setup inside Unity (notice Server Port and Address):

Easy as that!

Now you know how to get a server up and running and connect to it! You can expand on this by using their matchmaking service to automatically create matches for your users.

Last updated