Having Trouble Making Dungeon Generator

I am trying to make a 3D co-op game using unity. I need to make a random dungeon generator and I have been following this tutorial from Blackthronprod. I am having a bit problem with the walls closing the door entrances. I made a wall destroyer to each door gap in the rooms but now every room has too many openings and its not what I really intended. Should I keep going or change the method I am currently following? I need help asap.
(Haven’t add any corridors would it make it more maze-like?)

[https://www.youtube.com/watch?v=qAf9axsyijY&t=2s]
[https://www.youtube.com/watch?v=eR74EjkA\_4s&t=306s]
[https://www.youtube.com/watch?v=CUdKdHmT8xA]

There are a couple of things to note. Not that the age has anything major to do with the basics but the tutorial is 7 years old. Did you follow the tutorial and/or download the code from GitHub? And which version of Unity are you using?

As for advice I have to assume that it works there are messages that imply that it does. So I will suggest that you make certain that you understand each of the classes supplied and obviously make certain that it builds without issue.

If some part isn’t working quite to your liking consider experimenting but not just “guessing”. If you don’t quite understand what some part of the code does, analyze it, maybe even step through the code and add comments to your source to help you remember.

The project doesn’t look to be very large or tricky so it is probably a good example to follow.

Unless you’re trying to build exactly what a video shows without any modifications, the only advice I can give is that a random dungeon generator, especially a fully procedural one, is extremely advanced, time-consuming, high-level work in game development. Don’t assume you can start with one from a video and simply adapt it to your needs. It’s nowhere near that simple.

This applies to most procedural systems, but dungeon generation in particular draws on theory that extends well beyond gamedev. In practice, we only use a subset of that theory, and it still requires specialized knowledge from several mathematical fields, including random number generation, geometry, and graph theory. To build a generator like this, you need to understand topics such as non-default random number distributions (the default RNG is nowhere near sufficient), methods like the Park–Miller random number generator, geometric techniques like Delaunay triangulation, graph-theory concepts such as Minimum spanning trees, and various graph types and their properties (for example, the Gabriel graph or the Relative neighborhood graph).

All of this is necessary because generating dungeons that are interesting but not trivial, and structured but not maze like, is extremely difficult. Generating non overlapping rooms of varying sizes is only half the work. Connecting them in meaningful ways and creating loops without producing a confusing maze is the other half.

In short, creating a random dungeon generator is a full project on its own, one that will likely take more time than finishing a simple game. I don’t think a video tutorial (or even ten of them) can teach this effectively. So here are your two practical options:

  1. If you need something quickly, buy an asset or find an existing generator on GitHub that does roughly what you need.
  2. If you have a couple of months to dedicate to this, study open-source games that implement procedural dungeon generation, read their code, and adapt it to your use case. There are many good examples on GitHub, such as https://github.com/watabou/pixel-dungeon. It’s written in Java, but the technical details are straightforward, if you can read C# you probably can read Java as well, the real complexity lies in the algorithms themselves.

Anything else, like trying to build your own system after a few videos, modifying a system from a tutorial, or trying to study the underlying theory from scratch, is a waste of time. The first two won’t give you enough knowledge to create a system correctly and the second will sink far more time into learning procedural generation than into actually making a game.

Yeah, procgen is awesome sauce, super fun to work on, I absolutely love it.

But it has a steep learning curve because you’re trying to anticipate all possible ways something can go wrong in advance, detect those wrongnesses, and then adjust.

As such you will need to bring your Top Shelf Grade A Debugging Game with you to have even the slightest chance of success in procgen.

Procgen is a bit like building a machine in your kitchen that can make complete meals and serve them to you in the dining room.

Procedural Generation (procgen) and iterative thinking, building up in tiny micro-increments:

I was trying to make it more like Lethal Company. I want to give player that feeling of exploration.

I made a wall destroyer to each door gap in the rooms but now every room has too many openings and its not what I really intended

Like I said right here I tried to do something about the problem and it didnt work out like I thought it would.

If you need something quickly, buy an asset or find an existing generator on GitHub that does roughly what you need

I looked at some assets on the store and most of them expensive for my budget.

This one I come across is alright for me but I am not sure if this what I am trying to do.
I wanna do it with some rooms and corridors randomly generated. But this asset just uses walls and floors or so I understand.

And there is this one which is totally free

But it is the same reason I havent tried it.

If you guys have any other suggestions for me like tutorials or some other way I am open to it. I am new to this deep-coding systems I am sorry if I am giving a headache

Like dancing and any gamedev, procgen is only learned by doing it.

Your challenge is to do things that are within your reach and then continually expand your reach.

A generic dungeon generator is akin to making a space shuttle as your first airplane. It’s HUGE and complex.

If you insist on a dungeon generator, make something simple like a maze. Plenty of maze generator algorithms out there, just google.

But get a maze working 100% and understand how it works.

But even mazes are complex: is it a maze of cells, blocked and unblocked? Or is it empty cells with walls? MAKE BOTH! They are completely and utterly different problems and will require different generator algorithms.

Then build upon it, such as a maze that has open rooms “stamped into” the maze pattern. That might be your next challenge after a maze.

When you reach for an asset, free or paid, be sure you understand what the asset brings to the table:

  • nice looking art?
  • an algorithm?
  • something elese?

Like I said, ALL will be learned by doing doing doing doing.

Imphenzia: How Did I Learn To Make Games: