This Godot 4 Scene Manager Does it ALL

22,374
0
Published 2023-12-24
This video will walk you through creating a Scene Manager in Godot 4 that will handle loading progress, displaying transitions, and transferring data between scenes before unloading the newly loaded scene. With this you'll be able to change scenes in your godot project while handling loading and data transfer, all with one line of code :) Transitions included are fading to black, wiping, and zelda-style level transitions.

0:00 - Intro
0:14 - The Final Product
1:48 - How it Works
2:25 - Level Structure
2:47 - Door
4:11 - Door Settings and Export Vars
5:35 - Loading Screen
5:59 - Transitions
7:02 - Loading Screen Code
9:20 - Bird Attack
10:32 - Level Code
13:37 - Scene Manager
15:28 - ResourceLoader & Background Loading
17:17 - Resource Loader Load Status
22:17 - Zelda Style Level Transition
24:02 - Adding New Transitions
27:00 - Displaying a Loading Bar
28:22 - Outro

SOUCRE CODE
baconandgames.itch.io/scene-manager-source-code

Assets by KenneyNL
www.kenney.nl/

#godot #scene #manager

All Comments (21)
  • @martinrovere7937
    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"
  • @gdomjan83
    Thank you for creating more intermediate tutorials. A lot of Godot youtubers are teaching beginners, content like this is sorely needed.
  • @DavidReidChannel
    Really useful video. Also really like this solution to scene management. Thanks for sharing.
  • @Peter-wl5xm
    Thanks for walking through the code and giving us your logic behind it. I'm really excited to see more of your work.
  • 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.
  • @luckyknot
    Very thorough and well explained tut, really helpful thanks a lot!!
  • @DanielMcNeely
    Thanks for making these great resources for developers.
  • @nickbdawg6777
    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!
  • @officialraylong
    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.
  • @andreamassa2176
    Thank you for the tutorial is very interesting and useful, i try to implement a similar thing in my game :)
  • @soirema
    wow amazing!!! i need to check it out!!
  • @miaoumixed4268
    Thank you for your videos (coming from another engine, and want to make a quick transition 😄)
  • @babyjay1386
    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!
  • @RafaMartinelli
    I can already tell this tutorial is so valuable and I’m only a couple of minutes in. Thank you for sharing it!
  • @holdim387
    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?
  • 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!!!
  • @cr0c0dile-Gena
    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? 🤔
  • 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?
  • @exantier
    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