Tag Archives: dungeon

Dungeon walls, props and more for catacomb, prisons and general dungeon locations

Obviously my main inspiration is Diablo and Diablo 2, but I want to do some things I liked in Baldur’s Gate, Temple of Elemental Evil and Arcanum (even some Torment).

I have been playing between pre-rendered and full 3d for a while trying to figure out what to do and I have decided I am going full 3d, with an almost isometric perspective, because the amount of new tech (shaders mostly) I would need to make to achieve the result I wanted was too much – especially since I am both programming and making the art for this (and the writing and some of the voices).

A few months ago experiments in dungeon generation were successful, so I’m going to have random and custom dungeons and a dungeon builder in the game that will be easily shareable by the community.

Anyway now that I have a more defined set of requirements for art I am moving ahead with building props and level tiles, rigging my characters and making demo environments to test it all in.

Dungeon Level Generation from image in Unity

I was thinking about Dungeons and dungeon generation and also about how to give players the ability to make their own Dungeons and share them with each other.

Well a map can be saved as a 2D matrix, I have even done it with a list of values or 1D matrix.

Here you can see an example I made for a platformer, using a 1D matrix to make square levels (you can edit the level during runtime, play it, save it and load it):

But how does someone edit, share and transfer those easily? How could I make a quick editor or even edit maps outside the game? How could I send new maps to my players fast and make sure they don’t break the game no matter the version?

Well an image is a matrix and we can have RGBA info, so we can hold multiple values in one image for one map and also edit and also transfer them easily.

What do we see here:
This is basically a couple of hours worth of work as a proof of concept.

I made a script that takes an image as input, identifies what each pixel represents and instantiates it. It makes levels of arbitrary sizes, it can spawn empty, floors, walls, columns, enemies and the player.

I also wanted to be able to make sure to use NavMesh and even though Unity is going to add runtime generation in 2017, this was done to prove that if you don’t fight Unity you can even do things it’s not supposed to do.

So the enemies have a NavMesh Agent and the NavMesh is carved using NavMesh Obstacles and as you can see from the delayed generation mode below they can follow you upon spawning even if the level hasn’t finished yet.

I added a delayed generation version because generation was so fast I couldn’t see my work in action, it was hit play, see level, so I put my code in a coroutine and added a small delay to see things being built.

What will I do with this:
I don’t think I am going to use it for Dominus Infernus, I have another game idea it might be more useful for, since in Dominus Infernus I want a higher standard of graphics, which will be achieved using 3D pre-rendered backgrounds.