VIDEO / 30 JUN 2017

(Unity) Random dungeon floor generator

Took me way too long to get this working.

It uses 3 sprites: A floor (white square), a wall (gray square distorted to be a rectangle), and an L shape for the coridors (3 gray squares). My biggest problem was figuring out that I had to account for every possibility before using RNG and only use RNG if it's absolutely sure it doesn't matter if there is a wall or coridor.

8

Ben S

12

Roody I - 3 weeks ago

RNG...we meet again. But this is cool. I dn't tell much people this but I like probability/math/RNG stuff. This is very cool.

How did you have to account for every possibility? How much possibilities are there in total?

 
8

Ben S - 3 weeks ago

https://pastebin.com/Y0gPDQDQ here's the for loop that does the basic decision making. Hope it makes enough sense lol

 
 
8

Ben S @Bob423 - 3 weeks ago

The "Must go through a second time later to close previously made coridors" is actually wrong. I got it working without that and forgot to remove the comment lol.

 
 
12

Roody I @Bob423 - 2 weeks ago

Nothing makes sense to me anymore... 

Seriously though, I understand a tidbit of it. Enough for me to know what's going on. Very cool. I wish I could code. :/

 
{?global_avatar?}
You must login to comment.