Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Regarding modular level design

Discussion in 'World Building' started by loxagos_snake, Nov 12, 2018.

  1. loxagos_snake

    loxagos_snake

    Joined:
    Mar 8, 2015
    Posts:
    8
    Hello there! Not sure if this is the right place to ask, but Worldbuilding was the closest to level design I could find. This is gonna get a bit long, but bear with me.

    I'm making a first-person horror game (how original, eh) in Unity, and I decided to build my levels using modular assets of my own. The reasons being 1) I love the quick iteration it enables and 2) most of my past monolithic levels built in Blender ended up accumulating lighting issues. Since this is my first time attempting this approach, I've read up on the subject, watched a few talks -like the excellent one at GDC by the Bethesda devs about modular design in Skyrim/FO4- but I'm still having trouble understanding some principles. Just for the record, I'm making all my models in Blender and texturing in Substance Painter/Designer. My basic level blockout is already made in Unity using ProBuilder.

    The first roadblock I'm hitting concerns walls, specifically making them 1-sided (plane) vs 2-sided. No matter how much I search around, it seems like everyone just casually ignores explaining their choice. I made a few mock up walls of both varieties myself: single-sided walls are better on performance but lack thickness - unless I leave an arbitrary, ugly gap between them when making walls that can be seen from both sides, while double sided walls seem more natural.

    This, however, brings me to my second concern: texturing. With single-sided assets, I can have two walls facing away from each other and have their separate textures. For example, I want to make a doorway that exits the player's apartment. Obviously, while this doorway would be the same wall IRL, both sides would have to be textured differently. The only way to achieve this with double-sided geometry is to texture the asset as-is (i.e. take a double sided wall, unwrap and texture both sides differently, instead of using a tileable texture).

    Any input would be appreciated, as I can't find precise information on that. Thanks for reading!
     
  2. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Some tips.

    Use instancing for your walls.
    Use vertex colors on your shaders to assign textures. This will let you use one or two textures for each side, mostly arbitrarily. With instanced meshes, you can draw the same wall meshes over and over and let the shader handle texture assignment via vertex colors / individual rgba channels, all without worrying about performance or manually dealing with uvs or textures across different models/meshes.

    This allows you to use a single wall mesh for all of your walls, have it drawn effortlessly, and eliminate manual texture work almost entirely. You could even make walls of different sizes or types with this newfound freedom.