Article View: rec.games.programmer
Article #473Re: WANTED : Maze Algorithm extension
From: KIENENBERGER MIKE L
Date: Fri, 07 Aug 1992 08:12
Date: Fri, 07 Aug 1992 08:12
32 lines
2189 bytes
2189 bytes
In article <1992Aug6.225108.572@ccu1.aukuni.ac.nz>, rossw@ccu1.aukuni.ac.nz (Ross Williamson) writes... >I also want every possible room to be connected ...... >And I don't want to enter the maze from one point and exit at another >I just need it so that it generates a set of connections between all >rooms :( it's a bit of a dog but it's something I need to solve. Well, a decent algorithm for which I can take no credit follows. - Mark all of the squares in the maze as unused. - Start at any square in the maze. - Record all possible unused maze squares around the square (referred hereafter as possible next squares.) - While there are still unused maze squares: - Randomly choose one of the possible next squares. - Mark it used. - Connect it with the currently used squares next to it. - Add adjacent unconnected squares to the possible next square list. Different maze types can be generated by fiddling with the connection target and possibly with the next random target. While I've not gotten around to playing with this algorithm yet, I've seen it used, and it works fine. Credit for this algorithm goes to Scott Berry (FXSDB@acad3.alaska.edu) who pointed it out to me when I thought I needed something similar. Whether he had the genius to steal it from someone else, or just created it himself, I cannot say. ============================================================================= -Mike Kienenberger SXMLK@ALASKA (BITNet) University of Alaska Computer Network SXMLK@acad3.alaska.edu (Internet) University of Alaska-Fairbanks
Technical Details
Message-ID:
<7AUG199200120920@acad3.alaska.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!ames!bionet!raven.alaska.edu!acad3.alaska.edu!sxmlkReferences:
<1992Aug6.225108.572@ccu1.aukuni.ac.nz>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!ames!bionet!raven.alaska.edu!acad3.alaska.edu!sxmlk From: sxmlk@acad3.alaska.edu (KIENENBERGER MIKE L) Newsgroups: rec.games.programmer Subject: Re: WANTED : Maze Algorithm extension Message-ID: <7AUG199200120920@acad3.alaska.edu> Date: 7 Aug 92 08:12:00 GMT References: <1992Aug6.225108.572@ccu1.aukuni.ac.nz> Sender: news@raven.alaska.edu (USENET News System) Organization: University of Alaska - Fairbanks Lines: 32 News-Software: VAX/VMS VNEWS 1.41.UAC Nntp-Posting-Host: acad3.alaska.edu