I actually have three questions in one with regards to Godot's networking after poking the documentation and I've been meaning to ask. Is the default networking peer to peer? From what I understand of tutorials is it seems to be and if so is it possible to set the multiplayer up so that you can run a master server so to speak off your own dedicated server as well as have it run off a peer to peer system? If it isn't peer to peer, is that sort of system supported by Godot or will be in the future?

I bring this up because I'm very interested in peer to peer but I want to know how flexible Godot's multiplayer really is.

Hi,

By default Godot multiplayer is designed to be peer to peer, but it is possible to make one server managing all players.

You can check these tutorials:

They are very well explaining all major design when it comes to global server multiplayer. I personally follow that tutorial series and adapted them for my project and for now it is working well (tutorial is shown on 2D game example, but my project is 3D and anyway I'm really happy with results so far)

Oooo! Thanks, that cleared a lot up, I'm very interested in the concept of peer to peer multiplayer and checking out how stable it is for the sake of game longevity. I can imagine peer to peer being extremely useful for very small scale game projects.

Peer to peer is working the best probably for local multiplayer games and by "local" i mean multiplayer where one of players host game for others. For that I think Godot multiplayer is suited even better than for global server, since rpc calls by default are send to all other peers and call method for the same node path they are send from, so if every player have the same scene structure it is a lot easier to use that API.

With one global server it is a bit more complicated, but still possible.

I'm mainly thinking about cost as well with regards to peer to peer vs paid matchmaking or dedicated servers, it will be really fun being able to make small scale games that could even be setup for free. If you did it in the traditional way you'd be constantly having to worry about cost if the game gets popular and more people want to play it.

5 days later

@GlyphTheWolf said: By default Godot multiplayer is designed to be peer to peer, but it is possible to make one server managing all players.

Actually, Godot's high-level multiplayer uses a client-server architecture. It's just that the documentation demonstrates how to use it in a situation where one of the players hosts the server on their own machine using a client that also acts as a player. This is sometimes called a "listen" server.

In contrast, in a dedicated server scenario, the server host is not a player client.

It's possible to support both "listen" and dedicated server scenarios in the same project with a minimal amount of code. Here's an example of a project that does this: https://github.com/Calinou/platshoot

If Godot's high-level multiplayer used a true peer-to-peer architecture, every player would have to forward a port on their router to play (except one non-host player for whom it's optional to do so). With the client-server architecture, only the server host has to forward a port on their router to make the server accessible to the public Internet.

Thank you for the extra information there, to be fair to @GlyphTheWolf he probably meant peer to peer by today's standards. Everything is so centralised now I think it's to the detriment of general usage. Too many points of failure for my liking so even being able to host your own server on a home PC is considered a radical concept.

Don't get me wrong, there are some games that still allow you to setup a dedicated server like that but for the most part it's now all big dedicated servers or matchmaking done on big server mainframes that handle everything from what I understand.

I'm definitely going to keep poking around this as I find it fascinating, I keep wondering how well a pure peer to peer system would cope given how much technology keeps improving. For example would it be really necessary to even have a dedicated server setup for a simple quake style team deathmatch FPS? Or would I need to downgrade to something 2D and extremely simplified for peer to peer to work smoothly?

I mean one thing I toy around with in my head is maybe some kind of stress test where you have peer to peer connections for a big top down 2D shooter free for all or something and try and have 100 players connecting with each other. Given how Godot is open source there will be all kinds of ways to mess around with that.

@Calinou said:

@GlyphTheWolf said: By default Godot multiplayer is designed to be peer to peer, but it is possible to make one server managing all players.

Actually, Godot's high-level multiplayer uses a client-server architecture. It's just that the documentation demonstrates how to use it in a situation where one of the players hosts the server on their own machine using a client that also acts as a player. This is sometimes called a "listen" server. Yes, right. I was thinking a bit later about that (after I added comment already) and then I realized it's not technically real peer to peer. When I wrote that I was more thinking about that only players are connected together without global server in between, but later I realized that real peer to peer would be that each player is connected with each other by itself and that is not how Godot multiplayer API works by default, so I agree maybe my comment was not exactly right about that.

@GlyphTheWolf said: Peer to peer is working the best probably for local multiplayer games and by "local" i mean multiplayer where one of players host game for others.

---

@Calinou said:

@GlyphTheWolf said: By default Godot multiplayer is designed to be peer to peer, but it is possible to make one server managing all players.

Actually, Godot's high-level multiplayer uses a client-server architecture. It's just that the documentation demonstrates how to use it in a situation where one of the players hosts the server on their own machine using a client that also acts as a player. This is sometimes called a "listen" server.

A good example of that(on a surprisingly large scale I might add) is warframe. Host migrations are notoriously hated by the players though.

2 years later