4
\$\begingroup\$

I would like to make modular corridors and some other objects in my level, to make it easier to construct them.

  • Do I separate walls, floor, and ceiling or make a tube module?

  • How to avoid seams between modules?

  • How to deal with the edges of those elements?

Take the wall panel, should it be a polygon (no thickness) or a solid block?

\$\endgroup\$
2

1 Answer 1

1
\$\begingroup\$

Do I separate walls, floor, and ceiling or make a tube module?

A tube module will be fairly restrictive — you won't be able to add doors anywhere in it without swapping out the entire module, for example. You should probably go for separate surfaces unless your game's style definitely won't need it or benefits from single modules.

How to avoid seams between modules?

  • One approach is to make sure the geometry of all your modules lines up perfectly, and the edges of two modules meet perfectly — each vertex from one having the same position, down to the last digit, as its matching vertex from its neighbor. This would be suitable if you are procedurally generating a world in a custom engine or at least a custom mesh generator; if you are placing separate objects in a general-purpose engine it may not be achievable.

  • If two identically-themed modules are joining, then you can have them just overlap each other a bit — as long as the surfaces have the exact same texture at the exact same position (you'll need a texture designed for repeating), there will technically be Z-fighting but it won't be visible.

  • You can provide some kind of geometric feature to cover up seams. In real-world buildings, molding serves this function — small strips that cover up the joint between two flat surfaces that aren't perfectly identical or perfectly fitted to each other.

    Molding can also help create transitions between different styles of modules — it won't hurt for its models to intersect the walls. Similarly, a doorway in a wall is especially good at covering up such a transition — the modules on each sides of the door will slightly intersect the wall to ensure there are no gaps.

    I'm calling this stuff molding because the real-world function matches, but you don't have to limit yourself to the possibilities of real-world materials or ones that are intended for this purpose. Any object that can cover up the gap will work. Columns/pillars are also “molding” for this purpose.

  • If you don't want visible molding and the textures won't match perfectly, then you could design intersecting flanges into each part:

    Each of two surfaces meeting has a small sloped part that intersects the other

    The flanges' vertices should have the same normal as the rest of the surface so they are lit the same, not like an actual groove. The angle at which they cross should be sufficiently far from parallel to avoid Z-fighting. But no matter what, you will still have a somewhat visible seam as long as the textures don't match; the human eye is good at picking out borders where patterns change. This might be a good choice if you are intending to render “this part of the walls was intentionally painted a different color”, for example.

  • In a dimly lit, or cartoon, scene you can have the junction between modules just disappear into darkness — make flanges or overlaps as above, but make the texture shade into pure black at the edge. Then it doesn't matter exactly how the geometry meets (as long as there isn't a gap) because pure black cannot reveal any details.

In any of these cases where the module is slightly large on purpose, make sure to choose a grid size, a standard length, and make sure that the modules are bigger than that by the intended overlap amount. Don't build a module of exactly a certain length and then fudge how you position them.

How to deal with the edges of those elements? Take the wall panel, should it be a polygon (no thickness) or a solid block?

Depends on your style.

  • If your game takes place entirely or mostly indoors, then leaving out back-sides will be efficient to render and allow you to easily have walls that have different styles on their two sides.

  • If it is possible to get an outside view of the walls, such as in an open-topped “hedge maze” or a destroyed building, then you'll need those back sides.

In some cases it might make sense to build both — you could perhaps make double-sided walls (modeling them as solid physical objects), and then make a copy which has the back side deleted.

\$\endgroup\$
1
  • \$\begingroup\$ Hey Kevin, thanks for the great answer!!!! I am planning to make a few levels that are 100% indoors and have no outside view. I am already using pillars and other objects to cover some seams, but need some to be clean. I like the intersecting flanges and I'll give it a try. Thanks!!! \$\endgroup\$
    – V S Vuca
    Aug 4, 2023 at 5:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .