Map Creation for a 3D Grid-Based Dungeon Crawler

Godot Version

4.3

Question

Hello, I am a hobbyist game dev (with little Godot experience, but a few years of professional coding experience) working on a 3D dungeon crawler. Having developed the combat system, I’m looking to actually create the levels for my game. I would like help figuring out what might the best way to create maps is.

For aesthetic reasons and developmental constraints, the game will be entirely sprite based. Movement will be similar to the likes of Dungeon Master and Eye of the Beholder, with the difference being my game will take place in a 3D grid of cubes and not a 2D grid of squares. Rather than dungeon floors, players will explore “zones”.

To create these zones, I want to build them from what I’m calling “tile-cubes”. Is there a way to make a scene that represents a single tile-cube, where:

  • Each face can have a different texture on the inside of the cube
  • Tile-cubes “snap” to each other in the editor
  • Each tile-cube knows it’s orthogonally adjacent neighbors

I am open to other ideas. I know there is a GridMap node, but I’ve heard people don’t have much luck with it. I know a 3D array can be made and each index can be individually programmed with which direction the player can move, but that sounds extraordinarily tedious, I would like to make use of tools available in 2024.

Thank you in advance, and I can elaborate if needed. I’m looking forward to getting involved with the Godot community.

1 Like

I tried gridmaps and found them pretty useful, but really, I found I could do them easier in blender and I wasn’t confined to not making changes. I would at least try gridmaps out. You still need to make the cubes in blender or some modeler.

For me, the only drawback of a gridmap is that you can’t attach scripts to the cells that make it up, so a light source or a trap must be instantiated separately and can’t be part of the gridmap. This leads me to create scenarios without gridmaps. On large maps the gridmap is supposed to be more efficient, but my scenarios are really small.
I saw a lot of tutorials on yt where people create small rooms with gridmaps and then go around instancing them and making the doors match.

Thanks for the info. Ideally, I use the gridmap just to make sure my levels are aligned. What I really just need I think is a better understanding of how to make a scene. I want to keep the structure of the game simple, with three basic scenes I build the game with, Tiles, Characters, Items.

I need to figure out how to make the base Tile scene. If I can change the texture of each face, define whether each side is a wall/door/open, etc then I can copy a Dungeon-North-Wall, for example, scene and paint it over the grid map to quickly draw levels.

you don’t need a gridmap, just make the areas an even size and ensure the entrances can connect.
in the editor you can hold Ctrl to snap the Node3D to the world when translating.

are you trying to generate levels in game or in editor? because if this is for editor you are wasting your time, just do it.

for generated levels, use scenes containing rooms or corridors, the rest depends on code. if your rooms are perfect squares you can place entrances in 4 directions or more, for something more complicated you need more “layers” because there’s going to be more combinations.
you need to make an Excel spreadsheet with the combinations so you can assign each direction and additional entrance positions a number, these are power of 2 (1, 2, 4, 8, 16) so they can be used in a bitmask.
so if there’s a north entrance and west entrance the tile would have the value 3 (1 + 2).
it is a very common technique, but you need to write the algorithms to fit the style of rooms you are trying to make for your game. It is too complex for me to explain in few words, you can look it up, it’s called tile bitmasking.

1 Like

The level will be made in the editor, yes.

My game is going to operate largely like a board game, where movement is from Tile to Tile, one per round. The game will be in first person. Tiles can have objects (things like levers or items) and can be occupied by a Player or an Enemy, but not both. All distance will be measured in Tiles. I want to be able to adjust the properties (pixel art texture, whether it has a door, as examples) of each wall individually. A major part of the game logic is the direction (North, South, East, West) the Player is facing. I thought it would speed up the creation of the maps if I had a scene that was defined as a Tile, then, for example, I could save a Tile scene I configured to have a western wall with Dungeon-Tile-Stone-Wall and Dungeon-Tile-Stone-Floor and just quickly drop those in, rather than place a ton of empty Tiles, then individually configure all the walls.

Pardon me if I’m not explaining myself well, but I can go deeper into how I want my game to work if that will help.

Looking more into it, it looks like I am over-complicating things for myself. Tiles can just be an invisible collision box that know if something is in it, because it will be colliding with it. Walls and floors will be 3D Sprites with collision added.

1 Like

Each tile needs its own CollisionShape3d and MeshInstance3d. After you have all the tiles ready, you need to create a library and add it to your gridmap. Another approach is to make the whole gridmap collision-free (whitoud CollisionShape3d) and then add a NavigationRegion3d, but it works differently.
In my case I use 2 gridmaps:

  • floor (size 0.5 x 0.5),
  • walls (size 2.5 x 0.5),
    because my walls have different size.
1 Like