#Is there an simple tutorial to help get multiplayer working with the new Godot 4 multiplayer nodes?

83 messages · Page 1 of 1 (latest)

inner atlas
#

If not, can anyone help me create simple lobby-based multiplayer?

#

Is there an simple tutorial to help get multiplayer working with the new Godot 4 multiplayer nodes?

near mulch
#

I've found a multiplayer fps example project on YouTube, if that would help you

#

I can link it

near mulch
#

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...

▶ Play video
inner atlas
#

i've been following it for about half an hour

#

this is it

#

finally i can add multiplayer and godot basically trivialises it

#

tysm!

inner atlas
#

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!")```
near mulch
#

You can do it manually in router settings if upnp doesnt work, and delete the upnp code

inner atlas
near mulch
#

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)

inner atlas
inner atlas
#

found some other tutorials

#

not sure which ones would allow lobby-based remote multiplayer though

near mulch
#

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

near mulch
inner atlas
#

let me check

#

yep

#

player 2 can't join if i remove the limiting assert lines

near mulch
#

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

inner atlas
#

I'll have a look

inner atlas
near mulch
#

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

inner atlas
#

i am inherently stupid

#

but is it needed when trying to play with other people?

near mulch
#

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

inner atlas
#

damn

#

ok

near mulch
inner atlas
#

i guess ill have a look at other people's implementations

#

it's still easier than i expected with godot 4

near mulch
#

The multiplayer nodes are your friend:)

inner atlas
#

yeah

inner atlas
#

as a follow up to this, found a really helpful playlist of videos

#
#

in case anyone revisits this thread sometime before it's demise

simple grotto
near mulch
idle copper
#

theres webrtc and holepunching

normal thicket
blissful pasture
# normal thicket 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)

This article introduces the protocols on top of which the WebRTC API is built.

normal thicket
#

Or does it work on executables as well

#

Also, is there a tutorial you can recommend for this

blissful pasture
# normal thicket Do i need to export for html5 for webrtc?

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)

normal thicket
#

I couldn't find much

blissful pasture
#

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

GitHub

Unofficial Epic Online Services wrapper for Godot Engine 3.x (includes demo project) - GitHub - 3ddelano/epic-online-services-godot: Unofficial Epic Online Services wrapper for Godot Engine 3.x (in...

fast sapphire
#

I'm trying to get it to work in place of some web socket stuff I was doing.

idle copper
#

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

fast sapphire
#

I think that's what I need. I need to learn git and github better. Thanks!

idle copper
#

Let me know where it breaks

fast sapphire
# idle copper 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.