Hathora
Hathora is Redwood's preferred on-demand hosting solution for various reasons:
- The onboarding experience is fairly painless (and Redwood makes it dead-simple)
- The team is very developer friendly
- They listen to their big and small customers alike and continue to push new features/fixes based on that feedback
- The pricing is very affordable with a free $500 credit that expires after 24 months, reasonable pricing for low CCUs, and competitive pricing for large enterprise CCUs
Redwood provides a first-class integration with Hathora by using the hathora
provider. This integration focuses on the Room API, and will later add support to automatically create Hathora Deployments via the Redwood deployment scripts. Redwood doesn't use Hathora's Lobby Service and instead provides a custom lobby solution that works with any hosting provider.
During Hathora account creation by clicking the link above, you'll be prompted with a Login
button. Press that and then you'll have an option to Sign Up
.
Preparing the Game Server
Follow the steps to prepare the game server for Agones, which should put the packaged dedicated server folder in dist/LinuxServer
(unless you configured to use a different name than LinuxServer
).
Then run the command from the RedwoodBackend
directory:
yarn package:hathora <config-environment-name>
This will create a tarball redwood-hathora-{timestamp}.tar.gz
in the RedwoodBackend
directory. You can then upload this tarball as a Deployment on the Hathora Console:
Configuration
To use Hathora, you'll need to add config overrides for the Realm Instance Config game-servers.hathora.*
variables.
Hathora Credentials
game-servers.hathora.credentials
stores how Redwood can access the Hathora API:
app-id and app-secret
You can retrieve the app-id
and app-secret
variables after you create a Hathora application. The easiest method to retrieve these is to login via the Hathora webapp console, select the target application, and press the copy-to-clipboard icons for the AppId
and AppSecret
fields to use for app-id
and app-secret
respectively.
dev-token
You can generate a Hathora Developer Token by following their guide here; this is used for the dev-token
config variable.
Region Blacklist
By default, Redwood will list all Hathora cloud regions as available regions for servers to be created with lobbies or match-making. You can optionally specify a list of strings in the game-servers.hathora.regions.blacklist
Realm Instance Config variable if you want to omit one or more regions from showing up (perhaps you only want to have 1-2 regions in the US for low CCUs). Below is an example where the Los_Angeles
region would be omitted:
regions:
blacklist:
- "Los_Angeles"