Advice needed on dungeon building.

I need some advice on which is the best way to handle building the dungeon for my RPG project.
You can get some background about the project from my blog here.

Right now I’m using prefabs* for my dungeon, they have a north south east and west section for each “room”:

The basic tileset.

  • A prefab is a ready made room, or room part. They can be combined together by code in the right combination to create open or closed rooms, with or without doors or transitions.

This has several advantages, and also several disadvantages. Firstly I can have curved rooms, I can have tunnels and other interesting shapes. The tilesets can look quite nice with a little work. On the other hand I can’t easily get the navigation data before building the map and once the map has been built I can’t make changes to the layout, like having active pit traps or believable secret doors. Although the rooms are interesting, they are quite repetitive, and it takes a lot of effort to make even a few different variations. Also rooms are constrained to one size.

A newer version of the tileset with a lot of variant parts for making more interesting rooms.

To create a tile set is a real headache too. Planning how to lay out the UVs, trying to cram as much detail in to one set as possible so there can be a lot of variations… it takes days to make a single tile set, and I need dozens. :frowning:

One other approach I’ve thought about is making the maps completely tile based, just like a traditional roguelike.

A tile based floor.

In this case I’ll be able to make the base tilesets very easily, and quickly. We can’t have as many different room shapes, so different tile sets are going to be mostly differentiated by their color and textures. It’s a bit old fashioned, which is sometimes something that I like, but not always.

A different texture.

There is more scope for creating more shapes and room types in the dungeon builder itself. I can have small rooms and big rooms. Size 1 corridors as well as larger sizes. I can make mazes and other interesting constructions, I can make catacombs and caves.

The downside is that the textures can be quite repetitive. A lot of texture real estate is taken up with very similar visual structures.

Other points for and against:

  • Prefabs can have interesting features such as alcoves or shelves built in to the wall.
  • Tiles can make interesting floor structures such as irregular pits and grilles.
  • Prefabs can have more interesting entrance and exit stairs.
  • Prefabs can mix and match tilesets withing the same map.
  • Tiles can mix and match tilesets easily withing the same room.
  • Tile based dungeons are less predictable.
  • Tile based dungeons can have dynamic features such as working pits or tunnel-able walls.
  • I know how to handle the tilebased graphics because I’ve already used them in another project.
  • Prefabs are already in the game and working well.
  • With a tile based game I can build the navigation array before placing any objects in the scene.
  • Prefabs require support pillars at the corner of each room.
  • Tile based graphics don’t, they can have really large rooms without any visible support.
  • Theoretically I have code for different sized prefabs. Either 10x10 rooms as I have now or any other size, such as 6x6 or 20x20 or 100x100 which would allow large set pieces such as caverns or houses or castles or even boats or airships…

So what do you think?

Should I continue with the more modern prefab idea, or go back to basics with a traditional tile based dungeon?

Wow, your assets look just godlike! Very handy for building dungeons, you might want to list them on some 3D asset store :slight_smile:

I think you have all the experience and oversight to take a best educated decision on which system to use. I like the prefab structure a lot because mix-matching different pieces gives you so much expression and many options to avoid repetition.

I know you hate the fact that you can’t automate something like navigation data but maybe that’s not the most important thing. You’re going to need to manually place some NPC characters, items, etc. anyway as part of the level design (right?) and I see navmesh/custom trigger building as natural part of that. If there are some shortcomings in your current prefab system bottlenecking your expression I’d rather see you work on fixing them by expanding your code rather than start from scratch with the tile system.

This looks really good!

Should I continue with the more modern prefab idea, or go back to basics with a traditional tile based dungeon?

Ends justify means. Whichever works best in the limited time frame is the chosen one. You are the teacher, i’m just a student, your choice!:smiley:

Read this article -
It answers all your questions, and more :slight_smile:

in answer to the poll, why not both!

As far as I understand, tile-based is a subset of prefab. You pre-fab a complete room.

I do not think this is somehow exclusive. You can do both.

But I might be wrong with that.

The article was very interesting, I hadn’t read it before, but somehow ended up doing a lot of what they suggested simply from my own experience. Although I wish I’d seen it earlier, it would have saved about 6 weeks of trial and error. :slight_smile:

