Home Technical Talk

Modular Game Environment. Is it better to have more or less?

polycounter lvl 6
Offline / Send Message
Oblivion2500 polycounter lvl 6
I'm making a game environment in Unreal Engine 4. I will also be using Photoshop, Quixel Mixer, and Blender for everything. The game environment is more modular.

Is it better to have more objects (duplicated and placed around UE4 scene) while each object has more texture resolution and density detail?

OR

Is it better to have fewer objects but sacrificing texture resolution and density since the objects are bigger and get less UV space?

What are the performance differences? What do game industry experts do? What if my goal for the game is to be optimized but look as amazing as possible? Does it even matter that much (especially with UE5 coming out and photogrammetry getting more popular)?

I would like to hear from you guys on what's the best approach? Is neither right nor wrong?

Replies

  • toxicsludge77
    Offline / Send Message
    toxicsludge77 polycounter lvl 5
    You'll want to maintain a consistent texel density throughout your level. You wouldn't texture say a 1 meter wall and a 3 meter wall uniquely using a 1 or 2K texture, you would use tiling textures with your UVs using the same TD.

    For example, your DOOM remake - the brick texture would be a tiling texture which you would apply to a solid wall piece as well as your window wall piece.

    I hope I understood your question correctly.
  • Oblivion2500
    Offline / Send Message
    Oblivion2500 polycounter lvl 6
    You'll want to maintain a consistent texel density throughout your level. You wouldn't texture say a 1 meter wall and a 3 meter wall uniquely using a 1 or 2K texture, you would use tiling textures with your UVs using the same TD.

    For example, your DOOM remake - the brick texture would be a tiling texture which you would apply to a solid wall piece as well as your window wall piece.

    I hope I understood your question correctly.
    Right, for example, to make sure I understand. The floor for my UT remake. 
    Originally as shown in the post, I have one mesh for the floor which had tiling textures. There were some blurry details but it was easy to place and UV map.


    Now, I wanted to experiment and break into 3-4 pieces 2X2 so the textures can have higher texel density and look sharper. 
    Now they look like this. Is this good?


  • Eric Chadwick
    The shape shouldn't matter, as much as how you tile the textures. Show the blurriness you're seeing?
  • Oblivion2500
    Offline / Send Message
    Oblivion2500 polycounter lvl 6
    The shape shouldn't matter, as much as how you tile the textures. Show the blurriness you're seeing?
    Okay, I just want to have an educated idea of how texel density and the best optimal UV space works. I know you can tile textures to fix some of the issues with it been overblown in size. So I did a small experiment with the floors in blender and UE4. 

    I created an extreme modular ket like shown above in my previous response (4-floor pieces). It's not easy to place around, there are also tiny gaps in between in UE4 that shine 3d space which is not good, but the textures look good. 


  • icegodofhungary
    Offline / Send Message
    icegodofhungary interpolator
    I think I see what's happening here.

    Okay so I tried to replicate what you're attempting to do. Correct me if I misunderstood. First I create 3 1m squares with variations as my modular pieces. I have a flat square, a sloped  square, and a corner for the sloped squares when they meet. These are the R, G, and B pieces. Then I applied a (rushed, shoddy) 512x512 texture to each square. They are mapped the same way. So right now the texture density on each square is 512 pixels per 1 meter. Of course this neglects to consider how much screen space these take up (and thus the real texture density) but that's beside the point right now.



    You could export these three squares individually to Unreal and build your floors inside the engine. But this is inefficient and will cause problems with your light maps. You'll get pesky seams and uneven transitions between the pieces. You also don't want to have to hand-place dozens of squares. You could build blue print props out of them to save time, but this can all be solved by building the larger pieces inside your modeling software, which is what I did.

    So the individual squares are only used inside of Blender to build your real floor pieces. I tried to create two larger pieces to emulate a smaller version of what you did. You would then export these larger pieces to Unreal. You don't have to change the texture at all just because you move to a bigger piece. Simply make sure they're one combined object and you weld the verts. It's perfectly fine for the faces of a single object to overlap each other in UVs. This is how trim and tiling textures work.

    In the larger pieces the first floor piece is 3m x 5m. And the second is 5m x 5m. But because the full 512pixels of the texture is applied to each square meter, it maintains the 512 pixel per meter density. The problem comes when you increase the number of tiles within the texture and try to apply that to our larger objects.

    I changed the geometry to stress that the right floor piece is a big-single object with a planar unwrapping applied.


    So what's happening is that on the left, each square meter of the object has a 512x512 px texture applied. However on the right, the entire object has a single 512x512 texture applied. In the first texture the stone block takes up 512 in width and height. In the second texture there are 5 different stone blocks across the width of 512 pixels. So the pixel per block is actually smaller. The object is 5m across. The left has five, 512px images across the width. The second has 512px for the entire 5m width. So doing the math that's like 100 pixels per meter. You drop from 512px/m to 100px/m.

    Just to put a different perspective on it:



    In order to get the same texture density on the right as the left, using the method of the right side, you would have to do a 2560x2560 pixel texture. This is why tiling and trim textures are so useful. They allow you to get a good amount of density from a much smaller texture. Your single 512px stone brick looks better than even a 1024px texture with 25 stone bricks.





  • Oblivion2500
    Offline / Send Message
    Oblivion2500 polycounter lvl 6
    Thanks so much for the detailed reply. :)

    So I should make it be like 4 pieces instead of one or a bunch of squares which is inefficient? What was the UV map like for your 4 pieces? Was it a projection layout and a perfect square?


  • icegodofhungary
    Offline / Send Message
    icegodofhungary interpolator
    This is going to sound vague and unhelpful but you should use as many pieces as you need and not a single one more. The bare minimum you need to make the room/level/building. I don't know what you're trying to model so it's hard to say exactly what you should do.

    A really helpful thing that will make it click is if you look at the free environments on the unreal marketplace. Here's a good one:


    Download that, open it up in editor and look how they do their modular pieces. Look at other environments you find on there too. Also look on Artstation for some modular floor examples.




    They use a large floor piece to cover a lot of area and the smaller pieces to do turns and break up the monotony. They could have broken down the larger floor into a skinny piece like on the left but they didn't. And that floor uses modularity during modeling too. They just modeled a black floor piece, the border, the catwalk and the rails. Then pieced it together in their modeling software. Then imported those as the modular pieces.



    They used a whole floor kit to make their floor pieces. So you have the actual floor and then detail pieces to make it look sci-fi. You would have a kit like this inside your modeling program, everything textured. Then just build modular floor pieces from it and export those to engine. Then you see what they made from it:


    I hope this is helpful. I would do the larger pieces rather than trying to build it from dozens of smaller pieces inside Unreal. Yes both used a plain 'ol planar (y axis) projection. Square UV, all the way to the edges of the 0,1 space.




  • Oblivion2500
    Offline / Send Message
    Oblivion2500 polycounter lvl 6
    This is going to sound vague and unhelpful but you should use as many pieces as you need and not a single one more. The bare minimum you need to make the room/level/building. I don't know what you're trying to model so it's hard to say exactly what you should do. 

    I'm remaking DM-Tutorial from Unreal Tournament GOTY (1999). It's a simple church temple arena. I thought it was beautiful when I saw it and played it as a kid.

    https://www.youtube.com/watch?v=tSL8D50tN64

    Thanks for sharing some modular kits and more info. I think I'm overthinking it for such a simple environment but I want to do good practice and use the best use of texel density, UV mapping, and use of static meshes as if I could make it into a much bigger environment if I wanted to. I just want my portfolio to be great so I can get a job asap. 

    Another thing that I notice that is really odd that could have to do with texel density is issues with displacement mapping and tesselation. Maybe it's just UE4 but it could also apply to other rendering engines or game engines. 

    For example, I have a mesh with a simple subdivision (just enough for tessellation to work in UE4 properly).

    I created a material in quixel mixer. Stone tile material. I made one that is 2X2 square tiles. Then I duplicated the material and created a 10X10 version. I know that I could just take the 2X2 Square tile one and just tile it 5x in UE4 but look what happens. It looks awful. But the 10x10 version with no tiling looks great. 

    Displacement Settings for both materials:


    2X2 Material:


    10X10 Material:

Sign In or Register to comment.