Search Unity

Scenes and performance issues

Discussion in 'Game Design' started by rasmushopen, Dec 27, 2021.

  1. rasmushopen

    rasmushopen

    Joined:
    Jun 6, 2021
    Posts:
    2
    Hi! Im currently creating my first game and i want it to be a relatively simple horror first person game.
    The game is set in a stranded submarine in the bottom of the sea, where you need to complete
    different tasks while being chased around by a monster. However I can´t seem to decide if i should
    have the entire game set in one scene or do multiple scenes. I need the submarine to be very large
    so you have space to run and hide from the monster, and I am planning how adding a lot of detail. Currently every wall and floor item are made from cubes and other tileable assets from Blender, but having the entire game in one scene is causing me to worry about performance issues. Would this be a problem, or is it possible to adjust view-distance in unity settings or something to have the entire level in one scene?
     
  2. Steve_Stevens

    Steve_Stevens

    Joined:
    May 3, 2016
    Posts:
    35
    You can load and unload scenes on the fly, Google it.
    There are a couple of tutorials on youtube about it as well.
    You could make each compartment a scene, and only load the connecting compartments so you can see them thru the hatchway.
    That would make for a pretty smooth running game.
     
    rasmushopen likes this.
  3. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    It could be a problem, but I wouldn't really consider view distance to be a significant factor.

    Personally I'd go with a multi-scene approach because things are far more scalable that way. Do note that it comes with its own complications, however. For example, rooms will have to "remember" any changes and re-apply them when they're reloaded, potentially including tricky cases such as an object being moved from one room to another. This stuff is all quite manageable with experience, but could be quite a headache for a first game.

    Things I would consider, plan out and prototype early on:
    - How are you going to set up your tasks / puzzles? If they are spread out over multiple scenes it can't just be direct inspector references.
    - What does the monster need to "know" about rooms which may not be loaded? Some data may need to be separate from the rooms themselves.
    - How are you going to store and re-load the state of the different sub-scenes?
    - How are you going to track, store and react to the player's progression?

    Personally I'd probably take a hierarchical approach. One scene with all of the "shared" stuff in it: player, monster, navigation data, items which can be moved around (assuming there aren't a crazy amount of them), task / puzzle / quest info, and a low-fi version of the whole submarine. Then I'd have hi-fi versions of different areas which are loaded / activated as-needed so that the player sees the nice version of everything.
     
    rasmushopen likes this.
  4. rasmushopen

    rasmushopen

    Joined:
    Jun 6, 2021
    Posts:
    2
    Thank you for the feedback! Will definetly look into it :)