Godot
Bullet Mayhem is a 2D 1v1 shooter built with Godot that demonstrates dedicated server hosting on GameFlow using a direct connection (IP and port).

Prerequisites
- Access to the Bullet Mayhem repository (Early Adopter access required, contact GameFlow support)
- A GameFlow account
- Godot 4.6
Step 1: Clone the Repository
git clone https://github.com/GameFlowGG/bullet-mayhem
cd bullet-mayhem
Step 2: Open the Project
- Launch Godot 4.6
- Click Import on the project manager
- Navigate to the cloned
bullet-mayhemdirectory - Select the
.godotproject file - Click Import & Edit
Step 3: Install the Agones SDK
GameFlow uses Agones for game server lifecycle management. Install the Godot SDK:
- Clone the Godot Agones SDK
- Copy the
addons/agones_sdkfolder into your project'saddons/directory - In Godot, go to Project → Project Settings → Plugins
- Enable the Agones SDK plugin
Step 4: Agones Integration
The Bullet Mayhem project demonstrates the key Agones SDK integration patterns.
Initialization
func _ready():
AgonesSDK.start()
multiplayer.peer_connected.connect(peer_connected)
multiplayer.peer_disconnected.connect(peer_disconnected)
if "--server" in OS.get_cmdline_args():
hostGame()
Health Checks
var elapsed_time = 0.0
func _process(delta):
if peer:
elapsed_time += delta
if elapsed_time >= 60.0:
AgonesSDK.health()
elapsed_time = 0.0
Player Tracking
GameFlow tracks player counts through the Agones players list (Counters & Lists). The Godot plugin doesn't expose this, so report players through the local Agones REST API:
var agones_port = OS.get_environment("AGONES_SDK_HTTP_PORT")
if agones_port == "":
agones_port = "9358"
var base_url = "http://localhost:" + agones_port
func update_player_list(player_id: String, op: String):
var http = HTTPRequest.new()
add_child(http)
var body = JSON.stringify({"value": player_id})
http.request(base_url + "/v1beta1/lists/players:" + op,
["Content-Type: application/json"], HTTPClient.METHOD_POST, body)
func peer_connected(id):
if multiplayer.is_server():
update_player_list(str(id), "addValue")
func peer_disconnected(id):
if multiplayer.is_server():
update_player_list(str(id), "removeValue")
See Player Tracking for the full list of supported engines and SDKs.
Server Start
func hostGame():
peer = ENetMultiplayerPeer.new()
var error = peer.create_server(server_port, 2)
if error != OK:
return
peer.get_host().compress(ENetConnection.COMPRESS_ZLIB)
multiplayer.set_multiplayer_peer(peer)
AgonesSDK.ready()
The player list capacity comes from the Max Players per Server value you set on the game in GameFlow, so the server doesn't set it.
Step 5: Export and Zip
- In Godot, go to Project → Export
- Click Add... and select Linux/X11
- Click Export PCK/Zip → save as
game.pck - Create a
.zipfile containing the exported PCK
Step 6: Create a Game on GameFlow
- Log in to your GameFlow account
- Navigate to the Games section → Create New Game
- Set Name to
Bullet Mayhem
Step 7: Configure Server Settings
- Set Memory to
1GB - Set vCPU to
1 core - Set the Port to
8910 - Enable the us-east region
Step 8: Deploy and Test
- Upload the
.zipfile in the builds section - Click Create Test Server, wait for the server to reach "Ready"
- Run the game locally in Godot, enter the server IP and port, and click Join
