#Is there an simple tutorial to help get multiplayer working with the new Godot 4 multiplayer nodes?
83 messages · Page 1 of 1 (latest)
Is there an simple tutorial to help get multiplayer working with the new Godot 4 multiplayer nodes?
I've found a multiplayer fps example project on YouTube, if that would help you
I can link it
yes please!
This is what i used to start implementing it in my game: https://youtu.be/n8D3vEx7NAE?t=1334
I recommend that you navigate using the chapters of the video as this is not only networking, but an entire multiplayer FPS from scratch. I only watched the multiplayer parts tho.
How to make a simple online multiplayer FPS game in Godot 4 and play with friends over the internet. Big thank you to @ditzyninja for his Godot 4 networking content!
Git Repo: https://github.com/devloglogan/MultiplayerFPSTutorial
0:00 Intro
=== Blender Modeling ===
0:34 Environment Model
3:48 Pistol Model
=== Godot 4 Project Setup ===
6:56 Im...
oh my god
i've been following it for about half an hour
this is it
finally i can add multiplayer and godot basically trivialises it
tysm!

...and i've jinxed my self and got a gamebreaking problem
Assertion failed: UPNP Invalid Gateway!
@near mulch not sure if you know how to fix this, but any pointers would help
even just the right channel to ask for help in
problem called due to this code -
"UPNP Invalid Gateway!")```
||Im pretty sure it gets explained in the video..|| Upnp tries to automatically port forward on the router so that people outside of your network can join ur game
You can do it manually in router settings if upnp doesnt work, and delete the upnp code
yeah, but I'm not sure how to remedy the issue
what would i need to change?
You could just remove the assert()'s and all of its code inside and see if it still gives an error, I havent used the Upnp stuff much so Im not able to help much with it
If it does, removing the entire upnp function wouldnt break anything
Just makes hosting a game a bit more difficult (Most routers dont allow upnp by default either way so no difference)
i checked late last night and i think it still does
what would be some simple alternatives?
A longer project walkthrough to show you how the new MultiplayerSpawner and MultiplayerSynchronizer nodes can be used.
Project is up on Github - https://github.com/MitchMakesThings/Godot-Things/tree/main/Networking/Explained
Game Development Centre's Interpolation video - https://www.youtube.com/watch?v=w2p0ugw3afs
A quick demonstration of the MultiplayerSpawner and MultiplayerSynchronizer Nodes.
START PROJECT
https://github.com/TheGodojo/Multiplayer-Nodes-Starter.git
COMPLETED PROJECT
https://github.com/TheGodojo/Multiplayer-Nodes-Complete.git
Set up a server and client.
See how the @rpc annotation is used in Godot 4.
Completed Project
https://github.com/TheGodojo/Godot-4-Networking-Demonstration-Complete/archive/refs/heads/main.zip
Starter Project
found some other tutorials
not sure which ones would allow lobby-based remote multiplayer though
There is no alternatives
Upnp tries to port forward automatically
If its disabled in the router then theres no possible way other than manually going into the router control panel and making a port forward
Then just remove all upnp stuffs
then that just causes it to break and not work anymore
let me check
yep
player 2 can't join if i remove the limiting assert lines
As i said you should remove the entire upnp function as its only causing issues
If you want i can send you my minimal multiplayer example which i stripped out of that template from the video
yeah I didn't get what you meant since how else would clients connect
Upnp has nothing to do with clients
Its only trying to port forward on the host's router, when testing on your own network this isnt needed
When you wanna test with people outside of your own home network youll have to go into your router's settings and setup a port forward (Just google and watch a yt vid)
... or enable Upnp in the router itself, which could however allow any program to open ports if it wants to, afaik
Networking is confusing, dw
i guess ill have a look at other people's implementations
it's still easier than i expected with godot 4
The multiplayer nodes are your friend:)
yeah
as a follow up to this, found a really helpful playlist of videos
ORIGINAL PROJECTS (Clients)
RPC Networking Demonstration
https://github.com/TheGodojo/Godot-4-Networking-Demonstration-Complete.git
Multiplayer Nodes
https://github.com/TheGodojo/Multiplayer-Nodes-Complete.git
STARTER SERVER PROJECTS
RPC
https://github.com/TheGodojo/Dedicated-Server-RPC-Server-Starter.git
Multiplayer Nodes
https://github.com/Th...
in case anyone revisits this thread sometime before it's demise
Hi, could you take a look at this if you don't mind?
When I open the project in the editor I can rotate the character, but when I export and open the project I cannot rotate the character. Do you know how I can avoid this? 
Not sure - works for me
theres webrtc and holepunching
Can you elaborate on that?
Webrtc has protocols that allow peers to find each other https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Protocols
Hole punching is pretty simple:
Both peers send a udp packet to each other at their external ips and respective ports and the router will automatically port forward for the two (punch a hole).
They have to send a packet so their routers know where to send inbound packets, otherwise the router would get a packet to itself and not know which device to forward it to
You'll probably need a third server that the two peers talk to in order to orchestrate this (unless you're insane and do port knocking or icmp packet black magic)
Do i need to export for html5 for webrtc?
Or does it work on executables as well
Also, is there a tutorial you can recommend for this
I think so yes, but web export is supposedly unstable in Godot 4 atm. I don't have a good tutorial for either. I'm sure there's a repo here or there you could try out for WebRTC, but hole punching isn't that common now that things like steam relay or EOS are around (many games just make people port forward)
I see, is there a tutorial on how to use steam/eos on Godot?
I couldn't find much
Gramps is working on something called godotsteam, it has its own discord and GitHub repo but it doesn't work with the multiplayer API. EOS has a 3.x unofficial wrapper
https://godotsteam.com/
https://github.com/3ddelano/epic-online-services-godot
An open-source and fully functional Steamworks SDK / API module and plug-in for the Godot Game Engine.
did you ever find anything helpful for gd4 WebRTC?
I'm trying to get it to work in place of some web socket stuff I was doing.
web platform or like windows linux platforms?
I think a gdextension needs to be installed and a websocket signaling server
This is the obvious information. The information I don't have is where it breaks. Aka the non obvious things
I think that's what I need. I need to learn git and github better. Thanks!
Let me know where it breaks
Seems like my big challenge is certificates. What I was hoping to do was a jackbox style game where a computer would serve as the host/server and then people would connect from their phones but was planning on LAN only and just direct connecting with IP. But now it appears godot 4 only allows websocket connections that are secured, so the host PC needs to have a proper certificate. Same issue for webRTC where it needs a signaling server that can do WSS. So it seems like I'll need a proper signaling server or force godot4 to allow WS without security.
I guess having my host accept WSS somehow would also work.