4 ms·
This algorithm is relatively well known. If I read right, the author is just implementing an older algorithm but switching the order of two steps for efficiency
by ggggtez 7y ago
This algorithm is relatively well known. If I read right, the author is just implementing an older algorithm but switching the order of two steps for efficiency reasons.
No it never generates crossroads. Despite saying the maze can be imperfect, I think they are wrong. Anyway, it's kind of boring as maze generators go. For example, in the 1980's, the first edition of D&D included a simple maze generator (i.e. pen and paper algorithm) that could generate dungeons like this one.
- munificent 7y ago> If I read right, the author is just implementing an older algorithm but switching the order of two steps for efficiency reasons. That's right. > No it never generates crossroads. It can, but they're rare. It would be an easy tweak to make them more common. > Despite saying the maze can be imperfect, I think they are wrong. It always generates imperfect mazes. The code that does that is: https://github.com/munificent/hauberk/blob/db360d9efa714efb6d937c31953ef849c7394a39/lib/src/content/dungeon.dart#L239-L241 https://github.com/munificent/hauberk/blob/db360d9efa714efb6... Basically, it removes all connections between regions that are already connected. Except there's a finite chance it will keep the connection even when the two regions are already connected. In other words, it adds known cycles. > Anyway, it's kind of boring as maze generators go. Yeah, it does produce sort of same-y results. I'm not currently using it because of that. But I also intend to reintroduce it back as one of the multiple algorithms my game uses since it can now mix algorithms together. If every dungeon used this style, I think it gets boring. But when you only occasionally run into a part of the dungeon like this, I think the very same predictability gives it a nice distinct flavor.