[TUTORIAL] Godot 4 Multiplayer Dedicated Server

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 35

  • @TheRealAfroRick
    @TheRealAfroRick Год назад +2

    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 :)

  • @bruri7522
    @bruri7522 10 месяцев назад +1

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

  • @kiyasuihito
    @kiyasuihito Год назад +4

    This was SUPER helpful! Thank you! This made it super simple to understand.

  • @bossenderdra
    @bossenderdra Год назад +1

    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.

  • @will7466
    @will7466 11 месяцев назад

    Best video on this topic

  • @KillerGameDev
    @KillerGameDev 4 месяца назад

    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.

  • @dzartxstudio
    @dzartxstudio Год назад

    U just saved my life 4 days looking for solution

  • @makeitfunnyy
    @makeitfunnyy Год назад +2

    Great video, I was recently looking for an update on this. A super useful video, like.

    • @CrushingJosch
      @CrushingJosch  Год назад +1

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

  • @whosthatjt
    @whosthatjt Год назад

    This helped me a ton thank you! Really excited to mess around with this.
    Thanks again for the awesome video!

  • @itsyaboiporkchop
    @itsyaboiporkchop 7 месяцев назад

    Great tutorial!

  • @lollolearning
    @lollolearning Год назад

    Thank you, found it very useful as a beginner. Like!

  • @Hell5426
    @Hell5426 10 месяцев назад +1

    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.

    • @CrushingJosch
      @CrushingJosch  10 месяцев назад +1

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

    • @Hell5426
      @Hell5426 10 месяцев назад +1

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

  • @anton3072
    @anton3072 Год назад

    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

  • @MrHsktoto
    @MrHsktoto 10 месяцев назад

    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

  • @squarqz
    @squarqz 11 месяцев назад +1

    nvm i figured it out. Nodes of the scripts must have the same name as well.

    • @CrushingJosch
      @CrushingJosch  11 месяцев назад

      Yes, this was always very important :D Good that you figured it out yourself ;)

    • @bruri7522
      @bruri7522 10 месяцев назад

      Is this case sensitive? @@CrushingJosch

  • @bruri7522
    @bruri7522 10 месяцев назад

    Can you make a video on how to actually spawn players after the game connects to the server?

    • @CrushingJosch
      @CrushingJosch  10 месяцев назад

      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!

  • @dzartxstudio
    @dzartxstudio Год назад

    I hope u start a dedicated server tutorial

  • @Darkest-Kn1ght
    @Darkest-Kn1ght Год назад +2

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

    • @CrushingJosch
      @CrushingJosch  Год назад +5

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

  • @yanchobeats
    @yanchobeats Год назад

    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!

  • @Bigsausagea
    @Bigsausagea 8 месяцев назад

    does this work if i want to play with friends in diffrent network

    • @CrushingJosch
      @CrushingJosch  8 месяцев назад

      Can you elaborate on what you want to achieve? I don't understand what you mean.. :/

    • @Bigsausagea
      @Bigsausagea 8 месяцев назад

      no lan multiplayer kinda way

    • @CrushingJosch
      @CrushingJosch  8 месяцев назад +1

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

  • @subhamgupta1544
    @subhamgupta1544 Год назад

    Why does the server have viewport if its headless ? Is it not a listen server that you are making and not a dedicated server ?

    • @CrushingJosch
      @CrushingJosch  Год назад

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

  • @thomaseubank1503
    @thomaseubank1503 Год назад

    So rpc needs to be on both sides

    • @CrushingJosch
      @CrushingJosch  Год назад

      Yes, exactly. And you also need to have the same set of rpcs on both sides.

  • @gustavomgg
    @gustavomgg 11 месяцев назад

    godot 4.2 not funciona