Full Player-Client Multiplayer Authority

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ต.ค. 2024

ความคิดเห็น • 21

  • @BatteryAcidDev
    @BatteryAcidDev  3 หลายเดือนก่อน +1

    **FIX** for the exceptions found here: th-cam.com/video/HHoCkyBdRMs/w-d-xo.html
    Thank you @tldmbruno for the suggestion!

  • @LaCe5758
    @LaCe5758 3 หลายเดือนก่อน +5

    you're carrying my current online game! Now I just need a youtuber to carry me with the level design

    • @herrspaten1796
      @herrspaten1796 3 หลายเดือนก่อน +2

      Level design is pretty hard. I tend to underestimate it all the time

    • @LaCe5758
      @LaCe5758 3 หลายเดือนก่อน +2

      @@herrspaten1796 same! I came up with some ideas after I thought "How can I make a level that relies on my game mechanics"

    • @herrspaten1796
      @herrspaten1796 3 หลายเดือนก่อน +1

      @@LaCe5758 when in doubt, look at nintendo games! Thats my way of dealing with level design

    • @BatteryAcidDev
      @BatteryAcidDev  2 หลายเดือนก่อน +1

      Haha nice! Yea I think we all need that!

  • @tldmbruno
    @tldmbruno 3 หลายเดือนก่อน +6

    10:54 I had that error fixed by using "_enter_tree(): set_multiplayer_authority(str(name).to_int())". Because _enter_tree is called before _ready, the peer that just joined can set who is the multiplayer_authority of each player character. One HUGE misconseption I found people think (mostly because this info is nowhere to be found on the internet nor in the docs) is not knowing that multiplayer_authority is defined PER PEER. The reason using "name = peer_id" works its because MultiplayerSpawner already syncs the node's names. So the third player joins in, with the other two players having their names set as "1" and something like "348574813" respectively. Then the _enter_tree runs FOR EVERY CHARACTER in the third peer's machine. The enter_tree then sets the multiplayer authority correctly for that peer, because it uses the node's names. The error at 10:54 is basically saying: "the third peer thought someone else had the authority to that node!".

    • @tldmbruno
      @tldmbruno 3 หลายเดือนก่อน +2

      I only found out about this thing about multiplayer_authority being defined per peer after I spent two days trying every possible combination of set_multiplayer_authority.

    • @BatteryAcidDev
      @BatteryAcidDev  3 หลายเดือนก่อน

      Yea so I revisited this approach with a fresh mind, and I can't believe I got it working!! I was making a dumb mistake that I caught the second time around, so thanks a ton!!! Thanks!

    • @BatteryAcidDev
      @BatteryAcidDev  3 หลายเดือนก่อน

      Added correction video here: th-cam.com/video/HHoCkyBdRMs/w-d-xo.html
      Thank you @tldmbruno for the suggestion!

  • @yuvalkrispin
    @yuvalkrispin 3 หลายเดือนก่อน +3

    Nice thanks for everything
    This is great
    Meme please a database tutorial

    • @BatteryAcidDev
      @BatteryAcidDev  2 หลายเดือนก่อน +1

      Thank you! Yes, that is in the queue. I may do a NoSQL one to start but not sure... let me know which type of database you'd like me to focus on. And also where to host it?? I generally use AWS because it's easy for me, but there are other services, so let me know!

  • @plompcore
    @plompcore 3 หลายเดือนก่อน +2

    Much appreciated!! I'm wondering how to handle scene changes in an online game

    • @LaCe5758
      @LaCe5758 3 หลายเดือนก่อน +2

      I did it after many headaches, now I have a nice main menu screen where I can choose Online Mode/Local Mode/Settings (and choose the level once I do more levels!), the classic menu screen

    • @BatteryAcidDev
      @BatteryAcidDev  2 หลายเดือนก่อน

      You can make RPC calls from the Authority(server/host) to the clients that tell them to change scenes.
      Also, you can probably swap out Nodes using the MultiplayerSpawner to achieve something similar, but I haven't played around with that just yet.

  • @DragilusGame
    @DragilusGame 2 หลายเดือนก่อน +1

    Great video, I like the way you show how things are done.
    I had another question with this video, but what would be the best way to deal with the disconnection/closure of the server host to the client. I tried to do in the Steam tutorial, but it didn't work as expected.

    • @BatteryAcidDev
      @BatteryAcidDev  2 หลายเดือนก่อน +1

      Thanks! You can leverage the on_disconnect callbacks/signals to perform any cleanup that needs to be done, on either client or server. Not exactly sure what you're after here.

  • @Ceisri
    @Ceisri 3 หลายเดือนก่อน +1

    everyone made already 10000 videos on how to sync players.... but how do I sync NPC's ? the only thing I managed so far is either making the NPC a fake player but I can't do it with multiple NPCs.... or using rpc but for some reason it only syncs on computers and not on phones

    • @BatteryAcidDev
      @BatteryAcidDev  3 หลายเดือนก่อน

      I’ll do some more on that topic but you can check here in the meantime: Spawn & Sync Enemy Mobs for Godot Multiplayer Games
      th-cam.com/video/a_67y1OtRcw/w-d-xo.html
      Automate Mob Movement Using Navigation 3D Region + Agent [Godot 4]
      th-cam.com/video/zGk0JVk9P14/w-d-xo.html

    • @BatteryAcidDev
      @BatteryAcidDev  2 หลายเดือนก่อน +2

      Here’s a new one: th-cam.com/video/Sc_pP_nKSL8/w-d-xo.htmlsi=6v-F3xvgM7WeqltG