Procedurally Generated Maps?
Posted: Mon Nov 28, 2011 2:39 am
I was seeing if I could do this for a game, just so I wouldn't have to design a bunch of levels and there still could be a lot of content. However, it doesn't seem to work so well since it's rather hard to make a random map and then connect all the rooms. Say I have an array "map" that is 25x25. In it, 0 is ground and 1 is a wall, if the floor is randomly generated and then checked. If the floor has 6 or more adjacent walls, then it will become a wall. If it has 3 or fewer than it will become floor. If it has 4 or 5 than it and all its neighbors will be floor. How would I go about making all the "rooms" that were generated connected?
Here's a small .exe that shows what I've got. It has a lot of holes and problems though...
EDIT: Nevermind, I read an article about this that was made for rouge based games. It helped a ton.
http://roguebasin.roguelikedevelopment. ... ike_Levels
Mine doesn't work as good as the examples he shows, but it works!
Here's a small .exe that shows what I've got. It has a lot of holes and problems though...
EDIT: Nevermind, I read an article about this that was made for rouge based games. It helped a ton.
http://roguebasin.roguelikedevelopment. ... ike_Levels
Mine doesn't work as good as the examples he shows, but it works!