Search Unity

Activating and deactivating different zones in an open-world area.

Discussion in 'Game Design' started by agauger28, Dec 29, 2021.

  1. agauger28

    agauger28

    Joined:
    Jun 20, 2020
    Posts:
    17
    Hello. I'm still pretty new to optimizing and game design in general, but I had a quick question: If I have a large terrain where different "zones" are separated by, say, mountains or something, would it be worth it/a good idea to activate and deactivate large chunks of the zones (like all of the objects, etc in said area) until the player enters it?

    This might be a super "duh" question to ask, but I want to confirm whether it is worth doing or if it "doesn't really make that big of a difference". To be more specific, we are talking about a terrain width of 1500x1500 with many different 3d models in each "zone", mainly as aesthetic props. So, when the player leaves the first zone and goes over the mountain into the second one, should I design it so that the objects in the first zone are deactivated and the objects in the second zone are activated? Just not sure whether that would cause a large graphical lag spike.

    Anyway, I know there are probably a lot of factors to this and I'm oversimplifying, but I figured I'd dive in and get the conversation started anyway before it gets too late in development.

    Thanks in advance.
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,638
    It might be, or it might not be, depending on your project. If you have thousands of objects with Update implemented, then you almost certainly don't want them all active at the same time.

    Since it's a pretty easy feature to implement, I would experiment with the idea. Use the profiler to see what the performance impact is one way and then the other.
     
  3. Steve_Stevens

    Steve_Stevens

    Joined:
    May 3, 2016
    Posts:
    35
    Look up additive scenes on YouTube. You’ll find exactly what you want there. Just load in and unload scenes (with all their objects). I’ve played with it and it seems to work rather well.
     
  4. agauger28

    agauger28

    Joined:
    Jun 20, 2020
    Posts:
    17
    Awesome, thanks all! I will check it out.