Search Unity

Best way building 3D-Platformer-Levels

Discussion in 'World Building' started by Deleted User, Dec 16, 2018.

  1. Deleted User

    Deleted User

    Guest

    Hi together,

    we are two guys building a 3D Platformer. Everything is working nice so far, but we are at a point, where some tipps may be helpfull.

    In this case we are thinking about an efffective and performant way to build the levels.

    We achieved this in two different ways in the past, both have their disadvantages:

    Using small blocks in the size of an unity 1x1-Cube. This allowed us building the levels very individual, and quick changes were no problem at all, but it was very very unperformant, so we decided to go another way:

    Building the whole level in an external program and import that very huge object in Unity. Well, this is very performant! But on the other hand, making changes is not very sexy.

    Now we are thinking about 2 possible other ways, combining the advantages:
    Using Planes to build the whole level.
    Building 3D-Level-Modules and put them together.

    What are your experiences? Is there another option, maybe a standard-way we should know?

    Best Regards, Sönke
     
  2. newjerseyrunner

    newjerseyrunner

    Joined:
    Jul 20, 2017
    Posts:
    966
    Why would making changes to a Blender model be difficult? I’d actually think it’d be easier to do than try to deal with hundreds of blocks. I’ve been doing Mario Maker and suddenly realize I want a jump at the beginning to be a little long and have to move hundreds of blocks, it’s not fun.

    The major downside to using models is that you may have to retexture parts of it, but I would recommend making your levels without textures so you focus entirely on gameplay.

    I recall watching something about how Monument Valley was made and they made their levels with hundreds of tiny cubes then went back and simplified all of the meshes when the levels were done.
     
    Deleted User likes this.
  3. Deleted User

    Deleted User

    Guest

    We discussed your answer (and watched a video about the making of monument valley - thanks for that ;) )
    It seems to be a good way to build a level with simpel cubes and when it works to rebuild the final version in only one big 3D-Model. We'll give it a try. Thanks and cheerz!
     
  4. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    You could always get the best of both worlds and build it in-Unity with ProBuilder :D , get the basic shape and gameplay down, then pop those meshes into Blender to detail and texture them, keep the old ProBuilder meshes as simple and performant colliders! That's what "Tinertia" did, sounds like it worked out very well for them :)

    https://80.lv/articles/tinertia-rocket-jumping-for-the-win/
     
    TylerCode_ and Kurt-Dekker like this.
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,735
    It is indeed a time-honored way, commonly referred to as "whiteboxing," although that term is used in realty as well.

    This is a gama article about it:

    https://www.gamasutra.com/blogs/SaraCasen/20160713/276970/White_Boxing_Your_Game.php

    It lets you work rapidly and learn a lot about the game you are creating, since games are indeed an art as much as they are a science.

    I do all my whiteboxing in ProBuilder now, and I'm steadily getting more comfortable with it.
     
    Last edited: Dec 18, 2018
    gabrielw_unity likes this.
  6. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    You could also combine the best of both approaches.

    I also build levels with smallish cubes, which runs rather inefficient from a runtime performance point of view. In order to overcome this limitation, I wrote an optimizer that is hooked into the build process.

    Unity provides the [PostProcessScene] attribute, which allows you to modify a scene during a build. I use this step to merge objects/meshes which are in close proximity and have the same material. This trades memory for draw-call efficiency.

    The optimization step is applied to builds only. I excluded it from being used in the editor, because it did increase the time the editor needed to enter playmode and I want to have the fastest possible iteration times.

    This approach allows me to have a very neat workflow, where I never need to leave Unity to build the level. And I'm also getting maximum performance due to the scene optimization step.
     
    Kurt-Dekker likes this.