You, my friend, have saved my life. I learned Godot 3's multiplayer, and a lot changed in Godot 4. You taught me everything I needed to know in a 5 minute video. THANK YOU!
DitzyNinja, thank you so much for your videos concerning multiplayer in Godot 4.0. I've been super busy over at work since 4.0 alphas have begun being released back in Jan or Feb., and haven't been able to properly research all the differences between 3.x and 4.0 so I haven't been able to update my project accordingly. I don't know if you've ever come across Game Development Center with Stefan, but he did a 20 part series on dedicated multiplayer back in 2020 using Godot 3.x that I was able to follow along with and reference to build my own framework specifically for what I wanted to accomplish. This video, along with some of your others, has been helping me begin to bridge the gaps between the two versions. Still have a long LONG way to go, but will eventually get there. Thank you again for sharing your knowledge with us to help steer us the right way using this new 4.0 version of Godot!!
Hey sorry for the late reply man. I watched a few of Stefan's videos from that series. It's awesome. I can't even imagine how much work that took. And you're very welcome. I'm really glad my videos have been so much help!
Amazing tutorials, absolute godsend, but I have a couple questions: What’s the advantage of having a separate project for the server, wouldn’t that make adding new networking features an extra hassle? Why not just add - server to the launch flags? Do the multiplayer nodes handle client prediction on their own?
Why do you put position and y_rotation variables on the multiplayersynchronizer? You can just get them to sync direct from the player script and it still works..
Thanks for the video - that's a valuable contribution :) Just so that I understand it correctly.. What you set up here, is a dedicated server, but not an authorative server, right? So the players still send the commands to set their locations on all connected peers, rather that the server would have authority over that, right? Therefore you also need these empty rpc-placeholder-functions in the server project..?
Multiplayer nodes do a lot of the work for you, but you don't have as much control. So if all you need is spawn/despawn and property synchronization, use the nodes. If your project requires more complex networking, use the RPC functions or use even lower classes.
Thanks for posting this! I'm new to Godot, and I decided to use Godot 4 in part because of the new networking nodes, but it's hard to find resources on Godot 4 networking. Your tutorials are very helpful. Did you ever figure out why you couldn't sync the position, rotation, etc. variables directly from the Player/CharacterBody3D? I think that was a problem in the last video. Also, do you have any plan about showing how to make this server authoritative (ie in charge of actually moving the player positions based off of their input)? If so, that would be super super helpful! Thanks again!
No problem! I'm glad they've been helpful! I wasn't able to figure it out. I tested it out with the beta and it still wasn't working as I would expect. I did submit it on Github and it was marked as a bug though, so it seems like our lord and saviors (The Godot team) are looking into it :) I wasn't planning on making a video on that, but it is a good idea! Maybe sync properties for each is_action_pressed input and use rpc for is_action_just_pressed inputs?
In order to make this server authoritative, you could sync just the input actions e.g. by making RPCs from the clients to the server and let the server actually move the characters and then sync those positions etc. to the clients.
when i use the tutorial networking demonstration demo i do not see any characters when i press play on the editor . just chatbox and green floor. i cant move or anything
Thanks for your content, big help as there is no documentation around. Do you also have a video how to implement to cheat safe network code? so basically clients can only offer input, but the server decides all movement.
MultiplayerSpawner for scenes that are added and removed from the scene_tree at run time. MultiplayerSynchronizer for properties with values change often and should be synced at regular intervals. RPCs for everything else.
@@ditzyninja yes I cloned both repo from GitHub :/ The add character method on the client is never called when I press join, you placed it in the host button but we are not using this button anymore with a dedicated server (did I get something wrong ?)
That is cool. Thank you for sharing this multiplayer online tutorial. Is there any way you could create a cyber security anti-aimbot cheat online tutorial video very soon?
hey I am in the 2 min mark and i get these errors when the second client connects. E 0:00:08:0643 get_node: Node not found: "Main/320213936" (relative to "/root"). Method/function failed. Returning: nullptr scene/main/node.cpp:1620 @ get_node() E 0:00:08:0643 process_simplify_path: Condition "node == nullptr" is true. modules/multiplayer/scene_cache_interface.cpp:77 @ process_simplify_path() E 0:00:08:0645 get_node: Node not found: "Main/320213936" (relative to "/root"). Method/function failed. Returning: nullptr scene/main/node.cpp:1620 @ get_node() E 0:00:08:0645 _process_get_node: Failed to get path from RPC: Main/320213936. modules/multiplayer/scene_rpc_interface.cpp:165 @ _process_get_node() E 0:00:08:0645 process_rpc: Invalid packet received. Requested node was not found. Condition "node == nullptr" is true. modules/multiplayer/scene_rpc_interface.cpp:228 @ process_rpc() I am pretty sure I did everything according to the tutorial. Can you help me with these?
You, my friend, have saved my life. I learned Godot 3's multiplayer, and a lot changed in Godot 4. You taught me everything I needed to know in a 5 minute video. THANK YOU!
I was having trouble trying to make rpc calls, but I was just missing having the same calls in both client and server, tysm!
This video is so dense with information, I feel like I watched it 100 times and am still noticing stuff I missed
Hopefully that's a good thing lol
I just love you man, this was perfectly timed. just when I needed it.
That's awesome! Glad to hear it
same
DitzyNinja, thank you so much for your videos concerning multiplayer in Godot 4.0. I've been super busy over at work since 4.0 alphas have begun being released back in Jan or Feb., and haven't been able to properly research all the differences between 3.x and 4.0 so I haven't been able to update my project accordingly. I don't know if you've ever come across Game Development Center with Stefan, but he did a 20 part series on dedicated multiplayer back in 2020 using Godot 3.x that I was able to follow along with and reference to build my own framework specifically for what I wanted to accomplish. This video, along with some of your others, has been helping me begin to bridge the gaps between the two versions. Still have a long LONG way to go, but will eventually get there. Thank you again for sharing your knowledge with us to help steer us the right way using this new 4.0 version of Godot!!
Hey sorry for the late reply man. I watched a few of Stefan's videos from that series. It's awesome. I can't even imagine how much work that took. And you're very welcome. I'm really glad my videos have been so much help!
Amazing tutorials, absolute godsend, but I have a couple questions:
What’s the advantage of having a separate project for the server, wouldn’t that make adding new networking features an extra hassle? Why not just add - server to the launch flags?
Do the multiplayer nodes handle client prediction on their own?
thanks for this video, helped a lot, so if i understand correctly networkNodes/synchronizers are more for prototyping part i guess ?
Awesome video! Thanks a bunch :)
My pleasure!
Why do you put position and y_rotation variables on the multiplayersynchronizer? You can just get them to sync direct from the player script and it still works..
There was a bug that prevented the properties set on the clients from syncing to the server.
Thanks for the video - that's a valuable contribution :)
Just so that I understand it correctly.. What you set up here, is a dedicated server, but not an authorative server, right? So the players still send the commands to set their locations on all connected peers, rather that the server would have authority over that, right?
Therefore you also need these empty rpc-placeholder-functions in the server project..?
So what is the difference between the 2 projects? Like what are the advantages of the rpc project vs the multiplayer nodes project?
Multiplayer nodes do a lot of the work for you, but you don't have as much control. So if all you need is spawn/despawn and property synchronization, use the nodes. If your project requires more complex networking, use the RPC functions or use even lower classes.
Thanks for posting this! I'm new to Godot, and I decided to use Godot 4 in part because of the new networking nodes, but it's hard to find resources on Godot 4 networking. Your tutorials are very helpful.
Did you ever figure out why you couldn't sync the position, rotation, etc. variables directly from the Player/CharacterBody3D? I think that was a problem in the last video.
Also, do you have any plan about showing how to make this server authoritative (ie in charge of actually moving the player positions based off of their input)? If so, that would be super super helpful!
Thanks again!
No problem! I'm glad they've been helpful!
I wasn't able to figure it out. I tested it out with the beta and it still wasn't working as I would expect. I did submit it on Github and it was marked as a bug though, so it seems like our lord and saviors (The Godot team) are looking into it :)
I wasn't planning on making a video on that, but it is a good idea! Maybe sync properties for each is_action_pressed input and use rpc for is_action_just_pressed inputs?
In order to make this server authoritative, you could sync just the input actions e.g. by making RPCs from the clients to the server and let the server actually move the characters and then sync those positions etc. to the clients.
when i use the tutorial networking demonstration demo i do not see any characters when i press play on the editor . just chatbox and green floor. i cant move or anything
Thank you so much!
You're welcome!
Thanks for your content, big help as there is no documentation around. Do you also have a video how to implement to cheat safe network code? so basically clients can only offer input, but the server decides all movement.
I don't yet. Someone else suggested to this as well though, so I might get around to it at some point.
And you're welcome! I'm glad it's helpful!
When would you want to use RPC vs the multiplayer nodes?
MultiplayerSpawner for scenes that are added and removed from the scene_tree at run time.
MultiplayerSynchronizer for properties with values change often and should be synced at regular intervals.
RPCs for everything else.
Awesome video!
Thanks!
Is it possible install server project inside AWS EC2 for example?
is this gonna be public or local?
I have a problem with you multiplayer nodes project, the player is not added on the client side do you know why ?
Hmm. Did you download the project I have in the description?
@@ditzyninja yes I cloned both repo from GitHub :/
The add character method on the client is never called when I press join, you placed it in the host button but we are not using this button anymore with a dedicated server (did I get something wrong ?)
it was my fault the player path in my server multiplayer spawner was not the same as the client one ... sorry
That is cool. Thank you for sharing this multiplayer online tutorial. Is there any way you could create a cyber security anti-aimbot cheat online tutorial video very soon?
You're very welcome. Unfortunately I'm not very well versed in anti-cheat/security stuff
Is there a way to do both P2P networking and Dedicated Server using the same project and code?
Like an option to create a server without adding the host as a player?
Is it possible to implement the server in Typescript but keeping the same code in the client? Also is it recommended to do it?
thanks
Does this work if i add this to html game
I just tried and it doesn't. Maybe with websocket
Is anyone else struggling with this?
yes like how did he get that client name like that. Am i downloading the right sht?
hey I am in the 2 min mark and i get these errors when the second client connects.
E 0:00:08:0643 get_node: Node not found: "Main/320213936" (relative to "/root").
Method/function failed. Returning: nullptr
scene/main/node.cpp:1620 @ get_node()
E 0:00:08:0643 process_simplify_path: Condition "node == nullptr" is true.
modules/multiplayer/scene_cache_interface.cpp:77 @ process_simplify_path()
E 0:00:08:0645 get_node: Node not found: "Main/320213936" (relative to "/root").
Method/function failed. Returning: nullptr
scene/main/node.cpp:1620 @ get_node()
E 0:00:08:0645 _process_get_node: Failed to get path from RPC: Main/320213936.
modules/multiplayer/scene_rpc_interface.cpp:165 @ _process_get_node()
E 0:00:08:0645 process_rpc: Invalid packet received. Requested node was not found.
Condition "node == nullptr" is true.
modules/multiplayer/scene_rpc_interface.cpp:228 @ process_rpc()
I am pretty sure I did everything according to the tutorial. Can you help me with these?
you are referencing to a node that doesnt exist, check if your node path is correct( the one with the $ or in get_node )