Best practices for creating 3D dungeons (interiors)?

I’ve been researching methods for creating 3D dungeons aka interiors and have found that there are at least two ways of doing things. I’m therefore wondering which is best for CGE.

“Daggerfall” method: Dungeons are created from several basic 3D shapes for rooms, corridors and junctions that the player moves around inside. These shapes are textured on the inside only by reversing the normals and culling the back faces.

The walls are 2D planes rather than 3D objects.

“Lego” method: Dungeons are created using solid 3D objects that are put together like building blocks that the player moves around the outside of. These objects are textured on the outside only and the back faces are culled.

Many modular dungeon kits seem to favour this method.

Is either one of these options better suited for the way CGE handles 3D scenes etc.?

As far as CGE goes, both methods are feasible. In both cases for CGE (as for any general-purpose 3D rendering library) what you have is just a set of meshes (number of polygons) with backface culling (where the “back face” is whatever you tell the engine, by orienting the normal vectors as you wish).

For a general 3D application/game, what you would do is just to model the environment (either interior or exterior or both, whatever the player may see) in a 3D application as a set of polygons. So it’s the “Daggerfall” method in general, with occasional assets put together from large pieces (e.g. make a castle from assets of “castle wall”, “castle tower”, “gate” etc.) just because it is often easier to put together a large 3D environment this way.

In case of a dungeon, it depends on what you want :slight_smile:

In a way, both “Daggerfall” and “lego” (I understand you see it like Minecraft) methods are about the same, you just use “bricks” of different size :slight_smile: Your “brick” in “Daggerfall” is “a room with connections”, your “brick” in Minecraft is a like a literal brick, which is part of the wall, and the wall is part of the room.

  • “Daggerfall” method means you sit in Blender, and can design nice rooms. Then you have a lot of modules that you can connect in various ways (as many as you can model – lets say ~100 if you spend a lot of time). I would choose this method, as I have some experience working as a 3D artist (I’m not an artist, but I can use Blender and I was even teaching Blender a few times, and I can create some things in Blender given enough time), and it gives me control to make some impressive modules (like a sudden huge cave interconnecting some rooms, or a sudden outdoor vista in a dungeon).

    Another advantage is that “procedural generation” then is easy.

    The disadvantage is that you don’t get gazillion combinations. If you want to do incredible things by procedural generation, and be amazed at what your own algorithm creates – it’s going to be harder, as you have large “predesigned modules” and the only freedom is in what combination you show these modules.

  • “Lego bricks” (Minecraft) method means you get to write a lot of cool procedural generation algorithms.

    I mean, it doesn’t make sense to use the “lego bricks” approach manually (e.g. arranging the literal bricks in Blender) – that is an unoptimal and limiting approach to 3D modelling. So this approach only makes sense IMHO if you want to employ procedural generation to arrange these bricks in some nice way to create lots of combinations.

    The advantage is that your number of possible combinations grows. Immediately you can generate rooms of varying sizes.

    But if you want to apply it to everything, then you will have much more work to do. You want a cave? Then write an algorithm that generates a cave from bricks. It will take you much longer than it takes me to make a 3D cave in Blender :slight_smile: But then, I will make one impressive cave. You will make a machine to generate an infinite number of caves. So these are really 2 very different tasks.

    Optimization also matters in this case. Although, depends on size (size of the whole dungeon, size of the single brick). You may want to “connect” the bricks after procedural generation is done, to avoid rendering a lot of “inside” walls between bricks that never have a change to render, and to render larger “batches” of bricks (DynamicBatching may also help here).

    In contrast, in “Daggerfall” method, there’s not much optimization needed, assuming that 3D artist did a good low-poly job of making the modules. You of course should use frustum culling and for really large dungeons using Scene.RenderOptions.OcclusionSort will be beneficial or even Scene.RenderOptions.OcclusionQuery.

1 Like

I probably should have used the word “block” instead of “brick” as I didn’t really mean something the size of a house brick.

In the “lego” method, I was thinking that each square of the dungeon would have a floor block with zero to four wall blocks around it, plus a ceiling block on top. I would probably create modular prefabs from different combinations of these pieces, so that there would be less assembly required.

The “Daggerfall” method looks to be easier for simple corridors and rooms, but I can see it getting complicated when it comes to doors into rooms next to corridors. I’d need to place each side of the wall (and any ends that showed) separately if each side had zero thickness.

I also remember that in the game Daggerfall, the player was prone to falling through the joins between dungeon pieces. I’m not sure if that was due to floating point errors or bad collision detection, but it was annoying.

The “lego” method would likely take longer to create individual corridors, but I can see doors through walls being easier to assemble with solid blocks.

As you mentioned, there would be some faces that would never be seen though. I suppose that creating wall sections in multiple lengths would reduce that problem. i.e. have 1, 2, 3 and 4 metre long wall blocks instead of making everything from 1 metre blocks.

If you’re asking that in context of Dungeon Crawler Jam 2021, then note, that making a proper tileset of either “rooms” or “blocks” takes a hell of a time (I’ve spent around 1 month making library tileset for Mazer). It might be a good idea to go much, much simpler, as in Duungeon example I’ve posted some time before (video Where you just generate a map on a rectagonal grid (making it a simple generation algorithm) plus makes the design of “tiles” much easier - they can be as simple as textured boxes:
Yesterday I was just absolutely impressed by artstile of Pencil Dungeon by Generalis

I was intending to create my own modular dungeon kit before the game jam starts and then put the pieces together during the jam. That wouldn’t be against the rules, as some people intend to use ready made asset kits of various types and/or engines specifically made for creating RPGs.

Keeping it simple would definitely be a good idea, considering my lack of experience and limited time. I was thinking along the lines of Might and Magic I to V or Eye of the Beholder, although they were created in 2D.

I just started playing The Deep Paths: Labyrinth of Andokost as inspiration, and it seems a little more detailed than what I will be aiming for.

1 Like

Try Anvil of Dawn for inspiration (4 USD for a 1995 game?! With the developers disbanded in 2001. They’re joking, right? Ah, looking at a longplay on Youtube is enough - the game fails contemporary gaming standards anyway). I guess that level of detail is perfect.

That looks more hand drawn than I would likely attempt (I’m not an artist).

This low poly dungeon kit is closer to my skill level, although it’s intended for top down games.

It’s also quite close to what I meant by “lego” method. Ignore the outdoor pieces, as I’ll likely only create indoor areas to keep it simple.

I also found a video on Daggerfall Unity dungeon construction at Youtube and a modular environment building course at Udemy. The latter isn’t free, but you should be able to get the gist of the method by watching the previews.