jchase1970 Posted November 18, 2010 Share Posted November 18, 2010 Here's how I went about it, I picked 6 spots for rooms to appear around. That gave me 10 paths to those 6 possible rooms which are also the path intersections. I then randomly picked paths for each intersection to connect to another intersection. remembering if they link to intersection 1 or not. I then gave each room a random possibility of 50% to be there or not. so you may have no rooms or you may have 6 rooms or anything in between. The math for room placements randomly offsets the room location 0 to +-2 places. This lets the rooms be out of alignment and look less like they are tied to the 6 locations. The last thing was to pick exit locations. A few easy changes can do alot, you can make it like maze man and generate a series of mazes but storing the random seed value for each maze. Then knowing how you want these to connect you can have it not randomly put the start and exit paths in but use a calculation to have them in a linking pattern. Like wise it would be easy to add random stairs at the intersections for linking levels in a 3d fashion. These stairs would have to be stored somehow so a matching stairs is on the maze it leads to. An array would be the easiest thing to do this with. I had a few errors so be sure and use the bug fixes in the second post. I Ran it with the fixes and it looks almost right. I had 1 dungeon pop up with the far right 2 intersections not accessible, I think I know why, but not to worried about it now. Think I'm going to go get some sleep Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.