Archived

This topic is now archived and is closed to further replies.

kRogue

on random level generation: Some ideas out there?

Recommended Posts

Hi all, I have been working on a way to make random levle generator for 3d doom style games.. and NOT having that all rooms/hallways meet at 90 degrees...currently I do a somewhat primiteve algorihtm: (the maps are stil essentially 2d though!) 1) tile the plane with regular polygons (right now I use hexagons or squares, but not both) 2) generate a list of rooms(each room is a coordinate with a radius) that must be visited (and an order on which to visit them) 3) now generate "hallways" by drawing a line from one room to the next, then randomly zig zag the line and also randomly branch it out 4) as I make rooms/hallway mark the tiles with a color, say MustPath and have also the tiles are initailized as NoColor at the very beginning 5) now after this "random" coding is done, for each tile adn each side of tha tile, determine if its on the boudanry, if it is make a wall there. now the problem: lots of hallwy are not along the squares or hexagons (I "paint" the tiles like one would draw a line to a screen) so the hallwas and rooms are jagged... I am looking for efficient and fast ways to reconize a continouus wall, and smooth it out.. and this is where I have troubles... any idea out there? currently the system maks some pretty impressive random maps and where hallways interesect they end up making new rooms (which is a BONUS, since it makes the architecture more interesting) so I want to keep those implicit rooms.... at any rate any ideas on how to smooth the walls out would be appreciated... I have one idea, but I am shy to try it if others have a better idea: (a) create a very fine tiling of the plane, initing each tile as color NoColorYet (b) create the "must visit rooms" and give them color RoomColor (c) create the hallways, with branching, when two hallwawy intersect label those tiles as RoomColor as well, and also create a room by adding some additional tiles around it to RoomColor (d) now to keep track of the hallways would would have to keep a list of all the lines one makes, and for each tile, color it according to which line it is on, when one makes a new line and it meets another line, it will bisect that old line. Truncate the old line to where it met with the new line, and create a new line as the stuff of the old line beyone the trucataion, and then recolor those tiles correctly... I am not too crazy about the above because it may not be too fast, and the part about where hallways meet and creating a newroom and inflating the room size creates lots of additional complication... any thoughts would be appreciated.... and of coaurse later I want to start making "curvy" walls too, and this make it even trickier... Best Regards

Share this post


Link to post
Share on other sites