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
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 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
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?
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!
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 🎉
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.
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.
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?
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?
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...
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.
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.
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.
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!
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!
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.
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!
@@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.
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
@@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.
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
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!
Is client authority just using the regular MultiplayerSpawner and MultiplayerSynchronizer Godot has?
@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
Quality content my dude! You're a great source for learning about networking (in general and Godot)!
Thank you for sharing this with us 😄
Happy to hear that! Thanks!
OMG OMG OMG
WAITING FOR THE VIDEO THANKS
going to watch every second of this!
This is just the beginning!
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?
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!
@@BatteryAcidDev Amazing bro, this is truly amazing, please keep covering and dive deeper into these advanced multiplayer topics
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 🎉
Glad you like them! 🙏
thank you! this is very helpful. can't wait to add multiplayer to my game.
Yea I was pretty excited to find this!! And it's only going to get better!
Awesome video ! (as usual !)
However I'm not sure to go that way as I on a more chill/coop game play.
I think you’re right!
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.
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.
how do you make the gun ray shoot towards the object the crosshair points at?
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
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?
I answered this on my Twitch stream, please keep an eye out on my YT (next week) for the answer 😅
Here's the relevant part from my stream today:
www.twitch.tv/videos/2253635251
Godot has also started an organization to officially track SDK integrations: godotengine.org/article/godot-sdk-integrations/
Your content is fire!
Thank you!
Netfox have support for C#?
I don't think so, but you can double check the docs or ask in their Discord!
- github.com/foxssake/netfox
- discord.gg/MnzaZDCn
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?
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...
what if player move then disconnect the internet. Does that player move in other players screen?
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.
How to apply GGPO rollback netcode would be a great next video.
This sounds similar to the implementation that Snopek Games is working on: ruclips.net/video/zvqQPbT8rAE/видео.htmlsi=1Y0t-LJRQTYZEuqg
@@BatteryAcidDev Thank you so much!
Hi BAD can you make a tutorial on lan multiplayer working in android please?
Yes - I actually covered that here: ruclips.net/video/jgJuX04cq7k/видео.htmlsi=HwXs-EzbPn9r7mxC&t=493
my ping is usually 250 ~ 300 ms, wanna me test it for you?
Yes!! Join my discord and let me know, I’ll set it up!
@@BatteryAcidDevASAP
The Gabriel gambetta article, the internets only source of good multiplayer server design
Indeed.
I would love a tutorial on how this actually works (Inner workings 3:10)
It's in the queue, thanks!
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.
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.
Hello! What's a better system for racing games, instead?
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!
But how did you activated in-game hosting on a dedicated server?
That’s all in this video:
Export and Run a Godot Dedicated Server
ruclips.net/video/jgJuX04cq7k/видео.html
You mentioned something about cheating being a possible issue with this approach in your reddit thread, can you expand on it?
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!
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.
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!
@@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.
Man, you are good! I have learned A LOT from you! Thank you! Subscribted!
Thank you, much appreciated!!
THIS IS PERFECT!!!!
just what my friend and i needed TY
Glad to hear! Have fun!!
Oregon? Where'd it go?
Hahah yea my pronunciation of words are… colorful at times 🤣
@@BatteryAcidDev hahaha you're good. I hear how natives pronounce it "sounds like a hick"
how about using firebase to make a multiplayer game?
Hmm, yea I mean if you have a web based game, do they even offer linux hosting??
Is there any way to acheive matchmaking in Godot.
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
You can use open source matchmaking service - OpenMatch
@@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.
@@AntonGorbachevDev Will try thanks :)