client connecting to game instance in a container

Godot Version

4.4.1

Question

I’m thinking about a single player action puzzle game with leaderboards, which led me to consider verification of scoring…

My current architecture approach is broken into three parts. A client, which runs the game, but that is connected to a server instance in the cloud which receives game events and independently produces the final score. It’s a simple, deterministic game, no physics, so I think this is doable.

So far I have

  • the client
  • a “game instance” which runs in headless mode
  • a backend (FastAPI) which can create game instances

The client makes an http request to the backend to create a game instance.
The client then polls a status endpoint with a session id to know when the instance has been created, and from which it can get the ip/external port of the instance.
The backend (here’s where it gets complicated) creates the game instance in a container.
Running locally, the game instance creation works, and logging says that it gets up and running.

Once the client and (server) instance are running, I’m trying to connect them with ENetMultiplayerPeer’s.

I create the server’s peer on port 8000, which is exposed in the Dockerfile, which I think it would use to get to the outside…
var enet_peer := ENetMultiplayerPeer.new()
var error = enet_peer.create_server(8000, 1, 0, 0)

I create the client’s peer on whatever port the container creation returns:
client_peer = ENetMultiplayerPeer.new()
var error = client_peer.create_client(container_ip, int(host_port))
if error != OK:
print("Error creating client: " + error)
return

I don’t see any error messages on either side, but neither to any of the connected callbacks fire, so I’m not sure what’s making it across.

I think the main thrust of my question is, has anyone gotten ENetMultiplayrPeer to work across a container boundary?

But of course, I could be wrong in other, more creative ways too.

Also, can anyone recommend any sort of low level tool I could use to watch communication between these entities?

Honestly, I have NO experience with networking in Godot, but I did work professionally with Docker, so hopefully it helps.

Good luck!

Thanks for the tips!
I’m still a docker/networking noob so there are lots of tools and tricks I’ve yet to learn to apply.

I’m pretty sure this architecture is total overkill for a single player game, but I’ve learned so much from making it that it’s been worth the experience.