2021-12-05

Procedural randomized dungeon generation (c#/unity)

I have a problem, I spent a lot of time trying to come up with an algorithm that would do the following: First, we have some kind of grid containing NxN cells. Each of these cells can be ground or wall. Our task is to arrange the walls so that there is a certain number of rooms, M rooms in a row and M rooms in a column. The room is a rectangle of ground bounded by walls. The size of each room (its interior or ground part) must be less than some UxU and greater than YxY. It should be possible to create a path of at least Y width between adjacent rooms. The next additional condition is that two adjacent rooms must be of different sizes. So, the goal is to create some kind of interesting dungeon that will look as diverse as possible. In the screenshot below you can see an example of good generation when N = 13, M = 3, U = 4 and Y = 2 (U and Y can be constants). It would be nice to get a list of the walls between the individual adjacent rooms.

Example of generation



from Recent Questions - Stack Overflow https://ift.tt/3EovKXK
https://ift.tt/eA8V8J

No comments:

Post a Comment