Godot Multiplayer Lag Compensation with Netfox

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

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

  • @onokoreal
    @onokoreal 3 месяца назад +18

    If it's just for a coop / non competitive game I recommend not using any lag compensation and just make the client authoritative instead. I've tried Netfox which is a great tool but it can also be hard to use and you have to refactor your whole code for rollbacks to prevent desync which can be really confusing and maddening sometimes.
    Also important note when working with CSP/Rollback you really need a tool to simulate latency like Clumsy which allows you to detect desync without having to connect to a friend that lives across the planet

    • @BatteryAcidDev
      @BatteryAcidDev  3 месяца назад +2

      Yea, if it's not going to be a competitive game and you're just playing around with friends where cheating isn't a concern, you can totally get away with client authority over the whole player object. Good tip on using Clumsy, I need to find a Mac version of that!

    • @RabidTunes
      @RabidTunes 3 месяца назад +1

      Is client authority just using the regular MultiplayerSpawner and MultiplayerSynchronizer Godot has?

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

      @RabidTunes no, client authority is when you set something that the player has control or authority over, meaning, it tells the server the state, not the server telling the client. Generally, you assign client authority over player input. Spawner should be server authority, Synchronizer can be set to client auth for input, or over the whole player if that’s what you want. I talk more about it in the first part of this video ruclips.net/video/coODimFW3M4/видео.htmlsi=pHS8MUBeWrFlMDtY

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

    Quality content my dude! You're a great source for learning about networking (in general and Godot)!
    Thank you for sharing this with us 😄

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

    OMG OMG OMG
    WAITING FOR THE VIDEO THANKS
    going to watch every second of this!

  • @amirosman8797
    @amirosman8797 3 месяца назад +4

    Incredible! Finally, something that genuinely makes a difference. I've been waiting for you to cover this topic for some time. While I haven't watched this video yet, I noticed you implemented Netfox alongside the "project with Steam support using the Steam Multiplayer Peer extension." I skipped that particular video due to my lack of interest in P2P setups. My focus is primarily on client-server architecture, where the game server is hosted online on a dedicated server or VPS. My question is: does this video specifically focus on using Netfox with the P2P "Steam Multiplayer Peer extension," or can I also apply the concepts from this video to integrate Netfox into a client-server online game architecture?

    • @BatteryAcidDev
      @BatteryAcidDev  3 месяца назад +2

      It does NOT depend on P2P at all, I don’t even touch on Steam here. Towards the end I demo a dedicated server setup using AWS, so I think this will work for you!

    • @amirosman8797
      @amirosman8797 3 месяца назад +2

      @@BatteryAcidDev Amazing bro, this is truly amazing, please keep covering and dive deeper into these advanced multiplayer topics

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

    This kind of content is invaluable! Godot lacks a lot of good multiplayer tutorials, and yours is top notch!
    Thank you so much for posting it for free to everyone 🎉

  • @SRY295
    @SRY295 3 месяца назад +1

    thank you! this is very helpful. can't wait to add multiplayer to my game.

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

      Yea I was pretty excited to find this!! And it's only going to get better!

  • @thibaudgallanddemanneville174
    @thibaudgallanddemanneville174 3 месяца назад +1

    Awesome video ! (as usual !)
    However I'm not sure to go that way as I on a more chill/coop game play.

  • @sodden_steam
    @sodden_steam Месяц назад +1

    Hello. Please tell me how to organize the working windows in Godot so that they are like yours: an "Inspector" next to the "Scene". Thank you. A video on this topic would also be nice.

    • @BatteryAcidDev
      @BatteryAcidDev  Месяц назад +1

      So there are little stacked 3-"dots" around the Godot editor that when you click on, it will show which panel you want that menu to exist in, so just select the area. Once you have it set the way you want, use Editor -> Editor Layout -> Save Layout so you can quickly setup any project.

  • @NearIsSad
    @NearIsSad 3 месяца назад +1

    how do you make the gun ray shoot towards the object the crosshair points at?

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

      I’ve got a couple videos on that, start here with the fix: A Better Dual-Raycast Collision Detection Strategy
      ruclips.net/video/sZB9J6g4_q0/видео.html

  • @talonsneststudio
    @talonsneststudio 12 дней назад +1

    I love these video's, but i'm not sure teaching people to just lean on plugins in lieu of the actual code skills required to do the compensation yourself. What happens if we hit a problem with a plugin? Or the plugin gets deprecated? Where should we go if we have to learn to code it ourselves from scratch?

    • @BatteryAcidDev
      @BatteryAcidDev  11 дней назад

      I answered this on my Twitch stream, please keep an eye out on my YT (next week) for the answer 😅

    • @BatteryAcidDev
      @BatteryAcidDev  11 дней назад

      Here's the relevant part from my stream today:
      www.twitch.tv/videos/2253635251

    • @BatteryAcidDev
      @BatteryAcidDev  3 дня назад

      Godot has also started an organization to officially track SDK integrations: godotengine.org/article/godot-sdk-integrations/

  • @geopopos
    @geopopos 3 месяца назад +1

    Your content is fire!

  • @ntngamedev
    @ntngamedev Месяц назад +1

    Netfox have support for C#?

    • @BatteryAcidDev
      @BatteryAcidDev  Месяц назад

      I don't think so, but you can double check the docs or ask in their Discord!
      - github.com/foxssake/netfox
      - discord.gg/MnzaZDCn

  • @3db-
    @3db- 3 месяца назад +2

    I thought client-side prediction was used for twitch-based shooters and fast paced games? Maybe I misheard you, but if not, what sort of algorithms do you want to use for FPS?

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

      I think it CAN be made to work for that, but Netfox's implementation isn't really geared for it. You'd probably have to implement that algorithm using lower level networking yourself or maybe find another implementation with support for that game style. I guess you could try it and see what happens...

  • @kazukisenpai2405
    @kazukisenpai2405 3 месяца назад +1

    what if player move then disconnect the internet. Does that player move in other players screen?

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

      That would all depend on your disconnect functionality. Right now he probably just stays there because I didn't handle such a case (I don't think), but you can make this work however you'd like.

  • @gabrielst527
    @gabrielst527 2 месяца назад +1

    How to apply GGPO rollback netcode would be a great next video.

    • @BatteryAcidDev
      @BatteryAcidDev  Месяц назад +1

      This sounds similar to the implementation that Snopek Games is working on: ruclips.net/video/zvqQPbT8rAE/видео.htmlsi=1Y0t-LJRQTYZEuqg

    • @gabrielst527
      @gabrielst527 Месяц назад +1

      @@BatteryAcidDev Thank you so much!

  • @ShownMccrown-hq8mq
    @ShownMccrown-hq8mq 3 месяца назад +1

    Hi BAD can you make a tutorial on lan multiplayer working in android please?

    • @BatteryAcidDev
      @BatteryAcidDev  3 месяца назад +1

      Yes - I actually covered that here: ruclips.net/video/jgJuX04cq7k/видео.htmlsi=HwXs-EzbPn9r7mxC&t=493

  • @azad01_
    @azad01_ 3 месяца назад +1

    my ping is usually 250 ~ 300 ms, wanna me test it for you?

    • @BatteryAcidDev
      @BatteryAcidDev  3 месяца назад +1

      Yes!! Join my discord and let me know, I’ll set it up!

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

      ​@@BatteryAcidDevASAP

  • @TheFreshMakerHD
    @TheFreshMakerHD 3 месяца назад +6

    The Gabriel gambetta article, the internets only source of good multiplayer server design

  • @skibbl_dev
    @skibbl_dev 3 месяца назад +2

    I would love a tutorial on how this actually works (Inner workings 3:10)

  • @Alfie-ni7lx
    @Alfie-ni7lx 2 месяца назад +1

    This is actually the gold standard for fps games, only really fighting games use rollback because they have only 2 players and very deterministic gameplay.
    And RTS uses lockstep network code.

    • @BatteryAcidDev
      @BatteryAcidDev  Месяц назад

      Yes, for FPS the client side prediction and server reconciliation is, but this implementation itself may not be ready to handle a fast-twitch based game.

  • @GreenCrowDev
    @GreenCrowDev Месяц назад +1

    Hello! What's a better system for racing games, instead?

    • @BatteryAcidDev
      @BatteryAcidDev  Месяц назад +2

      Client side prediction and server reconciliation should work fine for a racing game. Netfox should work out of the box, but there may be some improvements to it that you'll notice once you get into it. I'll try to post some more links to this later! Also drop by the discord for more info!

  • @NeZversSounds
    @NeZversSounds 3 месяца назад +1

    But how did you activated in-game hosting on a dedicated server?

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

      That’s all in this video:
      Export and Run a Godot Dedicated Server
      ruclips.net/video/jgJuX04cq7k/видео.html

  • @alexkt3400
    @alexkt3400 2 месяца назад +1

    You mentioned something about cheating being a possible issue with this approach in your reddit thread, can you expand on it?

    • @BatteryAcidDev
      @BatteryAcidDev  2 месяца назад +1

      Cheating is going to be a bigger problem when you give authority over the entire player object. This approach does NOT do that, we only give client authority over the inputs. So you should be fine. I believe my reddit post was referring to a different setup. Let me know if you need some more clarification!

  • @DragilusGame
    @DragilusGame 3 месяца назад +2

    Great video, it really helped me a lot and I managed to learn a lot, thank you very much.
    I know it's not the focus, but I'm creating a turn-based game, and I would like to know if there are good practices for turn control, I read a lot on the internet, and I didn't find anything specific and each approach was very particular. I would like to know if you know of any good framework to follow that will at least guarantee that by following such practices, I won't have many problems.

    • @BatteryAcidDev
      @BatteryAcidDev  3 месяца назад +1

      Great to hear! I'm not sure off the top of my head, but you're basically making a state machine - Who's turn is it? What did they play? What effects did it have on game state? Maybe someone else who's got experience making turn based games can weigh in, but I don't think it should be too bad! I can also add that to the queue!

    • @DragilusGame
      @DragilusGame 3 месяца назад +1

      @@BatteryAcidDev That's right, that was the approach I followed, but I was unsure if this would be viable, and if it were to be scaled, as the limit is 4 people per table, but having several different tables. So I was unsure whether delegating this control just to the server would be viable.

  • @Juze81
    @Juze81 2 месяца назад +1

    Man, you are good! I have learned A LOT from you! Thank you! Subscribted!

  • @schmo103
    @schmo103 2 месяца назад +1

    THIS IS PERFECT!!!!
    just what my friend and i needed TY

  • @MattEatsMochi
    @MattEatsMochi 3 месяца назад +1

    Oregon? Where'd it go?

    • @BatteryAcidDev
      @BatteryAcidDev  3 месяца назад +1

      Hahah yea my pronunciation of words are… colorful at times 🤣

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

      @@BatteryAcidDev hahaha you're good. I hear how natives pronounce it "sounds like a hick"

  • @kazukisenpai2405
    @kazukisenpai2405 3 месяца назад +1

    how about using firebase to make a multiplayer game?

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

      Hmm, yea I mean if you have a web based game, do they even offer linux hosting??

  • @WarVic
    @WarVic 3 месяца назад +1

    Is there any way to acheive matchmaking in Godot.

    • @BatteryAcidDev
      @BatteryAcidDev  3 месяца назад +2

      Absolutely, but there are some limitations using Godot as your matchmaker and also your game server, generally you'd move the matchmaker system to some other service hosted separately from your game's server. I mean, if you're looking to support only a few players, I guess that could work. There are 3rd party services (some which I'll be reviewing) and more manual approaches like what I did for my matchmaking setup using AWS, for that, see playlist here: ruclips.net/p/PLOtt3_R1rR9WrcyDRsRF3oSrzffmBtJbu

    • @AntonGorbachevDev
      @AntonGorbachevDev 3 месяца назад +2

      You can use open source matchmaking service - OpenMatch

    • @WarVic
      @WarVic 3 месяца назад +1

      @@BatteryAcidDev That's what i was struggling from couple of days now. But yesterday i found your channel and also found some hope :) . If possible in coming days try to upload something similar to matchmaking.

    • @WarVic
      @WarVic 3 месяца назад +1

      @@AntonGorbachevDev Will try thanks :)