Should building interiors be in separate scenes?

I have an overworld with multiple buildings in it. Each building has a separate interior model with ~500 triangles. I was wondering if it would be better for performance to store the interiors in the same scene, and teleport the player to them, or if I should make a new scene for each interior and load that when a player enters the building?

Each have their own drawbacks and challenges, so I was wondering what the general consensus was about the topic.

I would say,

Each approach has its own drawbacks and challenges related closely to the engineering involved and the type of game, so you need to experiment inexpensively and move towards the answer based on your experiments.

Personally I love multiple scenes, even additively loaded and overlaid scenes once a project gets to a certain size. But for day 1 simple game experiments? Throw it all in one scene, get back to work ASAP.

I agree that I’ll need to do my own testing to see what works best for my project.

Throwing it all in one scene while I do other things seems nice, but this is already a somewhat-large project and I do have plans for it, so I’d just like to make sure I don’t start off on the wrong foot and have to rebuild a ton of stuff later.

I’ll look into additive scene loading though. Thank you!

You’re welcome!!

Beyond a certain scale you start wondering, “How did I ever live without additive scene laoding?!”

And same goes for source control. I can’t work without it watching my back at all times.

Here’s some more goodies to ponder regards additive scenes:

Additive scene loading is one possible solution:

https://discussions.unity.com/t/820920/2
https://discussions.unity.com/t/820920/4

https://discussions.unity.com/t/824447/2

A multi-scene loader thingy:

https://pastebin.com/Vecczt5Q

My typical Scene Loader:

https://gist.github.com/kurtdekker/862da3bc22ee13aff61a7606ece6fdd3

Other notes on additive scene loading:

https://discussions.unity.com/t/805654/2

Timing of scene loading:

https://discussions.unity.com/t/813922/2

Also, if something exists only in one scene, DO NOT MAKE A PREFAB out of it. It’s a waste of time and needlessly splits your work between two files, the prefab and the scene, leading to many possible errors and edge cases.

Two similar examples of checking if everything is ready to go:

https://discussions.unity.com/t/840487/10

https://discussions.unity.com/t/851480/4

These links are gonna help out a lot. Thank you so much!

1 Like

How Kurt-Dekker manages to have all these help links on hand each time is beyond me :slight_smile:

1 Like

Been steadily gathering them in a big file since about May 2020. :slight_smile:

-rw-r--r--@ 1 kurt staff 45979 Sep 7 09:58 forum_links.txt

Just want everybody to have a good time making games in Unity3, not spending five days searching for how to fix a nullref.

The OP’s post above about building interiors and how to manage an ever-growing world of links and rooms and whatnot is a far more interesting question than most, so that’s very cool!

1 Like

@Kurt-Dekker one more question: I’ve been messing around with a range-based single-mode preloader, where if the player gets within a certain distance of the doorframe, the corresponding scene will start loading. I use AsyncOperation.allowSceneActivation = false to prevent the scenes from activating, then when a player steps into the doorframe, I set the value to true and the scene loads. It seems to work pretty well, but I was wondering if it was possible to unload these un-activated scenes (UnloadSceneAsync doesn’t seem to have an effect)? If I had multiple doorframes next to each other I’d want to only load the closest one.

Besides that, is this approach valid? The code isn’t too messy for it and when there’s only one door, it works great.

That’s been around google for a while… I actually think there is no way to do that, but I haven’t tried in a while.

1 Like