Just wanted to say that your post was incredibly helpful. I wouldn't have caught the whole "signatures must match" part for client and server. It is definitely something that will catch one off guard if they don't expect it... but thankfully I don't have to go through that pain thanks to you :)
Thank you so much for this video. I ran into this video on reddit and this was the only video that was so simple and helpful and ACTUALLY WORKED. Thank you so much for your work!!!
Fast,Helpfull, thank you, i had client-client networking projects before in Godot 3.x, even while being new to me you make it very clear, have a nice day.
Okay so this is REALLY cool, but Ive got a bit of an issue with the whole "same rpc function needing to be on server and client" thing...I thought maybe you misunderstood but nope, its literally in their documentation that even unused functions need to be declared on both. =/ I guess you just have to act like its basically a signal being called or something if you only need it on a client. I havent tried doing multiplayer on godot yet, but will try this weekend. Im thinking that maybe a good work-around for this is to use a "ClientAction" rpc function and a "ServerAction" rpc function with both taking a string parameter. This string could be sent to a match statement that calls a different function that is NOT an RPC. Not a big deal but I think it would do a lot to help organization instead of having a million rpc functions that are just "pass" or returns. The bonus to doing this could also mean you could easily set up signal-like reactions to server/client functionality.
I am happy that you found it useful! And I am happy to have found someone else with the same issue. If have any experiences in using Godot 4 in such a setup, please don't hesitate to share. I will try to do the same, but won't have much time for the project in the next weeks, unfortunately...
What about connect to another standalone server written on java for example or other langauge? We can connect to external server from godot client? and what we write to connect it? Thanks.
I am not sure what exactly you want to achieve. Yes, you can talk to servers written in other languages. I show an example here for realizing a server-browser: ruclips.net/video/x-PF_EZI2ZM/видео.html So, for retrieving any kind of data, this works quite well, using e.g. the HTTPRequest system, or working with the UDP-Server. Although I never tested the UDP-Server to another software platform, such as java.. But for the actual game-logic, I don't see any advantage in having the game-server in anything else then Godot. Again, technically possible, but probably creating a lot of extra work and making it more complicated to manage...
@@CrushingJosch I don’t know how godot network will handle it high-online, for example in 5k in a 2D game, if the 2D game is divided into squares - locations (like Ragnarok), so I’m going to write my own server, or rather, it’s already been written, but not quite finished))) ofcourse all depends from game architecture i think
on godot 4.2 we cannot set anymore rpc(any_peer) but ("any_peer") rpc seeems to have changed a bit and after many try i can't figure out where it stuck for me same rpc i still manage to get client ID on server but i can't make server_spawn_player actualy work and i have no error to figure it out
There are already quite some videos on how to achieve that. Search for "Multiplayer Spawner" in Godot 4 ;-) If you need any specific advice, feel free to ask!
Just curious, but how does this effect the synchronizers that were added for networking purposes? Are the synchronizers still able to function, or would you have to specifically code all of this into the dedicated server? With the information you just provided with this video, those of us that have subscribed need to get your channel out there to a broader section of the Godot Community!!
I haven't yet tried the synchronizers yet, good question! I am honestly not super sure to what extent I am going to use those.. Don't have time to test things at the moment, due to quite stressy work, but am going to have time again in March :) And thanks for your positive feedback on the video itself!!
Hey, i need some help with my fps I have. What i am looking to do is, i have a fps and i want to make it multiplayer. Basically i want a server to host my lobby and start menus, and then a player creates a server (host) in the lobby menu and other players join that person(host) server and they play together. That way a server (like playfab) doesnt host the game but the player that created a server does if that makes sense 😀. I was thinking the player host and player that join get handled by the godot networking and just for the main menu and lobby i use playfab. Do you think that is how i should approach this? Thank you for the awesome tutorial!
@@BigsausageaSorry for the late reply, was a few days off.. The method I show hee works for both, LAN or thorugh internet. The only important thing is, that both computers can communicate through the network connection, i.e., if you connect online, make sure that the respective ports are openec etc.
Yes, in a typical setup, a dedicated server would not have a viewport. And if you would deploy the game, you would probably remove it. But if you run the engine with --headless, it probably just ignores all viewports anyways. What I like to do is that I have some viewports/cameras also on my dedicated server and that I run it with "show collisions" when I am testing stuff. Then I also get a visual representation of what's going on there, which I find very helpful for development and debugging. Then in the end I upload everything to my server and execute the engine with --headless and it runs without the viewports. In the end I would not define "dedicated server" to whether or not it has a viewport, but if there is any player actively playing on that machine (listen server) or if it's really just receiving, e.g., player inputs, is processing everything and sending info out to the clients (dedicated server in my eyes).
Just wanted to say that your post was incredibly helpful. I wouldn't have caught the whole "signatures must match" part for client and server. It is definitely something that will catch one off guard if they don't expect it... but thankfully I don't have to go through that pain thanks to you :)
Thank you so much for this video.
I ran into this video on reddit and this was the only video that was so simple and helpful and ACTUALLY WORKED.
Thank you so much for your work!!!
This was SUPER helpful! Thank you! This made it super simple to understand.
Fast,Helpfull, thank you, i had client-client networking projects before in Godot 3.x, even while being new to me you make it very clear, have a nice day.
Best video on this topic
Okay so this is REALLY cool, but Ive got a bit of an issue with the whole "same rpc function needing to be on server and client" thing...I thought maybe you misunderstood but nope, its literally in their documentation that even unused functions need to be declared on both. =/
I guess you just have to act like its basically a signal being called or something if you only need it on a client.
I havent tried doing multiplayer on godot yet, but will try this weekend. Im thinking that maybe a good work-around for this is to use a "ClientAction" rpc function and a "ServerAction" rpc function with both taking a string parameter. This string could be sent to a match statement that calls a different function that is NOT an RPC. Not a big deal but I think it would do a lot to help organization instead of having a million rpc functions that are just "pass" or returns.
The bonus to doing this could also mean you could easily set up signal-like reactions to server/client functionality.
U just saved my life 4 days looking for solution
Great video, I was recently looking for an update on this. A super useful video, like.
I am happy that you found it useful!
And I am happy to have found someone else with the same issue. If have any experiences in using Godot 4 in such a setup, please don't hesitate to share. I will try to do the same, but won't have much time for the project in the next weeks, unfortunately...
This helped me a ton thank you! Really excited to mess around with this.
Thanks again for the awesome video!
Great tutorial!
Thank you, found it very useful as a beginner. Like!
What about connect to another standalone server written on java for example or other langauge? We can connect to external server from godot client? and what we write to connect it? Thanks.
I am not sure what exactly you want to achieve.
Yes, you can talk to servers written in other languages. I show an example here for realizing a server-browser:
ruclips.net/video/x-PF_EZI2ZM/видео.html
So, for retrieving any kind of data, this works quite well, using e.g. the HTTPRequest system, or working with the UDP-Server. Although I never tested the UDP-Server to another software platform, such as java..
But for the actual game-logic, I don't see any advantage in having the game-server in anything else then Godot. Again, technically possible, but probably creating a lot of extra work and making it more complicated to manage...
@@CrushingJosch I don’t know how godot network will handle it high-online, for example in 5k in a 2D game, if the 2D game is divided into squares - locations (like Ragnarok), so I’m going to write my own server, or rather, it’s already been written, but not quite finished))) ofcourse all depends from game architecture i think
Thank you! I wonder why they implemented that like that. I mean now every clients needs to have every server rpc aswell, seems quite annoying to me
on godot 4.2 we cannot set anymore rpc(any_peer) but ("any_peer") rpc seeems to have changed a bit and after many try i can't figure out where it stuck for me same rpc i still manage to get client ID on server but i can't make server_spawn_player actualy work and i have no error to figure it out
nvm i figured it out. Nodes of the scripts must have the same name as well.
Yes, this was always very important :D Good that you figured it out yourself ;)
Is this case sensitive? @@CrushingJosch
Can you make a video on how to actually spawn players after the game connects to the server?
There are already quite some videos on how to achieve that. Search for "Multiplayer Spawner" in Godot 4 ;-)
If you need any specific advice, feel free to ask!
I hope u start a dedicated server tutorial
Just curious, but how does this effect the synchronizers that were added for networking purposes? Are the synchronizers still able to function, or would you have to specifically code all of this into the dedicated server? With the information you just provided with this video, those of us that have subscribed need to get your channel out there to a broader section of the Godot Community!!
I haven't yet tried the synchronizers yet, good question! I am honestly not super sure to what extent I am going to use those..
Don't have time to test things at the moment, due to quite stressy work, but am going to have time again in March :)
And thanks for your positive feedback on the video itself!!
Hey, i need some help with my fps I have. What i am looking to do is, i have a fps and i want to make it multiplayer. Basically i want a server to host my lobby and start menus, and then a player creates a server (host) in the lobby menu and other players join that person(host) server and they play together. That way a server (like playfab) doesnt host the game but the player that created a server does if that makes sense 😀. I was thinking the player host and player that join get handled by the godot networking and just for the main menu and lobby i use playfab. Do you think that is how i should approach this? Thank you for the awesome tutorial!
does this work if i want to play with friends in diffrent network
Can you elaborate on what you want to achieve? I don't understand what you mean.. :/
no lan multiplayer kinda way
@@BigsausageaSorry for the late reply, was a few days off..
The method I show hee works for both, LAN or thorugh internet. The only important thing is, that both computers can communicate through the network connection, i.e., if you connect online, make sure that the respective ports are openec etc.
Why does the server have viewport if its headless ? Is it not a listen server that you are making and not a dedicated server ?
Yes, in a typical setup, a dedicated server would not have a viewport. And if you would deploy the game, you would probably remove it. But if you run the engine with --headless, it probably just ignores all viewports anyways.
What I like to do is that I have some viewports/cameras also on my dedicated server and that I run it with "show collisions" when I am testing stuff. Then I also get a visual representation of what's going on there, which I find very helpful for development and debugging.
Then in the end I upload everything to my server and execute the engine with --headless and it runs without the viewports.
In the end I would not define "dedicated server" to whether or not it has a viewport, but if there is any player actively playing on that machine (listen server) or if it's really just receiving, e.g., player inputs, is processing everything and sending info out to the clients (dedicated server in my eyes).
So rpc needs to be on both sides
Yes, exactly. And you also need to have the same set of rpcs on both sides.
godot 4.2 not funciona