Godot + Steam P2P Multiplayer

preview_player
Показать описание
In this video we look at an amazing solution for Godot P2P multiplayer using GodotSteam.
It uses the newer SteamMultiplayerPeer library so that you don't have to rewrite your multiplayer code if you used Godot's High Level Multiplayer APIs, such as MultiplayerSynchronizer, MultiplayerSpawner, and RPCs.

We also cover a strategy to easily swap between the default ENet networking solution and SteamMultiplayerPeer, so you can develop and test your multiplayer game on the same computer, then when ready, seamlessly switch to the Steam solution.

--------------------------------------------------------------------------------------------------------

You'll need these two starred things to follow along in the video

[Base Multiplayer Project if you want to follow along]

[Completed project]

This is the custom Godot build with Steam and SteamMultiplayerPeer support.
- Download the pre-compiled build for your OS. Open this and import the cloned project above. @1:28 in the video:
- Download the templates zip so you can export it, @49:57 in the video.

--------------------------------------------------------------------------------------------------------

[Brackeys Godot Tutorial and Project ]

--------------------------------------------------------------------------------------------------------

[Looking for the code?]

👋 Let's talk shop 👇

[Resources]

[Init Steam]

[Exporting with Steam]

[Godot Steam GDExtension 4.1/4.2 (Not using here)]

[Steam Multiplayer Peer Plugin (Not using here)]

[Steam Overlay Issues]

------------------------------------------------------------------------------------------------------------
00:00:00 SOLUTION OVERVIEW
00:01:07 GETTING STARTED
00:04:09 STEAM UI
00:11:38 INIT STEAM
00:19:06 NETWORK MANAGER
00:28:53 ENET NETWORK
00:30:58 STEAM NETWORK
00:37:10 LIST STEAM LOBBIES
00:44:15 JOIN LOBBY
00:45:26 MULTIPLAYER MANAGER CLEANUP
00:47:35 TEST CHANGES
00:49:56 EXPORT CLIENT
00:51:28 MULTI-COMPUTER TEST
00:52:29 USERNAME SUPPORT HACK
00:58:14 TEST WITH STEAM USERNAMES
01:00:45 WHAT’S NEXT

#steam #steamgame #p2p #steammultiplayer #steammultiplayerpeer #godotsteam #steamp2p #2dgame #respawn #pvp #health #animations #gamedevelopment #2dmultiplayer #godotstartertemplate #godot #godottips #gametech #gamedev #indiedev #multiplayer #network #godotengine #brackeys
Рекомендации по теме
Комментарии
Автор

For a better lobby query 41:20, right before you run [Steam.requestLobbyList], consider adding a filter on the lobby name:
> Steam.addRequestLobbyListStringFilter("name", "YOUR LOBBY NAME", Steam.LOBBY_COMPARISON_EQUAL)

BatteryAcidDev
Автор

I've made a few simple 2D games in my own time and am now currently moving onto 3D. After that, Multiplayer P2P Steam was the next thing i wanted to implement/get into and this is exactly what I needed. Thank you for your efforts and knowledge sharing! 🔥💎

raphmoite
Автор

I've been stuck on finding out what to do with multiplayer setup but these multiplayer tutorials are just amazing!
Liked and Subbed!

noinoinoi
Автор

Whoa this took 5h to implement for my survival game but it's so cool. Thanks!

m.a.t.a.s
Автор

48:46 Just to clarify, you don't HAVE to export the project, you just have to have the editor with the same files open on a different computer. What I like to do is have the project on a private github repository for version control and pushing changes to a seperate branch for testing, with my laptop set up with a contributor account for ease of updating the game files. It does take a bit to get the hang of it but it is VERY useful. I suggest you look up a video on how to set up a repository with the github desktop application, because it makes pretty much all the commands you would instead type out manually in the console a visual button you can just press

legowyn
Автор

Very much appreciated the videos! Can't wait to see the lag issues improved!

aaamott
Автор

Awesome tutorial! I am really looking forward to a setup, that way the character still feels good/not laggy when on a slightly bad connection. Maybe also letting the player be responsible for their position and having the server verify it instead of just streaming the button inputs.

Keep up the amazing work!

kylevasulka
Автор

You can use a virtual machine to launch another instance of steam on the same machine to test your game.

DayOfCasual
Автор

Thank you so much for letting us know where to find the Steam dll, have been struggling with the export with various tutorials so far.

dajajax
Автор

wow!! I doubt I can found such practical game dev tutorial for free anywhere.

AnkitSinghKushwah
Автор

Oh my goodness this is just what I needed!!

Lacozy
Автор

Another awesome video. I love it 33:59

goldenman
Автор

Hey so I tried this out and it mostly works. The only problem is when testing with 3 or more players. Whenever we try to test, the multiplayer synchronizer for the 2nd player will not work for the 3rd player. Basically players will not be able to see the movements of other players who joined before them. Do you know how to fix this?

BigEraser
Автор

Sadly this only seemed to work on one of my two testing pc in both directions (server and client). When my second user tried to join a lobby, only a dummy character is spawned on the host and on client side the view has the zoomed out error state. Any ideas what could be the reason behind it, or how to fix it?

And I loved that you did a video about the topic in general. But I feel like as third video in this series you went from a little too fast in the first one, to a little better to work with it, to too fast again in this one. In the later parts where we see you directly typing the code it was a little easier to follow, but everytime you made a cut to your finished code I hat to hot-button pause, because you never really seem to show it long enough to work at the same speed as you. I feel like, the flow of the video would work better if you either, blend over to finished code earlier and show it longer, or show the whole thing while typing it?

letmeflyxthat
Автор

35:38 I'm assuming you're just showing everyone what you just did, but now I'm second-guessing myself about what the arrow meant

isaiah
Автор

I would 10000% love to see the build with the other Steam Multiplayer asset. Having to rely on a separate build is a bit wonky

shinypennygames
Автор

Waiting for some lag optimization for the project, keep it up!

marcelpriztonsikorski
Автор

Another question, could someone explain to me why does "active_network" recognize "_players_spawn_node" as being its internal variable, when it belongs to "network_manager"? At 26:38

DragilusGame
Автор

What's the main reason for putting the network manager in the scene instead of global ?

rootoo
Автор

Excellent video, I really learned a lot, but I have two questions that bothered me a lot.
1 - Because if I click on the jump more than once it will jump once and then when it falls it will jump again, since no buffer was defined for it to store this command, why did it jump again?
2 - Is there any way to remove this lag that I notice in the movement, even on my host machine I can see the character going back and forth sometimes?

DragilusGame