drwhut / tabletop-club

An open-source platform for playing tabletop games in a physics-based 3D environment for Windows, macOS, and Linux! Made with the Godot Engine.
https://tabletopclub.net
MIT License
1.28k stars 55 forks source link

Decentralised multiplayer #230

Closed GrimPixel closed 1 year ago

GrimPixel commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, the game's multiplayer relies on Duck DNS, which is a centralised.

Describe the solution you'd like Add federated and P2P options for multiplayer.

drwhut commented 1 year ago

At this stage, I'm not so sure if this is necessary. I'll try to break down my thoughts on this:

GrimPixel commented 1 year ago

There is a possibility that Duck DNS goes down. In the ideal situation, a player can simply send an invitation code that expires shortly to others, and everything including connections and calculations of physics is done on the host's computer. Is it possible to be like this: the host can also detect disconnections, instead of relying on a master server?

drwhut commented 1 year ago

There is a possibility that Duck DNS goes down.

This is true, and the master server can also go down too - but this is a risk I'm currently willing to take since a. I'm hosting this master server for free, and b. the likelihood of either service going down at any given time is slim.

In the ideal situation, a player can simply send an invitation code that expires shortly to others, and everything including connections and calculations of physics is done on the host's computer. Is it possible to be like this: the host can also detect disconnections, instead of relying on a master server?

The host performs all of the physics simulation, and simply sends the results to the other clients.

In terms of the connections, unfortunately we cannot rely solely on the host to detect disconnects - the reason I keep the connection alive with the master server is because under specific circumstances, Godot by itself is not able to detect if a client has broken their connection (this usually happened under two circumstances: if too much data was sent over the wire at once, or if the client's internet connection was suddenly broken).