How to Choose Your Multiplayer Backend

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

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

  • @3db-
    @3db- ปีที่แล้ว +38

    I'm surprised you advise against using peer-to-peer given that it seems like a great choice for indie developers creating co-op games. No need to have any sort of server costs, no need to worry about cheating (not a competitive game), and you can use Steam's API for hosting lobbies, creating a signalling server, match-making, etc. Also, the code ends up being all client-side.
    Would you argue that even for a co-op game, indie developers should still go the client-server route with one of the players hosting the server themselves as they play (rather than hosting or renting a dedicated server)?
    IMO, peer-to-peer still has it's place and seems like it would be the more sensible choice for indies making non-competitive games.

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว +13

      This is completely accurate for those pure P2P game styles! I think I mentioned very quickly that there is still a use case for it, but I’m glad you commented! Thank you!

    • @hanelyp1
      @hanelyp1 ปีที่แล้ว +11

      Client authoritative, implied by peer-to-peer, works fine for smaller player groups where people know each other. Introduce a public server where other players are likely strangers and cheating becomes a problem.

    • @joshfromsmosh3352d
      @joshfromsmosh3352d ปีที่แล้ว +5

      Yeah, but what if I can't use steam networking, since I won't be releasing there?

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว

      You can use the lobby matchmaking system I’m detailing in my latest video

    • @brofessorxx
      @brofessorxx 8 หลายเดือนก่อน +1

      Doesn't Warframe use P2P for game lobbies?

  • @AgriasOaks99
    @AgriasOaks99 ปีที่แล้ว +6

    Thank you for these multi-player series, Sensei.
    Look forward to seeing more ❤

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว +1

      Thanks! Got a lot more on the way!

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

    These videos are great. I would love to see chapters some day. Makes it easier to come back later and find what I need.

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

      Chapters added! Thanks for giving me the nudge!

  • @JonBonazza
    @JonBonazza ปีที่แล้ว +8

    Just a heads up, the MultiplayerSynchronizer DOES NOT handle interpolation and client prediction. A lot pf tutorials for this node show it being used for player movement but it is NOT designed for this use case and while it looks like it works running locally due to virtually no latency, it will NOT work when the internet is in between the server and client

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว +1

      Yea I haven't found anything that says Godot provides interpolation out of the box with their synchronizer. If this was in reference to something I said, I may have been referring to Unity which does provide some default interpolation. I have ran this from a cloud service before and haven't noticed any lag issues, but that doesn't mean it won't need some interpolation to smooth things out once the game grows. I'll be sure to spend some time looking into this. If we are not to use the synchronizer for player movements which feature or implementation strategy should we be using? Thanks!

    • @JonBonazza
      @JonBonazza ปีที่แล้ว +1

      @@BatteryAcidDev i suggest looking into gabriel gambetta’s fantastic blog posts on the concepts of server reconciliation, entity interpolation, and client-side prediction.
      I’ve chatted with the lead network dev for godot about adding some hooks into MultiplayerSynchronizer to be able to add this logic to it, but until then, you’ll need to implement it yourself using rpcs and bespoke code.

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว +4

      Interesting, I'll definitely check it out, thanks! Here's the link: www.gabrielgambetta.com/client-server-game-architecture.html

    • @-.-..._...-.-
      @-.-..._...-.- 10 หลายเดือนก่อน +1

      So does that mean to use rpc() instead of the multiplayer synchronizer or some other way?

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

      @@-.-..._...-.-there are techniques for doing things smoothly like client-side prediction, entity interpolation, and server reconciliation. These are usually implemented on a per-game basis because they depend a lot on the individual game’s movement code, and how it can be optimized. Gabriel Gambetta has an excellent series of blog posts on the topic if you’re interested

  • @AlexBowman-1999
    @AlexBowman-1999 ปีที่แล้ว +4

    I’m doing a micro service architecture for my godot game with an express typescript server for authentication service and websocket connection for lobby service. I’m still not totally sure how it’s going to go but so far I have implemented my own custom gameroom lobby creation. I’ll lyk how it goes and maybe I’ll make a tutorial on it!

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว

      Sounds about right! Where are you hosting the express backend?

  • @Peter-wl5xm
    @Peter-wl5xm ปีที่แล้ว +3

    incredible video for a beginner like myself. thank you so much for the hard work.

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

    Amazing video series! Thanks a lot!

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

    This was a really nice primer, thanks a lot! Is there any chance you could go over how some netcode options work (delay based, rollback), and how we'd implement them if possible?

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

      I'm probably not going to doing any videos on Unity for the foreseeable future, I just don't have the bandwidth.

  • @SS-gu2tx
    @SS-gu2tx 9 หลายเดือนก่อน +4

    You should go over WarFrame style P2P, using upnp, it's pretty OP.

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

      For sure! I’m planning a deeper dive into P2P setups, so stay tuned!

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

    Client-Server will not fully prevent cheating, it still takes a lot of resources. Hosting servers takes a lot of resources as well.
    In my (admittedly limited) experience, if you have a small team, competitive multiplayer isn't possible, especially if its your first time with multiplayer period.

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

      Right, nothing will fully prevent cheating, it's about mitigation - what practices you can implement to reduce it or at least curtail it.
      I think resources really depends on the type of game. FPS, yea it's likely to be much more expensive than a card game.
      I would say if it's your first time making a FPS multiplayer game, it would definitely be challenging, maybe start with something easier and work your way towards that.

  • @JonBonazza
    @JonBonazza ปีที่แล้ว +1

    Also in regards to server builds of godot, headless server exports can only be deployed for linux

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว

      When you say headless, you mean dedicated server builds? because I think it supports the major platforms... I've built them for linux and mac, but haven't tried windows, but it looks like the option is there? Maybe you could clarify this for me, thanks!

    • @JonBonazza
      @JonBonazza ปีที่แล้ว +1

      I just checked the docs again, and it looks like with godot 4, you indeed can export for headless server builds on any platform. I stand corrected. Sorry!

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว

      Not at all! Thanks for bringing it up! You never know, plus with different versions of docs along with releases, it's good to have clarification! Thanks for following up!

  • @Romdrake1
    @Romdrake1 2 วันที่ผ่านมา

    can I use the same languages and technologies that o use on web servers/backend for a game? or there are better more specific tools to use? I'm asking that because I'm a web developer and I wanted to know if I can use the experience I have to develop a game server/backend

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

    I use MACOS dedicated Servers what about those ones?

    • @BatteryAcidDev
      @BatteryAcidDev  28 วันที่ผ่านมา

      Yea that can work, not sure what’s you’re asking…

  • @SuperEssenceOfficial
    @SuperEssenceOfficial 8 หลายเดือนก่อน +1

    so useful thank you

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

      You're welcome! 😁

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

    I want to make a party game. In involves sharing files between players(mp3, mp4, wav, tscn, webm, etc) and I want to add mobile support too. One of the client will be the host whom will store all of the files, distribute it, and control the flow of the game using RPCs. How do I make this work without paying a single cent? Can the AWS serverless multi-region websocket API be of benefit to me?

    • @BatteryAcidDev
      @BatteryAcidDev  28 วันที่ผ่านมา

      The AWS route could be cheap, but at scale it will cost you, eventually... Not sure how to do this for free.

    • @Mr_Boness
      @Mr_Boness 27 วันที่ผ่านมา

      @@BatteryAcidDev How do I make a client host server for free? All I need is the ability to share large files and use RPCs. Surely there must be some way I can get this working, no matter how hard it may be! Also, what protocols are the cheapest to execute? Like bittorrent, TCP, UDP. I have this dream project that I need to finish before uni and as of now, I don't have a sense of direction on what to do.

  • @klebersonromero9819
    @klebersonromero9819 9 หลายเดือนก่อน +1

    What would be the best architecture format considering an MMORPG or an MMORPG Maker?

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

      Hrm, that’s a tall order for a TH-cam comment, and I think you just joined my discord, so let’s continue the convo there! I’m sure we can get you pointed in the right direction!

  • @seva4241
    @seva4241 10 หลายเดือนก่อน +1

    Quick question. So for a solo developer working on a game like valhiem, enshrouded, etc. Would it be ok to develop the game as Peer to peer where players create servers with 10 player slots and host, while others connect. Then later down the line change the networking solution to dedicated servers? Or would I have to go in and change every single multiplayer related line of code at that point?

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

      You can create it p2p to start, where one person is the host, and then later switch to a typical remote-server setup. You won't have to rewrite your network logic. You'll likely have to refactor your matchmaking, as it's no longer though someone's IP, but hosted somewhere. You can even create a flag that toggles between server and host mode. Most of my demo code has this built into it, if you want to check.

    • @seva4241
      @seva4241 10 หลายเดือนก่อน +1

      @@BatteryAcidDev thanks! I just found your channel and love the content so far

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

      Awesome! Let me know if there's anything you'd like me to focus on!

  • @PsychonicJoe
    @PsychonicJoe ปีที่แล้ว

    Sorry can someone explain the difference between a dedicated server and websockets? The video was talking about dedicated servers but suddenly advised against them in favor of serverless lambdas (I guess only for slow-paced games?)

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว +4

      Apologies for the lack of clarity there. Dedicated server builds are builds of your Godot (or Unity) project for deploying or using as a server, for your backend. You can use the high level built-in networking technologies like RPCs, SyncVars, NetworkTransforms, etc. If you want your players to have low downtime, you'll always have to have at least one instance of this server build running for them to connect to. This can be hosted anywhere that supports server builds. Because this can add up in costs, if your game doesn't need a full server build of your game, because it's slower paced, or doesn't need to simulate anything, or maybe you just want to add chat, lobby, or you just want to sync data, you can instead use a 'serverless' Lambda function with a WebSocket (or HTTP if that's all you require) and it only charges you for the time that it is active for that session. Once the game is over, it can shutdown and you're not going to be charged for those times while there's no game play happening. Serverless is generally cheaper and can handle ancillary functionalities, (as well as slower paced game play), that most games have. If you require game play simulation or environment collision detection, etc, you will not be using the serverless route, as it won't be a server build of your game, and you can't take advance of the server authority. Hope this helps, let me know if you have any more questions, plus you can always drop by the Discord!

    • @PsychonicJoe
      @PsychonicJoe ปีที่แล้ว +1

      @@BatteryAcidDev Thanks for the clarification, that makes a lot of sense! Yeah I guess if you only need a leaderboard or a bulletin board of some sorts it'll be a waste to host a dedicated server. Thanks for the valuable information.

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว +1

      Anytime! Glad it helped!

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

    *Get in touch* 👇
    -----------------------------------------------------------------------------------------------------
    *Discord* discord.gg/SFFW32FUgm
    *X (Twitter)* twitter.com/BatteryAcidDev
    *Mastodon* mastodon.gamedev.place/@BatteryAcidDev
    *Instagram* instagram.com/batteryaciddev
    *Threads* www.threads.net/@batteryaciddev

  • @KohiOcha
    @KohiOcha 9 หลายเดือนก่อน +1

    What about for UE5?

    • @jlebrech
      @jlebrech 9 หลายเดือนก่อน +1

      it's a game engine

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

      Yea of course you can use UE5, I don't have much experience with it so I didn't cover it. But you can totally use that engine!!

  • @bennicus4901
    @bennicus4901 9 หลายเดือนก่อน +1

    WebRTC is useful if your game runs in the browser (HTML5 or javascript) and you want a low latency connection between peers. Game network traffic has similar requirements to voice or video chat :) (i.e. low latency, little bit of unreliability is acceptable, many small packets, etc)

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

      Excellent summary! Thank you 🙏

  • @magnusm4
    @magnusm4 6 หลายเดือนก่อน +1

    Sad there isn't a peer to peer that does what it sounds like.
    A host can be a server and a client at the same time. So if a server is a class. Then make everyone a partial class to the whole class.
    Make everyone handle one part to distribute the workload.

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

    Please get rid of the glare in your glasses. Thank you!

  • @gothiccrusader2582
    @gothiccrusader2582 ปีที่แล้ว +18

    "Peer to peer bad for big games", looks at Warframe and Deep Rock Galactic in confusion.

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว +1

      There’s definitely a place for it!

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

      Deep Rock is 4 players, though

    • @gothiccrusader2582
      @gothiccrusader2582 10 หลายเดือนก่อน +1

      @@GoblinArmyInYourWalls Is it a small game? Because he said "don't do it for big games", he didn't say "don't do it for 128 player match games or for mmorpgs" because I would have agreed with that.

    • @GoblinArmyInYourWalls
      @GoblinArmyInYourWalls 10 หลายเดือนก่อน +6

      @@gothiccrusader2582 you're arguing semantics for absolutely no reason. It's 4 players, which is "small" by networking standards.

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

      Yet this is a video for beginners to understand game dev, most people will get the wrong idea when he says big, without any of those qualifiers you are imagining.

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

    if everything is broken
    cheating wont be fun

  • @eddiej.l.christian6754
    @eddiej.l.christian6754 ปีที่แล้ว +2

    A Couple of things. First Photon is the Largest Multiplayer Game Service in the world. So I find it Strange you acted like you barley heard of it. Second Just make a Steam Listen Server game and then you don't need to pay for any servers.

    • @BatteryAcidDev
      @BatteryAcidDev  ปีที่แล้ว +1

      Steam listen server is for when you're using Steam and want to host a game on your local machine, which could work for P2P applications. Photon is a powerhouse for multiplayer Unity applications but my experience is limited with them. Thanks for the feedback!