Skip to main content
Game Server Orchestration & Managed Infrastructure on the World's Largest Public Edge Computing Infrastructure

Hathora logo

Game Server Orchestration & Managed Infrastructure on the World's Largest Public Edge Computing Infrastructure

Website: www.edgegap.com
Documentation: https://docs.edgegap.com/docs/


You can launch your Edgegap instances right out of Idem's matchmaker (see player-based architecture). This saves you the effort of needing an own backend for your game. Simply let your players (game client) connect directly to Idem's matchmaker. Once we find a match, we will launch the game-server on your behalf on Edgegap and provide the connection details back to your player.

Setup

1. Preparing game-server

If you haven't already, follow the Edgegap documentation to setup your game-server image. We recommend you try launching the game-server thorugh their API and make sure it launches when being triggered, before progressing with integrating it into Idem.

2. Follow integration guide

Navigate to player-based architecture and follow the guide there. Step (a) "Setup your game-server" you have already completed with the previous step.

Parameters

The following parameters are available for the Edgegap intergration:

ParameterOptionalDescription
API tokenNoAn API token allowing Idem to interact with the Edgegap API on your behalf. You can create this in your Edgegap account's user settings under Tokens.
app_nameNoThe name of the Application that Idem should request Edgegap to host. You can find this in your Edgegap account in the table in the Applications section or on the detail page of an Applicaiton.
version_nameYesThe name of the Application Version you want to deploy. If not provided, the last version created is picked by Edgegap. You can find the available in your Edgegap account in the detail page of an Application.

Response to players

The websocket response to players will have the following format:

{
"action": "joinInfo",
"payload": {
"fqdn": "<random_id>.pr.edgegap.net",
"start_time": "2024-10-24 08:18:32.202791",
"ports": {
"WebPort": {
"external": 32564,
"internal": 5000,
"protocol": "HTTP",
"name": "WebPort",
"tls_upgrade": false,
"link": "http://<random_id>.pr.edgegap.net:32564",
"proxy": null
}
},
"public_ip": "<server_public_ip>",
"location": {
"city": "Milan",
"country": "Italy",
"continent": "Europe",
"administrative_division": "Lombardy",
"timezone": "Central European Time"
},
"tags": []
}
}

This information can then be used to connect the players to the server.

Note: Ports and tags might include any number of elements. This depends on your Edgegap Application and will automatically change.

Region selection

Edgegap has a very large number of server locations that your game can be launched on. The selection of where players will be playing is decided through the following steps:

1. Suitable locations When adding players to the matchmaking, you provide a Location list or Ping-map (see Latency and region). Based on this information, the matchmaker will only consider making those matches, where a compatible location exists. If e.g. one player has ['europe', 'asia'] as locations he can play on and the other has ['europe', 'north_america'], the matchmaker will match them, since a server in europe is a common suitable location.

The locations you provide are fully up to you. The can, but don't need to be, actual Edgegap locations or ping beacons. E.g. you could proivde just rough geographical locations for a server that a player can play matches on (e.g. North America, Europe) as arguments, or a list of ping beacons of Edgegap.

2. Final server selection Once a suitable match is found by the matchmaker, Idem will call Edgegap to launch a server for the two (or more) players. By step (1) we already know that those players are generally close enough to each other, so that latency will be viable to play. Edgegap will then pick the one of their locations, which is best suited for the players in the match, based on their IP-addresses (and implied geographical location).