Voxel Game mini devlog - Multiplayer networking architecture

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

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

  • @spacefishaviation276
    @spacefishaviation276 2 года назад +40

    I've never thought of rust as a game dev language but now that I look at it it really is built for tasks like that

  • @Jianju69
    @Jianju69 2 года назад +7

    You are one of the best game developer channels out here! Thank you!

  • @i_am_feenster
    @i_am_feenster 2 года назад +21

    Damn, I take back me warning you for scope creep / shiny object syndrome the other day, because thanks to this video, multiplayer starts to appeal to me as well 😶 Tantan! What have you done to me?!

  • @karimdjemai5386
    @karimdjemai5386 2 года назад +4

    Super interesting! Thank your for this detailed channel!

  • @AlexMeesters
    @AlexMeesters 2 года назад +2

    I'm also building my own Lobby/Relay server solution. Not in Rust though.
    How I'm approaching it right now is to have a "Lobby Server" reserve spots/rooms on a "Relay Server".
    But instead of relaying the entire connection from user->lobby->relay, I just let the user connect to the relay directly.
    So, in case the lobby goes down, the individual relay servers still keep on going. Meaning there isn't a single point of failure.

  • @theseatoad
    @theseatoad 2 года назад

    I have been thinking about the cost benefits of using p2p through relay as well. So cool to see this.

  • @xzippyzachx
    @xzippyzachx 2 года назад +5

    Networking... "Its a big pain in the brain" -Tonton

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

    Thanks for making this video. I found this looking for a solution to make online multiplayer Gauntlet Legends possible.

  • @pacadoidao8702
    @pacadoidao8702 2 года назад +2

    Wait what, I thought I would see 1 million subscribers..
    Loved ur accent btw..

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

    Would you recommend a book on client/server architecture for games?

  • @jlebrech
    @jlebrech 2 года назад +2

    you could use quorum pattern for your p2p. use many clients to simulate physics and the general consensus is then distributed to everyone.
    you can also reduce wallhacks by having clients do visibility calculations of a zone they are far away from and then send that info to the players that are over there.

  • @hikingcrow4233
    @hikingcrow4233 3 месяца назад

    some note on p2p networking from this video
    2:03
    Wouldn't it be wonderful if we could have just peer-to-peer connections. But there's one big issue with this and that is that the players knows each other's IP addresses. If you remember when Dany released his game crap game, he was using steam's peer-to-peer networking solution and with that some big streamers got their IP addresses leaked which is a bad thing. So what did they do to resolve that, if changed from steam's peer-to-peer solution to their relay solution which doesn't let players connect to each other instead they do it through a relay. That is what I(the video poster) have been doing. I am not gonna use steam relay solution. I have built my own entire architecture for hosting relay servers.

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

    What if one user pretends to be someone else? Is this possible? If so, how do you handle it?

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

    6:34 you might want to read about condition variables, I don't know if the rust std library implements this, but I think that would be a better solution

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

    If your server isn't authoritative, which client is the source of truth for things that are happening outside of the player control? E.g. mob aggro, a ball rolling, etc.

  • @lixou
    @lixou 2 года назад +4

    TANTANNN VIDOEOOO :D

  • @spik330
    @spik330 2 года назад +2

    With these video's, I would love to see more on how you design and architecture your systems. I commonly watch these types of video's while at work (programming) and I feel it would be a huge boom to the community if we stared sharing how to got to a design and what the overall design is rather than just the changes that were made.
    Edit: also every developer i.kym-cdn.com/photos/images/newsfeed/001/617/650/91a.jpg

  • @Xeros08
    @Xeros08 3 месяца назад

    We miss you TonTon :(

  • @4rcant
    @4rcant 2 года назад +4

    i love server 420

  • @zaixrx
    @zaixrx 2 года назад +2

    Yaaaay

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

    Would you be willing to share some beginner tutorial about this whole thing xD This sounds amazing

  • @AshtonSnapp
    @AshtonSnapp 2 года назад

    I’m guessing this would still work with games written with networking libraries other than laminar e.g. if I wanted to use renet/bevy-renet or some other library?

  • @esben181
    @esben181 2 года назад +3

    ROBLOX has a network owner system, so that individual physics objects can be controlled by either the server or the player

  • @laundmo
    @laundmo 2 года назад +4

    are lobby, relay and clientside networking code all going to be open source or just the relay server code itself?
    PS: you should post this to the bevy discord!

    • @Tonton-fr5st
      @Tonton-fr5st  2 года назад +6

      everything will be open sourced, except for my game specific networking code :)
      lobby, relay, client

  • @heraclitoqsaldanha6133
    @heraclitoqsaldanha6133 2 года назад +1

    i wanted to use webrtc for my game but webrtc is crazy (in a bad way), what do you think of webrtc for a p2p solution?

    • @Tonton-fr5st
      @Tonton-fr5st  2 года назад +3

      Never heard of it but it looks like a lot to read into to get the basics.
      The pro of making things from the ground up is the progressive knowledge I get to build up over time.

    • @DouglasDwyer
      @DouglasDwyer 2 года назад +2

      @@Tonton-fr5st Although the initial examples were indeed a bit intimidating, I decided to try WebRTC for peer-to-peer networking in my game engine. I actually found that it works quite well - you get the benefits of being able to run both client-client games and client-relay games (should you choose). The protocol takes care of client connections and the details of relay servers for you, but you still get to use your own "lobby" server and manage packet/byte streams yourself. I'd highly recommend it as a P2P solution - but implementing your own protocol is undoubtedly also a good way to learn, and allows you to tailor things to your game's needs :)

  • @TechJolt3d
    @TechJolt3d 2 года назад

    You might want to use a program tmux because you are running 3-4 terminals at once throughout your video.

  • @Warmatx68
    @Warmatx68 2 года назад +1

    Your pending request system remind me promises from javascript

    • @AndrewBrownK
      @AndrewBrownK 2 года назад +2

      Maybe tantan should be looking at rust async then?

  • @RoamingAdhocrat
    @RoamingAdhocrat 2 года назад +4

    shouldn't your second channel be TenTen? TonTon should be your fourth

  • @mysticrustacean4065
    @mysticrustacean4065 2 года назад +3

    @tantan can you please start a mini series over ggez ? Like a playlist for beginners to follow and make games? Docs are confusing for beginners.
    Btw love your content.

  • @ChristianRoyUtah
    @ChristianRoyUtah 2 года назад

  • @timwhite1783
    @timwhite1783 2 года назад

    Why not make it like Minecraft? Client/Server Architecture but your users have to host their own Servers or pay someone to host for them.

  • @mysticrustacean4065
    @mysticrustacean4065 2 года назад +2

    First one to watch!

  • @Xeros08
    @Xeros08 2 года назад

    First! ;)

  • @therealpeter2267
    @therealpeter2267 2 года назад

    This whole relay thing seems a bit insane to me, all this hassle and extra latency just so streamer's ips are protected. If someone thinks their ip location is important to keep secret, they should use a trusted VPN provider. The average player does not need this data protected. People have been joining random thrid-party hosted servers since the beggining of the internet, without even a second thought. Take for example minecraft servers, or just random websites on the web. All of them could get your ip if they wanted, but the thing is, they just don't care. The average user's ip address is not anything valuable, and if someone suspects their IP is, then they should be using a VPN in the first place. The latency penalty is just such an insane cost added to the average user's experience, and it's not even necessary.

    • @erfer
      @erfer 2 года назад

      I think the issue isn't with sharing IPs in general, it's sharing your IP with every other player in a lobby, something that Minecraft servers and websites do not do; only the server knows your IP and no one else. Nobody cares if a server has your IP because you want to use their service, but when there are 20+ players in a lobby with someone like a streamer it becomes very tempting to be malicious with that person's IP.
      I'm not sure what you mean by a latency issue since this handshake behavior is only done when the connection is being made. Afterwards it seems to behave just like a normal server. Although, I do agree it is a bit complex and it makes me wonder what would happen if the 'Lobby' was to get overloaded? Sounds like you would need to have another layer of relays.

    • @therealpeter2267
      @therealpeter2267 2 года назад

      ​@@erfer The "game server " here is just another relay, he explains at 5:17 why a player hosted game would have a lot of latency on physics, and any server authoritive code. Now, the first part of his multiplayer is totally fine, which is player specific information. Sure, you get hackers like this, but for a small party game you play with friends it's allright. The problem comes when you start to implement things like block breaking and attacking enemies. Where is the enemy data stored and logic executed? You either need a dedicated server, or make one of the clients become the host and move enemies around, and manage the world's terrain chunk data. Here you get double the latency as compared to a standard, dedicated server design. So take people minecraft servers with bad connections, and multiply block placing - breaking lag, and mob movement / getting damaged lag by 2

  • @briggsliceaga9257
    @briggsliceaga9257 2 года назад

    P𝐫O𝕞O𝓢m 😝