Godot-matcha is an addon that lets you use WebRTC for multiplayer games by handling matchmaking using WebTorrent trackers. Conceptually it’s quite an interesting, novel approach.
WebTorrent uses a modified BitTorrent protocol that allows it to work with WebSockets. A WebTorrent tracker is essentially a directory service that keeps track of torrents offered by users. A torrent is uniquely identified by its info_hash, so if you have the torrent information, you can look up who is offering a file for download.
Rather than tracking a specific torrent file, godot-matcha generates a random identifier, which it uses as a room (or lobby). If another player has the same identifier they exchange the WebRTC’s SDP details to establish a connection.
Connecting players this way is essentially free. This is a suitable approach for mobile games, for example, where you start a game, and share an identifier with someone else to join in. Mobile party games, for example, use such an approach: One player starts a game, and others join by using some random id such as “FJRLE”.
While godot-matcha is a great proof of concept, I’ve done some testing that showed that the various clients disagree on their unique IDs. This results in challenges when setting the multiplayer authority, a key part of making the high-level multiplayer abstraction work well. The reason for the mismatch is how godot-matcha creates offers, which sets a random id as peer ID before the peers are even connected.
Just a couple of days ago, Godot 4.0 alpha 17 was announced. Today, Godot Engine 4.0 beta 1 was released. Be sure to check out the announcement. There are lots of improvements across the board; rendering, lighting, physics and navigation, animation, and scripting.
Hugo-Dz created Super Godot Galaxy: https://github.com/Hugo-Dz/super-godot-galaxy, which he announced in this Reddit post. It uses the 3D Starter Kit from Kenney and shows how to achieve the effect of applying gravity toward the center of a small spherical planet.
Creating network connections with Godot is simple — as long as you have the other party’s IP address, and there’s no NAT gateway involved. Unfortunately, that’s exactly the problem in most cases. You don’t know the other party’s IP, and these days, just about everyone is behind a combination wifi router/gateway/firewall with NAT. Conceptually, NAT …
The latest version of the inventory system is available and includes refinements for the interaction demo and the main tour. New features: We’ve also got a handful of bug fixes:
godot-matcha: Free multiplayer without a server
Godot-matcha is an addon that lets you use WebRTC for multiplayer games by handling matchmaking using WebTorrent trackers. Conceptually it’s quite an interesting, novel approach.
WebTorrent uses a modified BitTorrent protocol that allows it to work with WebSockets. A WebTorrent tracker is essentially a directory service that keeps track of torrents offered by users. A torrent is uniquely identified by its info_hash, so if you have the torrent information, you can look up who is offering a file for download.
Rather than tracking a specific torrent file, godot-matcha generates a random identifier, which it uses as a room (or lobby). If another player has the same identifier they exchange the WebRTC’s SDP details to establish a connection.
Connecting players this way is essentially free. This is a suitable approach for mobile games, for example, where you start a game, and share an identifier with someone else to join in. Mobile party games, for example, use such an approach: One player starts a game, and others join by using some random id such as “FJRLE”.
While godot-matcha is a great proof of concept, I’ve done some testing that showed that the various clients disagree on their unique IDs. This results in challenges when setting the multiplayer authority, a key part of making the high-level multiplayer abstraction work well. The reason for the mismatch is how godot-matcha creates offers, which sets a random id as peer ID before the peers are even connected.
In contrast, the godot-demo-projects repository has a webrtc_signaling demo, which uses the lobby/signaling server to tell the clients their ID, so that all clients (including the one acting as the server) add the same peer ID.
Related Posts
Godot Engine 4 reaches beta
Just a couple of days ago, Godot 4.0 alpha 17 was announced. Today, Godot Engine 4.0 beta 1 was released. Be sure to check out the announcement. There are lots of improvements across the board; rendering, lighting, physics and navigation, animation, and scripting.
Super Godot Galaxy Concept
Hugo-Dz created Super Godot Galaxy: https://github.com/Hugo-Dz/super-godot-galaxy, which he announced in this Reddit post. It uses the 3D Starter Kit from Kenney and shows how to achieve the effect of applying gravity toward the center of a small spherical planet.
Creating a UDP peer-to-peer connection
Creating network connections with Godot is simple — as long as you have the other party’s IP address, and there’s no NAT gateway involved. Unfortunately, that’s exactly the problem in most cases. You don’t know the other party’s IP, and these days, just about everyone is behind a combination wifi router/gateway/firewall with NAT. Conceptually, NAT …
Inventory System v1.5 available
The latest version of the inventory system is available and includes refinements for the interaction demo and the main tour. New features: We’ve also got a handful of bug fixes: