Making peer-to-peer multiplayer seamless with Godot (2022)
rafa.ee
rafa.ee
Steam used to work this way iirc, but they now always use a relay. This is user friendly, because with normal peer to peer your IP address is given to other players. DDOSing, bringing down Twitch streams, and all sorts of unfun things can result from that. Of course, this does give steam your users' IP addresses.
A rendezvous is unavoidable, even for UDP P2P. The hole puncher server would be the rendezvous -- or the STUN (P2P) / TURN (TCP) server if you wanted to make the smarter choice and use an existing protocol. Either way, the rendezvous gets the IP no matter what.
The only way to avoid leaking the IP to some middle party is to use port forwarding and manual communication of the IP.
You're responding to someone who is concerned that the enemy player is going to cheat and your suggestion is to straight up tell him what to DoS?
Gamers are incredible at breaking things when using your product legitimately, once they decide to look behind the curtain you are in trouble. One of the big advantages (acknowledging the downsides) of in cloud gaming is it dramatically reduces the scope for this.
For the tutorial, once you read the basic syntax of GDScript, you can directly start coding a game of your choice and reading the docs on need. Or use the official 2D and 3D tutorial.
(This is how I learnt, YMMV)
Account system and matchmaker:
https://github.com/heroiclabs/nakama-godot
Top tier tutorials on multiplayer:
https://gafferongames.com/post/what_every_programmer_needs_t...
Godot 3's browser support is currently better than Godot 4's (it was when I tested anyways, this changes every day and I don't use Godot 4).
Making multiplayer work really well usually requires a dedicated server and client side prediction. There's a lot of complexity to making that happen however.
You can use nakamas' messaging system as a transport layer for a game hosted on a user's device. Or you can use nakamas' match API to host the game in nakama, but then the game logic needs to be written for nakama in go, js, or Lua, which you can't then run locally in Godot.
One could abuse BitTorrent's existing DHT infrastructure (:
You unfortunately need ubiquitus IPv6 support to actually rely on IPv6, which isn't going to happen anytime soon.
So you really need to consider the benefits of dual stack v4 and v6 simultaneously within the same group of players. Might be useful, but it adds a whole heap of complexity.
The problem is deploying CGNAT without also providing IPv6 as an alternative.
My ISP blocks such connections on LTE mobile network. Maybe so you don't pay a lot of money for traffic if people DoS you? It doesn't make sense, since ICMP ping packets are allowed.
Well, it's either my ISP or the android phone I have. Does android have any firewalls enabled by default?
The number of simultaneous players on your little indie game are just not going to cause one medium sized server to break a sweat.
I'm always super happy to see when a game supports zero-internet LAN play. That means I'm still going to be able to play it in 15 years if I want.