Add Multiplayer to your Godot Game!

  Рет қаралды 56,705

Battery Acid Dev

Battery Acid Dev

Күн бұрын

Пікірлер: 306
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Get your game online with the next video: 👉 How to Export and Run Dedicated Servers: kzbin.info/www/bejne/oJitpotmacikbc0 🐞"...unable to process the pending spawn since it has no network ID..." Fixes found here: - kzbin.info/www/bejne/maCydZyje7xmg5Ysi=T9sWUBOHbSaGSaoQ OR kzbin.info/www/bejne/fnnSdJ6vd8mFg9Usi=4cPg-TwAzW4Pg9w4
@_the_one_who_asked_
@_the_one_who_asked_ 5 ай бұрын
is it just me or this link takes you to this video?
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
@@_the_one_who_asked_ Yes, it was set to infinite loop, now fixed! Thank you!
@laurent4027
@laurent4027 4 ай бұрын
would be soooo awesome to have this using Nakama and authoritative server (custom RPC in lua for instance) or even a easier version (no authoritative server) using Nakama as the only server but using the multiplayer_bridge to use MultiplayerSpawner and MultiplayerSynchronizer through Nakama (works well), is that possible in a near future ? :D
@piousthepious
@piousthepious 5 ай бұрын
Okay you got a sub: -Utilizing a really good beginner tutorial as a base for explaining multiplayer functionality *for beginners* (intermediate with dev in general, extreme beginner for multiplayer) -An upcoming video on authority and concepts and all that which I struggle with tremendously, I would love a comprehensive video
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Thanks for the sub! I will try to do my best to demystify authority! So stay connected!
@ShinXyres
@ShinXyres 5 ай бұрын
What a cool way to build on the initial tutorial! I'm absolutely going to follow along.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Awesome! I figured this would be how most people would progress through their development! Start with a single player game then move to add multiplayer
@wernerkruger2282
@wernerkruger2282 4 ай бұрын
@@BatteryAcidDev I think on a basic level when learning yes, but from my understanding, building more complex games you have to build multiplayer facets into the game from the start, at least that's what I've heard, still at the start of my journey
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
@@wernerkruger2282 You are absolutely correct, it is a very good idea to build in the multiplayer elements from the start. My comment was directed to those first timers who are just getting started with game development. No one enters game dev and immediate makes a multiplayer game the first time they touch a game engine, they start with something simple, like Brackeys' demo, to learn the basics.
@jonandrewdavis
@jonandrewdavis 5 ай бұрын
Love to see this!! Keep the multiplayer content coming. Games with friends are great games!! Shared experiences are really what I want to build.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Glad to hear it! Awesome, this will get you started!
@vinomakon
@vinomakon 5 ай бұрын
A great way to show and introduce multiplayer support through Godot, right after Brackeys' tutorial! I'm definitely hyped about the following video about creating a standalone server!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Thank you! Awesome! Checkout the next video!!
@firestar2220
@firestar2220 20 күн бұрын
Hey man! Just wanna say thank you for making such an incredible tutorial. I love the way everything is laid out, I can jump between chapters if there's something specific I might've missed or am curious about and just want to revisit. Fantastic explanation and communication of the ideas, I would not be shocked at all if you told me you're a teacher or something of that nature! I'm currently making a game for my brother, we always played all kinds of games together growing up, and since I've been getting into game dev lately, I want to make one for my bro. This tutorial has really helped me to understand some of the mechanics behind making a multiplayer game, and now with this knowledge, my game is evolving into something great!!! Thank you so much!!! PLEASE KEEP MAKING CONTENT
@BatteryAcidDev
@BatteryAcidDev 19 күн бұрын
Really happy to hear that! Nope, not a teacher, just a software dev trying to figure things out!! Glad this got you through the first step, there's lots more to learn but have fun with it!
@LeftCode
@LeftCode 5 ай бұрын
Great tutorial, this is a great start to see several multiplayer features of Godot, nice work! I would like to see more videos like this in the future. Keep up the good work, cheers!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Thank you! I plan to keep pumping them out!
@migats2160
@migats2160 5 ай бұрын
I think it makes sense that the player position is handled clientside. Otherwise you are delaying the feedback of the input, which is really annoying for hardcore gamers.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
This is an intro-to-multiplayer demonstration that represents the most basic setup, geared more towards LAN and that sort of thing. I think the next step would be to move to a more client-prediction/reconciliation setup where the client has immediate feedback on movement, instead of waiting for the round trip from the server position sync - which is what I believe you are referring to here, so yea, the current code wouldn't work well for faster paced games. I'm going to cover the upgrade to this over the next couple weeks!
@migats2160
@migats2160 5 ай бұрын
I'll be looking forward to that. I'm very picky about my own game design and that is why I struggle a lot.
@Splarkszter
@Splarkszter 5 ай бұрын
PLEASE. Network Interpolation and erasing De-Sync is very important. Otherwise you get games as bad as DayZ that omg i'm so angey at DayZ de-sync i can't get words for it.
@Splarkszter
@Splarkszter 5 ай бұрын
​@@migats2160 Perfection is the enemy of good enough.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
@@Splarkszter so true... but we really just want to see you get your game done @migats2160!!
@ssangkal1069
@ssangkal1069 28 күн бұрын
Can't believe that I actually made a multiplayer game! Huge thanks to Battery Acid Dev!
@BatteryAcidDev
@BatteryAcidDev 19 күн бұрын
Happy to hear you got it!!!
@ArtRaven_
@ArtRaven_ 5 ай бұрын
I got into godot recently because of brackeys. This is so interesting and Im following now 😃
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Awesome! Yea glad he’s back in the game
@dorieta_gaming
@dorieta_gaming 5 ай бұрын
Who knew multiplayer development can be so simplified and easy. Thank you for the amazing tutorial. Great learning!
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Yea for sure! Thanks for watching!
@AndreezyDev
@AndreezyDev Ай бұрын
Youre like the only youtuber really taking a deep dive into multiplayer with godot. Subbed! Your channel is gonna help so much since im making my game online.
@BatteryAcidDev
@BatteryAcidDev Ай бұрын
Thanks for watching! Glad the channel is helpful!
@niademiogundana24
@niademiogundana24 4 ай бұрын
Oh wow, this video is amazing. I kept having issues, and I figured out that you spoke on all the issues I had later on in the video. Thank you for teaching me how to add multiplayer and how to be patient. Great video. Looking forward to one that discusses exclusively multiplayer. you are a God send.
@niademiogundana24
@niademiogundana24 4 ай бұрын
you got a new subscriber
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Thanks!! 🙏 yea I tend to cover common things in all my videos, so it’s in everyone’s best interest to watch the whole thing! 😉
@Godot-Bro
@Godot-Bro 5 ай бұрын
What a coincidence! I followed Brackeys' tutorial too and posted my first video on this channel just two days ago! Glad I am not alone. I didn't add multiplayer though! 😅
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Excellent! Keep going! I've been loving the Godot journey!
@dunyakilavuz
@dunyakilavuz 3 ай бұрын
This was really clear and helpful. Thanks a lot for the tutorial!
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
Glad it was helpful!
@Freek314
@Freek314 5 ай бұрын
So thankful I found this video... Nearly 2 months in to my game on a very part-time basis and figured it's best to do a refactor now that I have quickslots, inventory, prototype projectiles and the basics up and running. Crossing my fingers that there won't be any bugs with all of this and the jolt physics engine.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Good stuff, keep it up! There will always be bugs! But that's Ok, there's always a workaround or fix.
@mesopable
@mesopable 3 ай бұрын
Your videos such an amazing addition to Brackeys journey! And something that has gotten me really excited to building with Godot. Thank you!
@BatteryAcidDev
@BatteryAcidDev 3 ай бұрын
Happy to hear! Thank you!
@cyborganic
@cyborganic 2 ай бұрын
This was so useful and helpful, thank you for making these tutorials!
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
You're very welcome!
@aaamott
@aaamott 5 ай бұрын
Just finished walking through now and the tutorial is very helpful! A little bit of feedback: - At 33:55, like 3 changes to remove the error (var player = $".." -> @onready var player = $"..") and is only visible for a quarter second or so. - With the frequent zooming, I kept having to rewind to get the lines back in view to see if I did it right. - A little more time spent on the code while it's being typed or after it's typed would give us a second to type it out ourselves. I had to rewind or pause after probably half the code additions. Overall, really great. I'm excited to see the upcoming videos! I'll be following along while creating my own game, which should be interesting because I want all players to see the same viewport and die when off screen for too long. I'd love to see a video on that kind of thing, but I think I know how to implement it and it's pretty different from most use cases. Anyway, good luck!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Thank you for taking the time to provide thoughtful feedback! And noted! Please keep me posted on any other questions or feedback you may have or what other content you'd like to see. Your requirements for a "shared viewport" may be a bit niche for me to cover right now, I'm staying a bit more fundamental for the next few videos. However, I wonder if you can can use client-authority inputs and center it on the "average" of their X coordinates, after the server applies their movement. If that's not what you mean, and you just have a set-moving viewport, well, maybe just have your server track the current coordinates of what the center of the viewport should be, then apply that to all client cameras through Replication (MultiplayerSynchronizer) (use lerp). Then once the server detects a player is more than X meters away from center point, then they die... At least that's two approaches off the top of my head. Good luck!
@Cablesfish
@Cablesfish 4 ай бұрын
Thanks for an awesome tutorial. I learned the word automagically (as well as a lot of networking)
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Haha yea... it's probably a bad habit
@MichaelZesty
@MichaelZesty 2 ай бұрын
This tutorial is so exciting, gotta say you are a legend o7
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
Thanks for the support!
@johannesneyer4421
@johannesneyer4421 2 ай бұрын
Wow, this is a really great video. Thanks alot. The way you explain all the details is awesome. Please keep going with this style and pace! It helps me a lot.
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
Much appreciated, glad it helped! I will do my best!
@rodolphocaires4584
@rodolphocaires4584 5 ай бұрын
I'm learning game development and Brackeys video was the first I followed along. Glad to see I was recommended this one, might implement it later
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Yea you should! It will really help!
@luckyblackat
@luckyblackat 5 ай бұрын
Finally managed to start multiplayer concept, always struggled a ton with it, this video helped to break the ice! thanks a ton, still lots to learn
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Awesome! Yea once you see it done once, it really helps open to door! Happy it helped!
@laurentvandermeersch3128
@laurentvandermeersch3128 24 күн бұрын
Nice tutorial, if I can give you some tips for making the videos even easier: - explain more why you use some code, what it does etc - show more screen when changing files / nodes / scenes. sometimes you just zoom in the code and open something and we have to guess what you opened those 2 things should help a lot for ppl who are starting with godot! the video is excellent btw, just some tips 😇
@BatteryAcidDev
@BatteryAcidDev 19 күн бұрын
I appreciate the feedback! I do think the editing could be paced a little better to help with those points you made.
@joshelguapo5563
@joshelguapo5563 5 ай бұрын
I appreciate people like you because i hate networking with a fucking passion. I studied physics and was always a math guy. Algorithms, machine learning, data, computer vision. I'll do it all day. Even when i transitioned into data science i wanted to avoid networking as much as possible so i appreciate that you make it easy for someone like me
@Dyanosis
@Dyanosis 5 ай бұрын
You hate networking but you like algorithms and machine learning? Isn't that bittersweet.
@joshelguapo5563
@joshelguapo5563 5 ай бұрын
@@Dyanosis I don't see how.
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Awesome! Glad it was helpful! Yea it's not for everyone...
@ImmortalTimothyM
@ImmortalTimothyM 3 ай бұрын
Welp, I have subscribed. Thank you for the video. Godot multiplayer seems really cool and is definitely the next project I want to work on.
@BatteryAcidDev
@BatteryAcidDev 3 ай бұрын
🤩😍thanks for the sub!! Yes it’s a lot of fun! Started streaming on twitch too!
@ImmortalTimothyM
@ImmortalTimothyM 3 ай бұрын
@@BatteryAcidDev Cool, I will take a look at your twitch as well.
@TotallyAccurateCodingSimulator
@TotallyAccurateCodingSimulator 2 ай бұрын
That's very useful. Thanks a lot!
@BatteryAcidDev
@BatteryAcidDev Ай бұрын
Glad to hear that!
@Ewerton1230
@Ewerton1230 5 ай бұрын
Perfect tutorial! Please create a series about multiplayer in Godot. I’d like to learn with you
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Thanks! There’s sooo much to cover, it’s hard to pick what to do next! So let me know if you’d like me to look at anything!
@Tokaint
@Tokaint 4 ай бұрын
I think a better way to do these kinds of tutorials would be a problem and solution approach rather than just telling us why we need to add code, because then it just feels like there's only one way to achieve the goal of the tutorial. In this way multiplayer, this is more of a follow along. For example leaving code how it is, running it, then telling us how to fix that problem that showed up or add something that's missing. It's a great follow along though, really smart idea of branching off from brackeys tutorial. Thanks for the chapters as well.
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Yea, I think stating a problem would help guide some content. This is more like, "how do I get started with multiplayer". The design decisions made here are in effort to give the developer the easiest path to success, for introducing multiplayer to their game. I'm not sure if stepping through this as a problem with fix would flow as well, because my goal here was to take the mystery, or mountain, out of multiplayer for those who are looking to get started with it. Let me know if I missed your point! I appreciate the feedback! Thanks!
@markn4124
@markn4124 Ай бұрын
Wow awesome tutorial! Though I do have a question please, if you're using the multiplayer sync node, could you explain when you should use an rpc vs setting a variable in the physics process + the nodes replication tab. For example in this tutorial why did you set the jump up as an rpc but set the directional movement in the physics process / replication tab? Couldn't the direction also be set in an rpc? Thanks for the great videos!
@Ro11ingBoy
@Ro11ingBoy 5 ай бұрын
Here, a comment to motivate you. Great vid! Will definitely come back to this again
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Appreciate that! Thank you!
@dannypostma9957
@dannypostma9957 5 ай бұрын
Amazing follow-up content. Well done!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Thank you 🙏
@VertiDOOM
@VertiDOOM 5 ай бұрын
I love how this is an unofficial part 2 to brackey’s video
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Haha I wish I had his views!! 🤣
@sean7221
@sean7221 5 ай бұрын
Excellent work, thank you very much!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Many thanks!
@Olixis
@Olixis 5 ай бұрын
Great tutorial @BatteryAcidDev! but how can we make a full headless centralized server we can deploy? I mean, a server without client logic that orchestrates all the clients, like in a mmo? I tried once but didn't succeed. I think it had something related to the node tree needing to have the same nodes, or something like that for the RPC to work. Do you plan to make a video about headless servers for mmo's?
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
I do plan on covering the basics of building a dedicated server and it's actually not that bad! But yea, you need to have the paths the same when splitting up client and server builds in separate projects. So making server for an MMO may have some additional considerations to take into account when determining your backend architecture, but I will do one soon on how to create a standalone server, but not sure I would call that "MMO ready". BTW I already have a video on dedicated servers, but it's a bit dated and I'm ready to do a new one! kzbin.info/www/bejne/bYrOmYyKg9p_i5Ysi=nlGO3RYZF07c3R2q
@rivenmain5753
@rivenmain5753 5 ай бұрын
so well explained!!!! good!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Thanks!
@Crisisdarkness
@Crisisdarkness 5 ай бұрын
I have to do this soon, this is amazing, I have subscribed, thank you for sharing your knowledge, you are very talented
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Awesome! Thanks for the support!! 🙏
@olivehillstudios
@olivehillstudios 5 ай бұрын
Thank you so much! This was excellent!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
You're so welcome!
@niademiogundana24
@niademiogundana24 4 ай бұрын
Please come back, and make a top down version of the game. Great video
@BatteryAcidDev
@BatteryAcidDev 3 ай бұрын
Sounds like a good idea! Thanks!
@acecool_dev
@acecool_dev 5 ай бұрын
I loved the video, so glad Brackeys is back! Would you be looking at creating a Godot 4 tutorial on Heroic Lab's Nakama multiplayer server? I would love a guide that uses Godot 4 as that's what my game is using.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Yea that's a great idea! Are you using Nakama deployed to your own server? As their hosting costs are pretty high 😬
@acecool_dev
@acecool_dev 5 ай бұрын
@@BatteryAcidDev A local docker deployment would probably be best, as it won't cost the earth 😁 Because their costs are on the steep end, what other service like Nakama would you recommend instead for a 2D competitive platformer shooter?
@elliotitenov
@elliotitenov 5 ай бұрын
I love the video, but I think it would be much better served as multiple videos; the tempo is a little fast for me, and it's annoying playing "pause the video" while at the same time trying to learn something, so I have to consciously make sure the information sticks. Otherwise great so far (haven't quite finished the video yet), keep up the good work and GREAT idea building this on top of Brackeys' existing tutorial
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Yea do it!
@CiscoStu
@CiscoStu 2 ай бұрын
great tutorial! question: how scalable would this be when connecting over 100 players at the same time? should this scenario be approached a different way? would love to hear your thoughts
@BatteryAcidDev
@BatteryAcidDev Ай бұрын
That's a hard question to answer. I guess you could refactor this to work with more players, not sure at what point it would start to fail. You'd have to experiment with some lag compensation strategies like Netfox, and host some test servers to see if that would work.
@Aris-1401
@Aris-1401 4 ай бұрын
Really a great video ! But I still find some concept on networking hard to grasp, like authority and rpc's, really looking forward on the mutliplayer fundamentals series
@BatteryAcidDev
@BatteryAcidDev 3 ай бұрын
Yes they are confusing! I plan to make more videos to cover the fundamentals over the next few weeks/months.
@PotionOfStalinium
@PotionOfStalinium 3 ай бұрын
9:51 Identifier "SERVER_IP" not declared in the current scope. why only the IP and not the PORT? how do i fix it?
@PotionOfStalinium
@PotionOfStalinium 3 ай бұрын
the solution is idk, it fixed automatically after 10 minutes
@potatoguy9653
@potatoguy9653 Ай бұрын
Hi, im trying to replicate your tutorial in a 3D environment for my own project, but for some reason my client isnt connecting to the server properly. Even after going all the way through to the camera part of the tutorial, all I have is a gray screen, and none of the inputs are going through. Is there anything I could be doing wrong?
@potatoguy9653
@potatoguy9653 Ай бұрын
So after a lot of debugging, it looks like the problem is with my set function for the player_id variable. For some reason it resets itself to 0 after the player joins the game. Is there any advice or fix?
@vcd200044
@vcd200044 28 күн бұрын
@@potatoguy9653 Do you set the node name and player_id to peer_id after instantiating the player into game?
@whilelive
@whilelive 4 ай бұрын
Awesome how to!
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Thanks!
@GoddaryuTUBE
@GoddaryuTUBE Ай бұрын
when it comes to the SERVER_IP const and you said you change it to your IP address to host it online from your pc for friends to play, can I use my IPv6 in the constant or does it need to be an IPv4 address?
@BatteryAcidDev
@BatteryAcidDev Ай бұрын
I think the setup will be a little more involved, unless you're on a LAN, but that's a whole other topic that I haven't covered just yet. I do believe Godot supports IPv6, as stated in the docs: docs.godotengine.org/en/stable/tutorials/networking/high_level_multiplayer.html#hosting-considerations
@Haunchfluff
@Haunchfluff 3 ай бұрын
FYI if you are getting a error involving synchronizers at around 30:00 in, the node order is important. Make sure to put the player synchronizer before the input one as the player one syncs the ID the input one needs.
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
Thanks for the tip! This error, along with some other common multiplayer issues are covered in this video! kzbin.info/www/bejne/maCydZyje7xmg5Y
@AnnualSeveral
@AnnualSeveral 5 ай бұрын
Subscribed. Good stuff
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Thank you! 🤜
@Godot-sv7jk
@Godot-sv7jk 5 ай бұрын
Great tutorial! Thanks.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Glad it was helpful!
@IBRA-deve
@IBRA-deve Ай бұрын
Thanks for this amazing tutorial! I have a question about the possibility of joining to a host from another pc or another network by just changing the IP address and PORT? And thanks again.
@obamacheck3567
@obamacheck3567 4 ай бұрын
If your having issues with the position sync, make sure your Player synchonizer is put first in your scene tree, followed by the input synchronizer. Believe it or not, the order it has in the scene tree actually matters
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
This issue, along with a few other time saving solutions, I review in this video: kzbin.info/www/bejne/maCydZyje7xmg5Ysi=2Mr2p4cqaA2Ds1rK
@doomnotron
@doomnotron 5 ай бұрын
Great work!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Thanks!
@andylanclos5360
@andylanclos5360 5 ай бұрын
Sort of wish you would have did it from its own menu scene. I tried to implement it myself, but ran into all sorts of issues. Haha! Great tutorial tho!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
I have a tutorial on that: Add a Main Menu Before the Game Play Scene kzbin.info/www/bejne/mneyfmiLp9qieMU
@vcd200044
@vcd200044 Ай бұрын
Thank you for the excellent tutorial. I have a few questions: In the Input handler, you placed the logic for getting direction in _physic_process but added the jump functionality in _process. Could you please explain the reason behind this? How can I determine when to use one over the other in future implementations? How can I synchronize properties in autoload? Do you plan to introduce how to change scenes synchronously? I learned about this feature from the older official guide, which implemented it using the "MultiplayerSynchronizer." However, the guide mentioned that this functionality would be available natively in future Godot releases. Are there any new methods to achieve this? (Sorry for not being able to include the guide's link, as it seems KZbin deletes any posts with external links (I've written the reply three times already 😂).
@MichaelGame_Dev
@MichaelGame_Dev 3 ай бұрын
Sorry if you get this comment twice. I submitted it but then don't see it. Thanks for this video. I made it through finally. I feel like there's still a lot I don't understand. I guess I need to dive into the Godot docs, just unsure how in-depth they go. A few examples that I don't really follow: Why is jump an RPC? Why aren't other parts RPCs. in multiplayer_controller, why are we doing this: if !multiplayer.is_server() or MultiplayerManager.host_mode_enabled: _apply_animations(delta) Doesn't this mean we play the animations if the player is a client or host, meaning always?
@coolcat30
@coolcat30 5 ай бұрын
Hey! I'm learning creating multiplayer games in Godot. I have a simple 2D shooter, but the bullets are buggy. It seems like they are created separately on client and server, and sometimes they hit on client, but not on server (and vice versa). Right now shooting is an Rpc method which is also called locally. What would be the best way to synchronize it?
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
I would say just "fake it" on the client, like you can show the projectile or muzzle flash animation, but your server is the one who actually does the calculations on whether or not there was a hit. I'm not sure what you're requirements are, but that's where I would start.
@EmilSamuelsson-w5z
@EmilSamuelsson-w5z Ай бұрын
Hey! Great tutorial! I followed it with a personal project to try to get some type of multiplayer to work. However, I do have an issue I can't figure out.. When spawning in players, they don't get added on the client side, only on the server side. Any idea on how to fix that?
@BatteryAcidDev
@BatteryAcidDev Ай бұрын
Make sure you have your player's spawn point set along with the Scene you wish to sync in the multiplayer spawner node. Make sure the peer_connected signal is being hit when a player joins and your "add player" logic is hit. I'm streaming this right now and talking to this issue, so find me on twitch/YT and it will be posted in the next week or so.
@ptkstefano
@ptkstefano 3 ай бұрын
Great video. One thing I'm trying to figure out is: is is possible to outright not make the input synchronizer and simply make my player script authority be the respective player and then synchronize parameters? I'm trying to do this and it 'kinda' works, but I'm not sure if I won't run into bigger issues later on.
@BatteryAcidDev
@BatteryAcidDev 3 ай бұрын
Yea I did a whole video on that (and correction video right afterwards, so make sure to watch both!!!) kzbin.info/www/bejne/a2ezoKp8ast_d80
@ptkstefano
@ptkstefano 3 ай бұрын
@@BatteryAcidDev Ah, that is awesome, thanks a lot!
@Prof_Natanael
@Prof_Natanael 5 ай бұрын
Incredible work friend, congratulations! I would like to know if this multiplayer is really online and if it is possible to play with different computers (on different or local networks). Could you recommend a video tutorial that actually makes this possible? Great work! Multiplayer is still difficult and you contribute a lot to the entire Godot community
@Rodrigo-xf2oe
@Rodrigo-xf2oe 5 ай бұрын
Yes it is about online multiplayer. Not sure if you watched the video, but in 6:30 he is setting the server IP, for example.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Yes you can play online! I actually have a video where I demonstrate this, but I'm going to do a brand new one, maybe next week??? Stay tuned! kzbin.info/www/bejne/bYrOmYyKg9p_i5Y
@vyasnavneet
@vyasnavneet 5 ай бұрын
Okay we will wait, your videos are great 👍.
@yosapps
@yosapps 2 ай бұрын
Thank for the amazing video!! I have a question, when I join to host, the camera is jittering when moving. Camera is enabled of position smoothing with 5px/s. Is there any solution?
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
Thank you!! Are you synchronizing the camera? where is that smoothing happening? Shouldn't be jittering... In certain setups, if you have the camera under the player object, that could also cause problems, but depends...
@saru24
@saru24 5 ай бұрын
thank you man ❤
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
You're welcome!
@gthpgth
@gthpgth 2 ай бұрын
It's such a wonderful course. I hope to see your paid content on sites like udemy as well as Patreon. Because English is not my main language, I need a machine translation function.
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
I'll have to look into that and see if my free Patreon can support the translation functions. Let me know if you have any more information on it!
@HueStudios-i5e
@HueStudios-i5e Ай бұрын
I know you are a lovely guy and I already bothered you with questions under your other video, but could you please tell me if there's another way of handling input than what you mentioned at around 23:00? I strongly dislike the fact that server has to process player's input, doesn't it create a delay equal to the ping of the players? I.e. if I have 50ms ping and I press spacebar it takes 50ms for my player to jump? I really wish Godot multiplayer would just allow us to have authority over player scenes, it would make things so much easier. EDIT: So, after finally getting your solution working in my FPP project I can indeed confirm - there's a noticable input delay. It is small, very small, but it is there and it feels bad when you notice it.
@BatteryAcidDev
@BatteryAcidDev Ай бұрын
Yea there will be a round trip delay. You can look at netfox for lag compensation if that works for you game type: Godot Multiplayer Lag Compensation with Netfox kzbin.info/www/bejne/faKrhYGjh9ijoLc I’m also working through a 3D template right now and I’m currently in the lag comp part, check out my streams, I’ll be doing more next week to finish it up!
@bkimJIN
@bkimJIN 5 ай бұрын
The video was a little fast, and the off screen edits made it a little challenging, but overall, thanks for the video!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Please let me know if there are any parts I can help clarify!
@bkimJIN
@bkimJIN 5 ай бұрын
@@BatteryAcidDev Nope, all good. I just rewatched certain parts of the video a couple times to figure out what I was missing. Thanks again for this video, looking forward to future videos, and watching your past ones as well!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
@@bkimJIN Awesome, glad you got it sorted! Thank you!
@meezi2987
@meezi2987 5 ай бұрын
It's really helpful
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Glad to hear that!!
@wdavemart
@wdavemart 3 ай бұрын
Great tutorial, but for some reason jumping as the host causes both players to jump while jumping as player 2 works fine. Any idea what I did wrong?
@BatteryAcidDev
@BatteryAcidDev 3 ай бұрын
Yea that’s an authority problem, look at my input script and make sure you add the checks for the client that it’s running on, or add an is_authority check around the inputs, otherwise you control everyone from the server/host instance. Thanks for watching!!
@charlesjordan3677
@charlesjordan3677 2 ай бұрын
hello i have a question because even after reading the documentation and asking questions to chatgpt my understanding is still unclear : “if get_multiplayer_authority() == multiplayer.get_unique_id():” is used to check the peer's authority and compare it with the current peer's network id. This makes it possible, for example, to perform behaviors only on or from the peer that initiated an action (an input for example). what's the difference with @rpc(“call_local”)? because in this case, we're also making sure that the annotated method is called only on the client (or server) that initiated the RPC call. It seems very similar to me, but I guess it's not he same at all, and that's where I can't tell the difference between these two concepts.
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
Can you describe the use case in more detail? Or drop by the discord to hash it out. RPCs, by default will call to all OTHER clients except the one making the call. If you add call_local, it will ALSO call to the one making the call. I think it would help to hear a use case so I can provide a more clear answer.
@BatteryAcidDev
@BatteryAcidDev Ай бұрын
kzbin.info/www/bejne/j37HindjaM-AfKM
@Cablesfish
@Cablesfish 4 ай бұрын
Synchronizing the slime. Is it as simple as just adding a MultiplayerSynchronizer and adding node2D Position to it? Seems to work on my end but it seems too easy :)
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Yep that’s it!
@anwarpansari7396
@anwarpansari7396 4 ай бұрын
I was able to sync the slime also! I first did it the same way BAD synced the platform i.e. Added the synchronizer, added the node2D position, added a reference to AnimatedBody2D, then added func _ready() and func _on_player_connected(). When I started the client, it crashed. So I removed the extra code, but left the synchronizer and node2D position and it worked just like that!
@tilobramer8152
@tilobramer8152 5 ай бұрын
For anyone that get's an error at 34min when testing the jump, in the script multiplayer_input the red underlined "var player = $".."" on the top of the script was missing an @onready in front of it. After adding that it worked for me.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Yes this is needed! Thanks for the highlight!
@Gr33n
@Gr33n 2 ай бұрын
Nice tutorial as well, but i got stuck in the part where u did the jump thing, said add do_jump and _is_on_floor , explained the do jump i did everything correctly, but then got issue with the is on floor, error, that the variable is declearead but never used in class... but i didnt see in the video that part for the is floor , but mine didnt work after that.... maybe i did something wrong still...
@Gr33n
@Gr33n 2 ай бұрын
found the code, to control if i did any mistakes, everything was correct just code alignment issue that is kinda wierd in godot kinda....
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
Yea sometimes that happens, glad you got it. I've changed how I do my jump stuff over time, there's even a different branch on the Github where I change how I do it, so check that out too. There's several ways to handle jump, this was just a very basic method.
@niademiogundana24
@niademiogundana24 4 ай бұрын
@5:50 please can you make a video about this one method where there is a hub users connect to?
@BatteryAcidDev
@BatteryAcidDev 3 ай бұрын
You mean like a lobby? Or relay for p2p?
@RenéSotoPenalba
@RenéSotoPenalba 5 ай бұрын
I’m at 48:18 and I can’t get the _respawn() or the mark_dead() to show up that menu. The only thing that shows up for me is the _ready(). I wrote the code exactly as he showed it. What am I doing wrong? Please help and thank you.
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Hmm, is everything under the MultiplayerPlayer node? Those functions are in the multiplayer_controller.gd script, which is assigned to that top node. So everything under it should have access, including that timer signal. When that popup for the signal shows, make sure you have the MultiplayerPlayer Node selected...
@RenéSotoPenalba
@RenéSotoPenalba 4 ай бұрын
@@BatteryAcidDev No clue how I fixed it but I got it working. I guess I didn’t have the MultiplayerPlayer node selected as you suggest. In any case, great video. Keep up the good work man!
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
@user-dc1qg5lo7r glad you got it!!
@BoyueKaizen
@BoyueKaizen 4 ай бұрын
My game functions the same as yours before replicating the Node2D position. But after doing that, you are able to see player 1 on player 2's screen, but my player 2 still cannot see player 1. What could I be doing wrong? I've tried to troubleshoot this myself for about an hour now and can't find the issue.
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
Sounds like you’re not spawning the players correctly. Make sure you spawn server side and they both are in the same scene.
@danylbekhoucha6180
@danylbekhoucha6180 5 ай бұрын
13:55 you don't need the line 33. In your player script you can add this in the ready function: func _ready(): set_multiplayer_authority(name.to_int()) Then at the beginning of your movement functions you can add this: if not is_multiplayer_authority(): return
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
I originally had that but it give me an error. Running the game complains that the authority has changed during initialization or something like that. Setting it inside the player_id setter was how I was able to get around that error. It was also in the example code that this was referenced from. I'm not sure how you don't see that error, this is interesting!
@DarthBeliarek
@DarthBeliarek 5 ай бұрын
@@BatteryAcidDev Hahaha, and I see this error when I set it in setter, so something is off here and I have to figure out what :P
@DarthBeliarek
@DarthBeliarek 5 ай бұрын
@@BatteryAcidDev And when setting it in _EnterTree it works. I need some explanation what's going on :D
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
There's some weird stuff with this, but for me it works most consistency when in the player_id setter. I made a video on this topic: kzbin.info/www/bejne/maCydZyje7xmg5Y
@DoubleADev1
@DoubleADev1 Ай бұрын
Will this work in 3d
@BatteryAcidDev
@BatteryAcidDev Ай бұрын
Yes absolutely! Follow my track on Twitch/YT as I'm using the same networking stack built-in to Godot: kzbin.info/aero/PLOtt3_R1rR9WqNoXLO9LwWXe84dyUA5bc I've already used the same tech in a few other videos/projects, you can check them out below: kzbin.info/www/bejne/e2G2eIGuZZeZp9U kzbin.info/aero/PLOtt3_R1rR9Xz34Js2Drk1JL6E7lFu22D
@erickindratara3307
@erickindratara3307 2 ай бұрын
hi @BatteryAcidDev, hope you read this comment. your game is wonderful. I wonder if you make this just for fun, or if you are actually making money from it? if yes. then, how? did you sell it somewhere?
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
Hello! This is just a tutorial, there's no "game" to it. I do not have this listed anywhere and make negative money each month! You could try to list your games on itch.io/steam/etc and ask for donations or just sell the game. I do plan on listing a game soon, I'm working towards that now, but it will take some time! Good luck!
@JerryEarnest-w4h
@JerryEarnest-w4h 5 ай бұрын
Just going to put this in case anyone runs into this problem… make sure your PlayerSynchronizer is ABOVE your InputSynchronizer in the MultiplayerPlayer scene hierarchy. I was stuck forever trying to figure out why my 2nd player wasn’t moving at all.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Thanks for the tip!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
I believe this is due to the PlayerSync’s player_id not being available when the clients are spawning in the players… it’s basically an authority problem
@danielmc5693
@danielmc5693 3 ай бұрын
holy crap, ty, I was ripping my hair out about this.
@BatteryAcidDev
@BatteryAcidDev 3 ай бұрын
That’s what this video was for: 5 Beginner Multiplayer Mistakes kzbin.info/www/bejne/maCydZyje7xmg5Y
@BatteryAcidDev
@BatteryAcidDev 3 ай бұрын
Also, I stopped using player_id and started using name for network id. This way you don’t have to synchronize an extra property, and can still perform all the authority operations and or checks. My last video on enemy mobs should have this.
@rokasb9441
@rokasb9441 5 ай бұрын
TY!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
You're welcome!
@русскийпарень-ц8у
@русскийпарень-ц8у 5 ай бұрын
YOU ARE DANIEL FRAGA!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
What a handsome guy!!
@iulian12h
@iulian12h 5 ай бұрын
why do you use _ in front of the function, wasn't that "reserved" for engine functions so we can easily discern them?
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Sounds like someone watched the latest Brackeys video 😅??? So, I'm not saying I'm in the "right" here, but from the Godot docs: > Prepend a single underscore (_) to virtual methods functions the user must override, private functions, and private variables I took this to mean if you have a function that you want to be private to the script, add an underscore to it. I think what's important here is that you come up with a way that works for you and your team, and just stick with it. If you'd prefer not to use underscores, that's fine. docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html#functions-and-variables
@daystranger
@daystranger 5 ай бұрын
What is that "set function" you're doing @ 14:33 ? You just glossed over it but I never seen anything like it(New to Godot).
@SirNibbly
@SirNibbly 5 ай бұрын
That's a 'setter' method. Setters allow you to execute more logic when you change a variable's value. There's also the opposite method 'get', which is used to execute more logic when a variable's value is accessed. You can find more info about setters and getters and their syntax in godot in the 'GDScript reference' part of the godot docs. Scroll to 'Properties' about 80% down. At 26:35, Battery Acid Dev adds more into the setter, passing multiplayer authority to the InputSyncronizer. By using a setter method, he's able to set the player_id and call the set_multiplayer_authority every time player_id is reassigned.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
@sirnibbly5284 Thank you for the detailed and accurate response! Also, stay tuned to Brackeys as I believe he's going to release a video soon on GDScript basics and that should really help!
@daystranger
@daystranger 5 ай бұрын
@@SirNibbly Thanks a lot!
@TycerKirk
@TycerKirk 5 ай бұрын
Yeah! Automagically XD
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Isn’t that what all C++ is?!?!
@TycerKirk
@TycerKirk 5 ай бұрын
@@BatteryAcidDev XD
@arnavbal3856
@arnavbal3856 Ай бұрын
Hey i'm trying to convert your tutorial here by adding a main menu scene where you select host/join as player 2 instead of it being in game, but I keep getting cant call get node on the players node where you spawn multiplayer players
@kallelfiori9767
@kallelfiori9767 15 күн бұрын
00:32:00 Couldn't we just add the Input.is_action_just_pressed("jump") as a parameter on the InputSynchronizer, like jump = Input.is_action_just_pressed("jump") and sync that? Since the server is running the move_and_slide() it would work just as fine (I think)
@Wanfanel
@Wanfanel 5 ай бұрын
After the client connects, they aren't receiving updates about the coin status. Is it easier to begin a multiplayer game from scratch rather than adding multiplayer functionality to an existing game :-) We can designate the host as the host and the client who joins as a separate entity, eliminating the need to differentiate between player-client objects and host-client objects. and later will be easy to make dedicated server
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Yes, I left the coin synchronization for you guys to play with! It is much better to go into building the game with multiplayer in mind. Absolutely, you could create a separate player class type and perform your checks on that. Or create all the needed checks in the MultilayerManager autoload.
@dogoithink5907
@dogoithink5907 13 күн бұрын
it works but when i join through another computer the lag is crazy, like 3 second delay. is there a way for the client to move without needing premission from the host? (i'm making a party game so hacking isn't really a problem)
@BatteryAcidDev
@BatteryAcidDev 13 күн бұрын
Yes! That’s exactly what these two videos are for: Full Player-Client Multiplayer Authority - kzbin.info/www/bejne/a2ezoKp8ast_dw FIXED! Full Player-Client Multiplayer Authority - kzbin.info/www/bejne/fnnSdJ6vd8mFg9U
@dogoithink5907
@dogoithink5907 13 күн бұрын
@@BatteryAcidDev thanks it helped a lot
@KrimKujo
@KrimKujo 5 ай бұрын
My multiplayer_class extends from a singleplayer script but i override the _physics_process method, when i write the code to set the multiplayer authority on the input synchronizer it throw me an error "Node not found: "%InputSynchronizer" (relative to Character)" idk how to fix this please help
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Hmm, inheritance can be tricky, maybe post a link to your code. Not sure I have enough to go on to help here.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Just wanted to follow up here - It's likely not working because the script isn't tied to a node that's in the scene. Make everything a scene and consider using Composition over inheritance, check out this video on it: kzbin.info/www/bejne/qHTYaamHp8l3eqssi=5FtC4IsvMUuBZ_-V
@KrimKujo
@KrimKujo 5 ай бұрын
I found the problem, i needed to change the id in the enter_tree fonction and now everything works fine
@MichaelGame_Dev
@MichaelGame_Dev 5 ай бұрын
I will definitely have to look at this. I'm curious how the latency does. Also curious how this would tie into something like Steam Multiplayer. Working on my first game now, I think it's good for local co-op, but given the style of game, I'm not sure it'll make a good online multiplayer game. But I guess it may be worth trying it out.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
The latency will always be a concern, but there are some strategies to help ease those issues. I'll probably do a video on some of them soon! It would work well with Steam multiplayer, as it can provide you the p2p matching and this would establish the connection - and again, video coming soon! Definitely try it out and experiment with some prototypes!
@MichaelGame_Dev
@MichaelGame_Dev 5 ай бұрын
@@BatteryAcidDev Yeah, working through it now. I am hitting an error trying to test at 30:35. It's a bit of an odd one. When the 2nd player spawns, I get this: on_replication_start: The MultiplayerSynchronizer at path "/root/Game/Players/952886701/PlayerSynchronizer" is unable to process the pending spawn since it has no network ID. This might happen when changing the multiplayer authority during the "_ready" callback. Make sure to only change the authority of multiplayer synchronizers during "_enter_tree" or the "_spawn_custom" callback of their multiplayer spawner.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Excellent! I always get this when starting out lol, try synchronizing the player_id. Also make sure your setting the authority for client in the player_id setter, I think one of those fixes the issue, let me know!
@MichaelGame_Dev
@MichaelGame_Dev 5 ай бұрын
@@BatteryAcidDev Thanks! I had those. Interestingly enough, I had to move the PlayerSynchronizer above the InputSynchronizer in the MultiplayerPlayer scene tree. Kinda odd.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
@@MichaelGame_Dev Hey so that is strange but I do believe there is some documented bug (that I mention) with the order that synchronizers are in, will probably be fixed in future version! But it's super strange that the two had to be swapped... thank you for responding!
@mcscwiggles1201
@mcscwiggles1201 3 ай бұрын
I need some help. I currently have 2 players however if 1 player joins and the host player has already moved, his position has not changed on the client peer. Also the client peer movements only get synced with the host peer. If the Host peer moves the client doesn't see any movement. Any help is appreciated.
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
Hmm, sounds like something is off with the synchronizer setup. Are you giving full authority to the client, or just their inputs?
@mcscwiggles1201
@mcscwiggles1201 2 ай бұрын
@@BatteryAcidDev I figured it out. I had both become host() and join as player 2() under func ready(): of the scene. Causing both both debug sessions to become host peer and client peer at the same time. My goal with my game is to click a single button and join as player 2 if there are any available host clients. If no available host clients, then I want it to become host. Any ideas for that would be helpful.
@BatteryAcidDev
@BatteryAcidDev 2 ай бұрын
@mcscwiggles1201 glad you got it! I guess that depends on how you plan to host. For something simple you can probably try to connect and set a timeout after 5 seconds or something to kill the connect call, not sure off the top of my head. Or maybe there’s a built-in timeout call back. I’d have to check
@tinypixel343
@tinypixel343 5 ай бұрын
I am not sure if I am doing anything wrong but your video is showing only 360p quality.
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Nah it’s youtube, I’m getting a message on my end that it’s still processing the 4k version! 😕 so hopefully it’s ready soon!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
OK, 4k is ready now! Thanks
@dajajax
@dajajax Ай бұрын
Something odd happened to my build when I was about to finish following this tutorial. While implementing the finish line part, my player became invisible. It's not dying nor being deactivated by the mark_dead function. Having downloaded your build it seems quite similar. Anyone else got an issue like this?
@dajajax
@dajajax Ай бұрын
Nevermind, found the issue, the Players node was accidentally turned off. Great video!
@BatteryAcidDev
@BatteryAcidDev 19 күн бұрын
Glad you got it!
@noldorxd9365
@noldorxd9365 5 ай бұрын
How do i build a contorller player into apply movement from input and apply animations if my code is not coded in if else statements 99%, and actually coded out of 90% of functions im dying trying to make a multiplayer 8h in a row nothing helps :D, you guide is insanely good, but my character just doesnt move, in multi
@BatteryAcidDev
@BatteryAcidDev 4 ай бұрын
I'm not sure what you mean here, but I've linked the full project code in the video description if you want to see what the full example looks like.
@antoinemassimo3391
@antoinemassimo3391 3 ай бұрын
Theres a bug that the platforms disync after a player dies. Maybe something about the Engine.time_scale.
@BatteryAcidDev
@BatteryAcidDev 3 ай бұрын
Ah yes, when the host dies it slows down everyone's synchronization due to time_scale, which Is why I removed it in a later video. If you have the project cloned, I added an "enhancements" branch that takes care of it. But you can always just remove it yourself.
@anilgulgor
@anilgulgor Ай бұрын
if you stuck on slime synchronizing, here the script: (dont forget to add MultiplayerSynchronizer on slime and add replication values as: posiiton, direction, ray_cast_right_colliding, ray_cast_left_colliding): extends Node2D const SPEED = 60 var direction = 1 var ray_cast_right_colliding = false var ray_cast_left_colliding = false @onready var ray_cast_right = $RayCastRight @onready var ray_cast_left = $RayCastLeft @onready var animated_sprite = $AnimatedSprite2D var authority_on_slime = false func _ready() -> void: multiplayer.peer_connected.connect(_on_peer_connected) # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): if authority_on_slime: _position_process(delta) _animation_process(delta) func _position_process(delta): position.x += direction * SPEED * delta if ray_cast_right.is_colliding(): ray_cast_right_colliding = true direction = -1 else: ray_cast_right_colliding = false if ray_cast_left.is_colliding(): direction = 1 ray_cast_left_colliding = true else: ray_cast_left_colliding = false func _animation_process(delta): if ray_cast_right_colliding: animated_sprite.flip_h = true if ray_cast_left_colliding: animated_sprite.flip_h = false func _on_peer_connected(id: int): if multiplayer.is_server(): authority_on_slime = true
@BatteryAcidDev
@BatteryAcidDev Ай бұрын
Thanks for the post! I also made a video on it here: Spawn + Sync Enemy Mobs & NPCs | Multiplayer kzbin.info/www/bejne/iZTCoYOVo7CGgpo
@anilgulgor
@anilgulgor Ай бұрын
@@BatteryAcidDev when i post this, i didnt see your spawn+sync video :) anyway it was a great homework :)
@bmxchamp4
@bmxchamp4 5 ай бұрын
really great godot multiplayer tutorial, and exactly what I was looking for, but I need to go on a mini rant for a minute about your content delivery style. As someone else mentioned you really need to not speed up the video when setting things up nor should you skip ahead to after you've written the code and then explaining it really quickly. There were several instances where you explained something, then cut ahead and the code had changed but you didn't mention that it had. Sure, by doing it that way, you're video is slightly shorter but if you're going to make tutorial videos, you're better off just showing every step of the way, uncut unless there's something you REALLY don't need to show. All of the stuff that you cut out, skipped over, sped up etc. is stuff that needs to be shown at a pace others can follow. If that means your video is two and a half hours long, so be it. People are still going to watch it. I've been doing hobby game dev for over a decade and am full time software engineer. I am making the transition to Godot. If I found this difficult to follow and frustrating to keep having to back it up or pause to make sure I didn't miss anything, such as the subtle, unexplained code changes, a complete beginner is going to struggle even more and it's going to take them 3x as long to watch the video than if you would have just left the additional 1+ hour of video content in. Aside from that, really looking forward to watching your dedicated server video. Thanks for the content!
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
I appreciate the feedback! Pace is something I struggle with and one of the things I'm working to improve on.
@vicioustheend1049
@vicioustheend1049 5 ай бұрын
wow very nice how to make wifi hotspot connection to play games in mobile could you please make a tutorial for all mobile devs
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Yea for sure, I'll add this to the queue, thank you for the suggestion!
@saditya6635
@saditya6635 5 ай бұрын
Thanks for this video Sir, I have a request to make if possible please cover how to add the LAN (Wifi Hotspot) (Android) multiplayer over godot thank you
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Ok I’ll add it to the queue, may be a few weeks!
@rachitshukla30
@rachitshukla30 5 ай бұрын
Just saw a video where you can click a button add multiplayer to add multiplayer capabilities to any game
@BatteryAcidDev
@BatteryAcidDev 5 ай бұрын
Hope it was helpful!!
@rachitshukla30
@rachitshukla30 5 ай бұрын
😂😂😂😂
Spawn + Sync Enemy Mobs & NPCs | Multiplayer
32:44
Battery Acid Dev
Рет қаралды 1,8 М.
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 641 М.
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 6 МЛН
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 53 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 269 #shorts
00:26
Seja Gentil com os Pequenos Animais 😿
00:20
Los Wagners
Рет қаралды 86 МЛН
Godot Scripts I add to Every Game
12:34
Aarimous
Рет қаралды 36 М.
Export and Run a Godot Dedicated Server
23:29
Battery Acid Dev
Рет қаралды 11 М.
Why Do Big Video Game Studios Avoid Blender?
6:49
The Cantina
Рет қаралды 675 М.
7 DEVS Make a GAME without COMMUNICATING! (centipede edition)
17:16
Blackthornprod
Рет қаралды 1,1 МЛН
Godot Multiplayer Lag Compensation with Netfox
43:12
Battery Acid Dev
Рет қаралды 5 М.
We made Vampire Survivors BUT in 10 Lines of Code
7:08
PlayWithFurcifer
Рет қаралды 1 МЛН
Can I Remake Super Mario World in Godot? (Part 1)
18:44
CONCURRENCY IS NOT WHAT YOU THINK
16:59
Core Dumped
Рет қаралды 109 М.
How to Choose Your Multiplayer Backend
27:56
Battery Acid Dev
Рет қаралды 18 М.
How Much Money my Mobile Game Made (After 1 month)
5:24
SimonKv GameDev
Рет қаралды 984 М.
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 6 МЛН