Are scene changes a good choice or not and how to make a game correctly?

How do you build a game correctly?
Do you use an extra scene for every little thing or do you prefer to deactivate things in the hirachy list?

what if i e.g. want to build a game where there are constantly individual rooms with music that is constantly playing in the background but can also be changed if you e.g. calls the options …
Is it a good idea to create an extra scene for each thing or do you prefer to deactivate each thing individually that you don’t need?
And how do you do that when you go through a door and want to enter a new room that is not yet visible or available? Do I already have to have a whole game in the editor where only the area used is activated in the inspector field? or do I have an extra scene for each individual room and use music that works with DontDestroyOnLoad?

Because I’ve been working on an app for months and now I have to flatten half of it because I have tons of scripts where I don’t know where they are used and objects in the Hirachy list for which I no longer know for sure what they are responsible for.

How do I do it all?
BECAUSE I will now apparently make the main menu so that a number of things from the Hirachy list are activated and deactivated each time a button is pressed without changing a scene!
Because this DontDestroyOnLoad only causes problems for me!

Because I’ve looked at entire tutorial playlists and such fine details as changing the music while the game is running and switching to the main menu is never fully explained in videos.
That’s why my current project is a real shambles of scripts, scenes and unused game objects in the Hirachy list where I’m not sure whether they might be used where.

In my opinion you have to think about your architecture upstream . I think is useless to create the whole game in unique scene.You have to decompose the game and think about the resource.

For general organization, you might make directories for each “area”, whether it’s a scene or not, holding scripts, materials … . Likewise your can make empty gameObjects in the scene doing roughly the same thing – for example “puzzles” with “puzzle1” and so on.

Instead of don’t destroy on load, you can now have multiple scenes at once. It’s a bit of a pain to get started, but works fine once you figure it out.

1 Like

it depends on the type of game you are making

if you want “open world” like wow then its better if you dont change scenes( harder, needs to load and unload content as you move )

if its old school zelda that resets everytime you change screen then its easier with change scene

Can you link me a YouTube tutorial what shows what exactly you mean?

You make it, see what works and what doesn’t, then change the things that don’t (if not for your current project, then at least for your next one).

There is little value in seeking platitudes and general advice.

2 Likes

That was said a month ago, but without a video example I have no knowledge of what you think !?

I mean just make a game instead of looking at videos.

Scene changes and dontdestroyonload can cause issues with (say) a music player. Use statics to have things persist across scenes. As far as the game architecture, that’s up to you…the more complex things get, the harder it will be to have everything in one scene. But that’s always doable with the right showing/hiding etc. Also, the Unity world is endless, so you could have multiple levels in different places and just teleport. To adjust the coordinates, have one master GameObject which has everything in that level as children, so the coordinate system of the objects can be based on (0,0,0). Just some thoughts.

This is high level anecdotal opinion, but I think if you have a relatively small scene without a tremendous amount of resources it might be valuable to use a single scene. You can store groups of elements than can all be enabled or disabled on command. I tend to think of these root objects in a scene as “sub scenes”. One advantage is that even the disabled meshes and textures are loaded into memory, so everything has already been loaded and can be accessed quickly (like object pooling).

Definitely. I have scenes where everything is in empties labelled “part1”, “part2” which take turns being active, and it works just fine. Especially if you want to go back to part1 with changes.It’s more of a pain doing that with 4 mini-scenes.

Scenes have one possibly big advantage – destroying an old scene wipes out all instantiated objects, for free. You have to set that scene as the active one, which I’ve never done since it I can’t figure out how to unbreak the lighting which that breaks, but it seems really cool.

I think in theory, scenes are to spread out load time vs. loading everything at once in a massive “everything” scene. But medium-sized stuff loads plenty fast. And one scene with “folders” can easily enough be copied and turned into several scenes, if it turns out you need that.

1 Like

Yep that is one caveat to the “single-scene” approach, the persistence of objects in the scene that you might not want hanging around.