So when you’re trying to identify somebody with the the aptitude and interest to be a great kit artist, you’re basically looking for a unicorn. They’re rare.

I like that quote. One reason prefabs (or kits as they call them) are time consuming is that you have to get them just right. If you have the ability to use huge textures it’s not so bad, but with Blender you have to stick to quite modest sizes, that means making full use of every part of the UV sheet. Trying to work out in your head how everything snaps together is a nightmare. it drives me crazy.

It gets even more frustrating when you’re working on a procedurally generated game. With a hand designed level you can avoid putting things together in a way that doesn’t look good. But with random generation of levels you have to think about how you will write the rules for parts snapping together and what can and can’t join up. I can heartily second their recommendation that you should spend time on the gray box stage where you’re using a dummy version of the kit. it saves you wasting time on a kit that doesn’t work later.

It’s one of the main things making me want to switch to a tile based graphics set. I’m not a unicorn sadly, and it’s not something I really enjoy working on that much. The end result is great, but I always end up seeing all the little points which look out of place or don’t match up, or are too symmetrical and it drives me nuts one more time. :slight_smile:

Really the actual navigation isn’t an issue, I’ve got code for that either using prefabs or tiles, though it’d be nice to be able to build the levels in the background while you’re setting up the game and generate the navigation data then. From that point I have a nice script for loading the level by chunks, so you can start playing without any waiting time, but I can’t use it because the navigation data is not complete until the level is loaded.

Oh well.

I have thought about using both systems, it would require an extra level building script, but I don’t think it’d be too difficult. It’d be really difficult to mix and match the two systems in the same map though. I’d have to put in some level building logic to choose whether to use the prefab code or the tile based code for each level and then stick to that for the whole level of the dungeon.

It depends on the rules for generating a level. I have a room based generator which generates rooms and corridors. Those rooms and corridors are prefabricated objects, they can be combined in a number of ways, but it is limited. Both rooms and corridors have a 10x10 (or some other number) footprint. This helps save time when generating the level as I’m working to populate a 20x20 grid, rather than a 200x200 grid. But the results can be a little repetitive.

I’ve worked with tile based generators before too, they use rules to generate either open or wall tiles and then place a graphical representation of that tile where it’s needed. Tiles could be one square in size, or they could be 2x2 or 4x4 or whatever. They can create much more granular and detailed levels, but everything is made of tiles. You can’t have any curved or angled sections. You can’t have round rooms or sloping tunnel walls. It looks very inorganic. It uses the same placement rules as a 2d sprite based terrain placement. So it can look quite good from a 2d perspective, but doesn’t look nearly as good when viewed from 3d angles.

Here’s an example of the 2d tile based placement rules in action:

If you do it well the tiles match up seamlessly and the result is quite pleasant.

Each tile is checked to see what kind of tile it is.
Is it a wall or a floor tile? You can only ask one question at a time but you can have multiple layers of spites with alpha.
Next the same check is carried out on the 3 tiles to the north, northeast and east of this tile. This returns a 4 part binary code, for example 0000 is an ocean tile with no adjacent land while 0110 has land to the north and northeast.

You can use this binary code to get a tile such as ocean0110 and place it. You’ll have to offset it by 50% of a square though so that the final result makes sense visually.

Doing the same in 3d is much more difficult. You have to do multiple checks and place multiple objects.
For example:

In this case the current tile is a floor tile. The north tile is a door tile, the north east tile is a wall tile and the eastern tile is a door tile too.
Checking for walls would return 0010 while checking for doors would return 0101.
You’d have to place the WALL0010 tile and then place the DOOR0101 tile.

The neighboring square would fill in the gaps, with the southern tile returning 0001/0010 and so on.

On the other hand with room based prefabs I’m checking the north, east, south and west rooms (a room is a set of 10x10 tiles in this case) to see if they are also rooms or if they are solid rock or if they are in the list of rooms which can transition in to this room type or if they are one which requires a door.

That returns a list like this: TTDW,
Then I use that to get four quadrants which would be something like this:

where “R” is rock or whatever type of room you have in that square, “P” for pit etc…

It would be very difficult to match these two systems together in the same level.
Difficult but not impossible.

what about “Punch outs”

basically a set of rooms, with pieces that can be deleted to open a spot for a door, or bookshelf or?

for each room and asset style, have possible connectors/fillers?