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.

9

Ben S

14

Roody I - 4 months 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?

 
9

Ben S - 4 months ago

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

 
 
9

Ben S @Bob423 - 4 months 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.

 
 
14

Roody I @Bob423 - 4 months 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.