Previous Blog Next Blog
Prev/Next Blog
by date

Random maps

Random maps
Name:John Coyne 
Date Posted:Jun 24, 2008
Rating:4.0 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for John Coyne

Blog post
I thought I'd take a break from bubble choo choo's and try a spot of 3d. The results are the beginnings of a random urban map generator, here is a screen:



Obviously my next task will be to put little houses in most of the blank concrete parts.

Recent Blog Posts
List:06/24/08 - Random maps
06/17/08 - Another Bubble Choo Choos update
04/18/08 - Bubble Choo Choo's update
04/11/08 - Bubble Choo Choo's
04/26/06 - Balloon Slide
04/08/06 - GID j
09/17/05 - Plan for John Coyne

Submit ResourceSubmit your own resources!

Orion Elenzil   (Jun 24, 2008 at 15:57 GMT)
looks cool; how's it work ?

John Coyne   (Jun 24, 2008 at 16:42 GMT)   Resource Rating: 5
It uses 3d tiles pulled from a 2d array (not really a 2d array, but its the best way to explain it).

The most important part is a recursive method, it takes upper and lower x/y variables which it uses to manipulate the entire array or just parts of it, it goes something like this:


1. find the center of the whole map
2. add/delete a small random variable from this, so we are randomly off center
3. from this off center position, draw north, south, east and west roads, splitting the map into 4 (if you were to stop at this point, it would look a bit like an English flag). If the road intersects with another road, stop.
4. take each of the 4 map pieces, and send them back into this recursive method

At the beginning of the method I check the width and height of the sub-map and exit if its below a certain number.

Once this is done its just a matter of iterating through it and placing the relevant 3d model in the correct space.

Brian Wilson   (Jun 24, 2008 at 19:30 GMT)
I know there's probably countless resources out there on the logic of how these work; but going out there and doing it yourself really helps sharpen your skills. Good luck with this side-venture =)

John Coyne   (Jun 24, 2008 at 21:45 GMT)   Resource Rating: 5
Thanks Brian. :O)

You must be a member and be logged in to either append comments or rate this resource.