Root node for many levels being equal and having the same script

Godot Version

4.2.1

Question

Hello everyone, first post here.

I would like to apologize in advance if there are already similar posts to this, I made a quick search and found none, so decided to open this topic.

Here’s the thing: I’m making a multi-level game - a platformer with +50 levels - and wanted to know if it would be bad design or lead to future problems if I had all these levels have the same root node with the same functionality - a (In)Game Manager, for handling player deaths, pause menu, and such.

I don’t think it makes sense to use AutoLoad in this case because I don’t want a GameManager working on Main Menu or in the Level Selecting Screen, so I thought that using the same GameManager node as the root node for every level (to handle player restart, pause menu, etc) would be the solution… I’m aware it’s probably not the best, but I’m stuck with it, can’t think of a better one for now.

Help?

Hmm, I’d still stick to the idea of sticking gamemanager in autoload, but since you don’t want it to work in menus and stuff, you could add a list of states to it, for example: enum states {Menu, Play, Pause} and when needed in GameManager actions you could check what state it is now. And about the design, no one but you can see your project and no one is interested in what and how it works. The main thing is to understand if you can support this system and scale it, if you have problems with adding something new, then maybe you should reconsider the way you design. However, if you are far along, I would recommend to keep going and when you finish the project and have a product think if you want to make it better and develop further, if not, just release the game, if yes, you can start writing the game again using a different way of designing and making a more scalable system.

1 Like

Development it’s still in early stages, so there’s time to set up the AutoLoad + states method, that’s probably the best solution to this.

Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.