In practice, The Levels node changes its contents with each load, and the player gets taken out and inserted in the new level. Pretty standard.
My question is:
How could I make development easier by loading a specific Level directly?
Right now, I have to run the entire game and use save states and other loading shenanigans to get to the point I want to test out. It would be great if I could directly run a Level without everything breaking because the scene manager is not present.
Iām guessing one solution would be to detect if a level is in the root, then do a complete reload of the game with the Level nested inside the manager. But not sure if there is a more straightforward way.
I made a similar scene manager system at one point and ran into this same issue. I then discovered autoloads, and did stuff with those in future projects. So, my suggestion would be to use autoloads instead of a scene manager.
What best practices? If there is a list somewhere, Iād like to know about it!
Most of the time there isnāt one best approach to solve a problem, thereās too much variability and context to take into account for that to be possible.
Itās either this or an editor plugin, but the solution you have in mind is probably the best one unless you decide to go with autoloads instead.
What do you mean by ādirectlyā. Shouldnāt the scene manager be able to load and launch any level on demand? Otherwise thereās no much purpose in having such manager.
The problem is trying to test out a scene directly, running it straight instead of the whole thing.
Yes, the scene manager takes care of it but that means I need to go through the usual steps a normal player needs to (splash screen, load, and so on). I do have some debug shortcuts set up, but it would be more practical to launch a specific level directly without the extra steps.
I have a few conditions to be met to enable a Player to progress from the Entry Scene, through Level 1, Level 2 Scenes etc⦠These conditions are set as Variables in a Global Variables script. For test purposes, I change these Variables to allow a rapid transition though the game, without having to actually solve all the clues, kill all the beasts etc. Of course I test each Scene beforehand, but, once satisfied, I use the ācheatā Variables to go further into the game rapidly. I can set any Level as starting Scene if need be, but I wouldnāt have many of the previously acquired Variables set, so itās not quite as realistic for testing Play. It suffices for much, but if I want to run through the whole game rapidly, these Global Variables allow for this. Itās best to think these things through early on in the coding of the game (Iām now in my fifth year; progress in slow but sureā¦); it would be painfully long to run through the game as a ānormalā Player, even knowing, as I do, how to solve a lot of the enigmas and puzzles.
Does this help at all..?