Search Unity

Premade environment blocks

Discussion in 'Game Design' started by ookki, Apr 28, 2021.

  1. ookki

    ookki

    Joined:
    May 3, 2016
    Posts:
    8
    Hello! I hope this is the right section, but if isn't please direct me to the right one.

    I'm trying to make a simple endless runner (didn't know the concept had a name when I got the idea) where I'd spawn premade environment blocks randomly to get a feel of continuity. I've seen a tutorial where they simply put different unity objects into a parent object and turn them into a prefab which they'd spawn when appropriate. To my beginnerish eyes it seems like a waste of resources as (if I'm correct) the parent prefabs will be spawning fully functional child objects with them. So my first thought was that it might be more efficient to do the blocks ready in Blender as then every block would just contain a single game object. But that way I'm creating lot's of bigger 3d models but using mostly the same smaller 3d objects as a base, so wouldn't that be a waste of memory or something? Which one of these approaches is the right one, or is there a sweet middle ground I'm not aware of?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    An individual GameObject has very low overhead. Everything you reference in your scene, even referenced by prefabs which aren't instantiated in the scene, has to be loaded into memory when the scene is loaded. If you're not careful, creating all these additional models in Blender will actually increase your game's memory usage significantly.

    It depends on your game, but when the number of GameObjects in the scene starts becoming itself an issue, we're talking about high hundreds or thousands of them active in the scene.
     
  3. ookki

    ookki

    Joined:
    May 3, 2016
    Posts:
    8
    Okey, thank you very much. So basically: should my premade blender "scenes" exceed the amount of single 3d models I need to make a similar looking prefabs (if you can get a hang out of what I mean) it's more efficient to go just the prefab route and even before it's probably better because of the easier tweaking inside Unity?
     
  4. Aseemy

    Aseemy

    Joined:
    Aug 22, 2015
    Posts:
    207
    It really depends on your Platform. If building for PC and consoles you probably dont have to worry about this and just prioritize your own workflow. But if working for Mobile Platforms you should work with prefabs as that really reduces a lot of drawcalls/polycount. There are other things that would help, Batching and GPU Instancing, look them up.
     
    BrandyStarbrite and Joe-Censored like this.