If you're looking for more Godot 4 tutorials, check out my Let's Make Snake series which takes you from opening Godot through making a complete game. kzbin.info/aero/PLiJ2loFXqTO1_raZB5MhIYLtqdvT5CdSP
@martinrovere79378 ай бұрын
I love that you don't make me copy your code but explain your code and reasonings behind. It forced me to think how to aproach this. Something like "wait, i should be taking notes"
Thank you for creating more intermediate tutorials. A lot of Godot youtubers are teaching beginners, content like this is sorely needed.
@baconandgames10 ай бұрын
Aw, thank you so much. That’s very nice of you to say 🥹
@Peter-wl5xm8 ай бұрын
Thanks for walking through the code and giving us your logic behind it. I'm really excited to see more of your work.
@baconandgames8 ай бұрын
Thanks Peter! Is there anything in particular you’re looking to learn?
@Peter-wl5xm8 ай бұрын
@@baconandgames Hi Sean, appreciate the reply! I'm currently working on an android and steam release single player game. A video on cross-platform general thoughts and implementation tips would be awesome. Just a greedy desire but if it doesn't follow the content totally understood! Your videos are amazing just to reiterate. Will thoroughly watch all of them 😃.
@baconandgames8 ай бұрын
Thanks Peter! Mobile development and I have a long and storied history 🤣 I’m not sure I can go back down that road… been burned by Google too many times. But I’ll keep that in mind 🤔
@babyjay13867 ай бұрын
Hello, great tutorial! Very well organized and easy to understand. This helped me immensely in my journey to learn game development. If anyone is stuck and failing to load the scene, I added the following line to the ready function of the scene manager in order to connect the signal to the appropriate function. content_finished_loading.connect(on_content_finished_loading) This is necessary in order to actually call the function that loads the level! I also had to create the update_bar function in my loading_screen script. func update_bar(progress): progress_bar.value = progress The modulo expression was not working so I changed the progress_bar path in order to not receive a null instance error. @onready var progress_bar: ProgressBar = $Control/ProgressBar These things may have been in the code, but seem to have not been referenced in the video (perhaps I just missed them). Thanks!
@baconandgames7 ай бұрын
Hey baby Jay, thanks for the comments. Just a heads up, there’s a newer version of this up on my GitHub as part of my Game Template, if you want to check that out. I’ll be maintaining the scene manager and other things there moving forward.
@nickbdawg67779 ай бұрын
Thanks so much for this tutorial! I threw together an incredibly janky scene manager during my last game jam and decided I needed to find a more robust solution and this is perfect for me!
@baconandgames9 ай бұрын
Awesome! Love the pup photo in your profile, by the way. ❤️🐶
@DavidReidChannel7 ай бұрын
Really useful video. Also really like this solution to scene management. Thanks for sharing.
@baconandgames7 ай бұрын
You’re welcome David. Be sure to check out my most recent video. It’s on my godot game template and it includes an updated version of the SceneManager and a bunch of other stuff too!
@the_disco_optionАй бұрын
I'm loving the detailed explanations and reasoning behind your code.
@baconandgamesАй бұрын
Awwww thank you. I appreciate that
@DanielMcNeely11 ай бұрын
Thanks for making these great resources for developers.
@baconandgames11 ай бұрын
Aw, Dan. 🥹
@officialraylong4 ай бұрын
This is awesome! As a general software engineering improvement, we can replace magic strings like "fade_to_black" with an enumeration to avoid bugs from typos.
@baconandgames4 ай бұрын
In future versions I intend to replace those with enums. Thanks for watching! ❤️🙏
@petterialanen246710 ай бұрын
Great content! I'm building a similar type of approach to my game and this helped to wrap my head around the between scenes transitions.
@baconandgames10 ай бұрын
That’s wonderful! Keep us posted on your project!
@federicomaciasvidal78572 ай бұрын
This is absolutely beautiful, thanks a lot man!!
@baconandgames2 ай бұрын
You bet! I’m carrying this forward through my game template (there’s a video on that and its available for free on GitHub too) 🙂
@andreamassa217611 ай бұрын
Thank you for the tutorial is very interesting and useful, i try to implement a similar thing in my game :)
@baconandgames11 ай бұрын
Good luck! Let me know if you get stuck. Thanks for watching. ❤️
@holdim38710 ай бұрын
Good day, any particular reason you went with this scene route (that is a scene that contains a player and GUI) and not having one main scene, under which player, GUI, and the level scenes are separate. And loading offloading only level scene, while keeping GUI and player (just changing players position, animating) loaded?
@baconandgames10 ай бұрын
It's actually really funny you mention that. The game I pulled this from does it the way you describe and it had been my intention all along to make this tutorial work that way. The thing I'm learning as I get into making tutorials is that the more you put in, even as simple as it may be, the harder it gets to clearly talk about certain things OR the longer the video gets. My original cut of this video was over 50 minutes long and over the course of editing, some stuff just has to go, in favor of length, simplicity or both. I was actually debating doing a short follow up showing how to do exactly what you're describing... so maybe I will 🤔 Great question!
@holdim38710 ай бұрын
@@baconandgames I see, I think if you will continue on this, it would be a cool idea to explain pros and cons of both ways for the new developers.
@baconandgames10 ай бұрын
I really like that idea. I'll add it to the list. You first comment has been one of my favorite so far - I worried about cutting that and you got right to the core of wondering whether I should keep it or not. I think, in the interest of keeping the tutorial more simple and digestible, it was the right call to cut it but I'm glad you called it out because I think showing the next evolution WOULD be a good idea that I wasn't necessarily considering. Again, great question and a great idea!
@luckyknot10 ай бұрын
Very thorough and well explained tut, really helpful thanks a lot!!
@baconandgames10 ай бұрын
That’s very kind. Thank you so much!
@soirema6 ай бұрын
wow amazing!!! i need to check it out!!
@miaoumixed426811 ай бұрын
Thank you for your videos (coming from another engine, and want to make a quick transition 😄)
@baconandgames11 ай бұрын
You’re quite welcome and thanks for watching! Bonus points for dropping by with a pun. 🌟
@RafaMartinelli11 ай бұрын
I can already tell this tutorial is so valuable and I’m only a couple of minutes in. Thank you for sharing it!
@baconandgames11 ай бұрын
I’m glad I could help. Thanks for checking it out🙏
@RafaMartinelli11 ай бұрын
@@baconandgames it will be useful for what I’m working on, especially cause it looks like your code is really polished. Thank you!
@baconandgames11 ай бұрын
@RafaMartinelli That’s great! I will be uploading the source code to my itch page tomorrow free to download. I wanted to do that the same day the video came out but it has been a busy month.
@RafaMartinelli11 ай бұрын
@@baconandgames that’s really appreciated - sometimes people might get feel entitled and forget there’s a human being with a life behind the video. 😅 Plus, one learns a lot more by following along than by just copy-pasting. I’ve discovered through experience with my channel that prioritizing oneself is the best bet long-time! Don’t hesitate reaching out if you need some help!
@baconandgames11 ай бұрын
I appreciate that. I will probably take you up on that. I’ve only been at this a few weeks, so I’m learning all this in real time. It’s super helpful to have someone to bounce questions and ideas off for perspective. 🤜🤛 I appreciate the self-care advice. Easy to lose sight of that part but you’re right that it’s critical.
@glovebox0982 ай бұрын
23:35 Hi i'm new to all of this so apologies for the stupid question, I've been trying to adapt this to have a camera follow the player instead of having room transtions I would like for it to be a continuous transition. I thought of having the player scene on the gameplay scene and the camera as a child node of the player instead of having the player scene on each level scene. how could I get this to work?
@baconandgames2 ай бұрын
First of all, there are no stupid questions here :) Secondarily, you can absolutely make the camera a child of your player. Just make sure that when you add the camera that it's the active camera. To add the player via code you'll need to look at instantiating scenes. The gist is that you'll need to preload the scene you want to add via code (instantiate) and then use that preloaded scene (a PackedScene) to call instantiate() on it and then add it to your scene tree. You will likely find that having the camera as a child of your player solves some problems and creates others, but it's a good place to start. If you dead end on that approach, you'll learn why and know where to look for another approach. If you don't dead end, then you have your solution :) Good luck!
@spacerobotTR2 ай бұрын
Say I need doors of different sizes for different sized openings. I see I can scale the door scenes but it does not seem to abide by my 16 x 16 grid. I just want to grab handles on the side and make longer or shorter. Is there a way to do this? I'm new to Godot.
@baconandgames2 ай бұрын
You can scale the parent or scale the sprite itself (or bring the sprites in at a different size). The thing you're going to want to be mindful of is the distance you need to push the player into the room when they enter through a door. I forget the variable name, but as the doors bet bigger, that too will have to get bigger as well (so they don't spawn on top of the door but instead next to it).
@exantier8 ай бұрын
Dude, this plugin is sick. It helps me a lot with my game. Otherwise, I probably would have had a lot of headaches trying to manage all the doors in my RPG game on my own. Thank you for sahring it! :D However, I have a question: In my game, the camera follows the player on a large map. When he walks through a door, the camera is removed, causing the scene origin (0, 0) to be seen during the screen fade instead of the camera's last position. Would you by any chance know how to fix this? thnks :3
@baconandgames8 ай бұрын
There’s a couple of ways you can fix this. One, which I omitted from this tutorial would be to keep the camera live a node above your level and instead of destroying the camera and level, just destroy the level. This would mean loading your level into a holder node, instead of the root. I had originally written this SceneManager this way, but it was one extra step to explain so I removed it to make the video simpler. The other thing you can do is to pass desired coordinates for the new camera into the new level (data passing is covered here) so that when you initialize the new camera it’s at the place you want it to be. Both would work, it’s just a matter of preference. I’m glad you found this video helpful!
@exantier8 ай бұрын
@@baconandgames Sounds good! I tried the first solution. In levels when I only got one door, works excelent. But when I got more of two cameras showing each door (because I have more of one door in some levels level in different places) just it shows the first one on the herarchy instead of the right one. And about the second solution, I think I know what you mean and I think it will be the right solution. But... I don't know how to do it. Can you give me a simple example, please? :3 And very thanks for the fast reply! I'm new at this. You're helping me a lot, dude! qwp
@baconandgames8 ай бұрын
I’ve had a few people ask me out this setup. I’m going to make a video on it this week. Granted, it probably won’t solve your problem out of the box because you will still likely need to define where you want the camera to start, but that part is easy. Keep an eye out (subscribe and hit the bell and all 🤣). Coming soon!
@exantier8 ай бұрын
@@baconandgames I really appreciate it, man. I'm already a sub, so I'll be waiting for it haha! Thank you for being so attentive to your community :'3 👍
@baconandgames8 ай бұрын
@exantier it’s my pleasure!
@nelsonguedespaulojunior9779 ай бұрын
Hi. This was an fantastic tutorial, please continue to create such good ones with amazing techniques and details! I noticed that on SceneManager, on the monitor_load_status() callback, even if it's still loading and progressing, you don't rearm the timer, so I guess that after the first time the timer timeout's, you will update progress, and progress will get stuck to that much until end of time. Could not setup a test yet to check this. Is this correct, or I'm wrong?
@baconandgames9 ай бұрын
monitor_load_status() is called every 0.1 seconds (each time the timer completes). Since the timer is not a one-shot, meaning it restarts itself each time it finishes, it effectively checks the load status 10x per second (framerate aside). So you only need to start the timer once you begin loading a piece of content. After the content finishes loading, the timer is freed and the next time you load something a new timer is created and the process repeats. Does that answer your question? Please forgive me if I misunderstood your question. I THINK perhaps you're thinking of a timer more like one in the real world (like a kitchen timer) that you'd set for 5 minutes and after the time runs out, it buzzes and then is done. Timers in Godot repeat until you stop them (unless set to one-shot) in which case they're more like "loops" than "timers".
@nelsonguedespaulojunior9779 ай бұрын
@@baconandgames Hi, thanks for the answer. Actually, I was looking the loading screen scene and there's a Timer object there and it was configured to one shot. Latter I realized that the one you use on the code is created there and is not the same object. But thanks anyway for the answer.
@nelsonguedespaulojunior9779 ай бұрын
@@baconandgamesI got another problem here, in my case, the Level is bigger than the viewport size and can have multiple rooms that are distant from one and another. When you set the player position you see the map on the default camera position on it (which usually is not on the door) and then it blinks to the player position. I tried a few thinks but still couldn't fix this problem. On my Level, I have the Camera2D object and my player has the RemoteTransform2D. I changed the Level code to actually instantiate the player after it loads and then set the RemoteCamera2D. This works fine. The problem is that we see this blink in the screen showing the position that Camera2D is when you build the map. Any thoughts on that?
@nelsonguedespaulojunior9779 ай бұрын
By the way, this happens using the fade_to_black transition.
@baconandgames9 ай бұрын
There are a lot of ways you could address that. Without looking at your code, two things come to mind. You could try hiding the player in the _init() function and then showing it after you position it. You could also use a placeholder object like a Marker2D/3D and instantiate your player at runtime instead. These are just two of many solutions you could investigate. Good luck!
@dotspak10 ай бұрын
Hey I'm having problems loading the actual scene file. On the line var loader = ResourceLoader.load_threaded_request(path), it can't find the path I'm giving it no matter what the file is (I tested with files other than scenes just to be sure). I'm not sure what's wrong, any ideas?
@baconandgames10 ай бұрын
Under Project (in the menu) try "Reload Current Project" - if you've moved scenes around, sometimes paths or other metadata can get a little gummed up. Are you entering the path in manually or are you using the drag method from the video? If you want to send me some screenshots of your project on Discord @baconandgames I will have a closer look. My guess is there's another error elsewhere but it could be a whole bunch of things. We'll get you straightened out 😉
@dotspak10 ай бұрын
I'm quite experience with the reload project button lol😅I'm using this for a slightly simpler use case than in the video, just transitioning from a title screen to the main game since the main game is currently contained in one main scene (for prototyping simplicity). In my case I'm just doing a call in the title screen code load_new_scene(path), where path is the string I get when I click copy path in the FileSystem. Doesn't change anything when I make an export and put the path there instead
@baconandgames10 ай бұрын
Hm. Well if you want to hit me up on Discord with your code, I'll be happy to take a look. It's probably something goofy.
@dotspak10 ай бұрын
@baconandgames just added you sorry for the late reply
@baconandgames10 ай бұрын
@dotspak all good 🤜🤛
@watchandlearnLboard4 ай бұрын
This is really cool! I've watched through this video and the follow up update, and I'm still not exactly sure how to integrate this into my game 😅 copying the whole folder ignores it because of the .godot and copying only the folders returns a ton of errors. I imagine I could comb through the videos and copy it all myself but I feel like surely there's an intended way to use it? Sorry if this is a silly question and great work!!!
@baconandgames4 ай бұрын
I have a game template available on GitHub which includes this. That might be a better option for you, since it’s more than just the SceneManager. It’s not a sample game, per se, but it might be easier to understand in that context. Give this a look and let me know if that helps… I might just make a small game live so people can see the process I use when starting from the template. kzbin.info/www/bejne/qn_Ud3-jl7yKY7ssi=SoqJhLnUpkH4-iKM
@watchandlearnLboard4 ай бұрын
@@baconandgames thanks, will definitely check it out. love the content and tools you're making.
@baconandgames4 ай бұрын
@watchandlearnLboard thanks so much 🙏
@musicdudejoe263Ай бұрын
Why do some devs create timers in code and others just make one in the editor? Is there a difference or reason why you'd choose one over the other?
@baconandgamesАй бұрын
That's an excellent question. Functionally, they're identical. So for a lot of people, it's a matter of preference. I prefer to do them via code because the node just clutters up the tree and it feels cleaner to me to have all the logic in text (next to all the other logic) rather than hidden in the inspector. Aside from that, sometimes you don't always know how many timers you will need. In those cases, creating them on the fly via code is the only solution. If you only ever need one, it really just comes down to which method you prefer :)
@musicdudejoe263Ай бұрын
@@baconandgames Yeah that makes sense. I was also wondering about your line `get_tree().root` and was wondering if it's any different to using `owner`, or if those are also the same.
@cr0c0dile-Gena10 ай бұрын
First of all - great tutorial, thanks a lot! 🙏💚 There is only one issue: I added one spin animation to the loading screen and it's stutters during "heavy" background loading (a few large png pics for testing purposes). I tried to move "monitor_load_status" logic to the "_process", turn off V-sync, make spin animation in code - nothing helps. Any suggestions? 🤔
@baconandgames10 ай бұрын
Make sure that the call to report_midpoint() (in your AnimationPlayer) is after you TO animation completes. If that call happens too early, Godot will be trying to load the new scene while also playing your animation. If it's in the right place (after for IN transition has finished playing), whatever stutter you're seeing is just coming from the animation itself rather than the SceneManager loading anything heavy. Have a look at that and get back to me. If that doesn't help, we can look at some other things. I would also test the animation you're using itself in a different project (no loading) - you might just need to simplify the animation - more complex transitions than simple fades and wipes can be more efficiently achieved using shaders rather than animations (but we don't need to go there. yet 😀) Thanks for watching and for reaching out. We'll get you squared away 💪
@cr0c0dile-Gena10 ай бұрын
@@baconandgames Thanks for the quick response! 🙏 The "report_midpoint" call is in the right place and the spin animation is very simple (just one Sprite2D rotating in a loop). I ran some tests: loaded the "heavy" scene and loaded the "base" scene with a delay before calling "finish_transition" (to test the rotation animation) - in the "light" version the rotation animation works smoothly. I also found a thread on the Godot forum with a similar problem, and the thread's author has an idea that the problem comes to the surface when a new scene is instantiated and added to the root tree. 🤷♂
@baconandgames10 ай бұрын
If you have a moment, send me a link to that thread. I'd be curious to read it. YT might flag the post if you put a link here, but my email is on the about page. Or you can hit me up on Discord @baconandgames (with the same avatar as my channel). Does the delay you added solve your problem or does that just rule something out? Let me know how else I can help 🤜🤛
@cr0c0dile-Gena10 ай бұрын
@@baconandgames I'll get in touch with you in Discord (same avatar as well 😁) shortly 💚
@yubenzuo5 ай бұрын
Really useful video. Thank you so much for the tutorial. But I have a little question. When I run the demo in Godot4.3,the game will be get freezed in the zelda mode. Godot4.3 will report a error,“gameplay.gd:35 @ _on_level_added(): Parameter "p_child" is null.” Is there any way to fix it? Sorry for my poor English,thank you again😀☺
@baconandgames5 ай бұрын
Oh no! Thanks for letting me know. I haven’t tried it in 4.3 yet. But I’ll have a look when I get a free minute and see what might have changed that’s breaking something. And your English is just fine 😀
@dailyshadow4 ай бұрын
@@baconandgames Did you ever figure this out I'm currently trying to get this to work also
@yubenzuo4 ай бұрын
@@baconandgames Everything is ok in Godot 4.3 beta3!I think the error was caused by the Godot Engine Itself! Thank you so much for the tutorial again!😀
@baconandgames4 ай бұрын
@yubenzuo you bet, thanks for following. I’ve been juggling a bunch of things lately so I apologize if I seemed slow to act here.
@Peter-wl5xm8 ай бұрын
crow is confirmed dead
@baconandgames8 ай бұрын
He’s… on a long vacation
@Fragnatix9 ай бұрын
Complaint: Your camera is hidding lots of stuff
@baconandgames9 ай бұрын
Response: What do you mean? Are you talking about the headshot covering up part of the file explorer in the bottom left? I don’t think it gets in the way very much, the meat is all up in the code editor. But I’ll be more careful in the future to move it. Thanks for the feedback. 🙏
@DannyArchive11 ай бұрын
SOUCRE CODE (coming soon)
@baconandgames11 ай бұрын
I’ll bump you here when I have a moment to upload it. I’m on the road but hope to have it up in a few days.
@baconandgames11 ай бұрын
Source code link has been added to the description. Thanks for your patience... it was a BUSY month.
@DannyArchive11 ай бұрын
@@baconandgames thank you good sir!
@swampshack10188 ай бұрын
25:37
@baconandgames8 ай бұрын
Hi 👋 Is there something at that timestamp I should be aware of?