Small map generator

Started by
6 comments, last by C64 18 years, 7 months ago
I need to generate a random small map. The size of the map is only 30x30 squares. While the edges of the map have walls, so the actual free space is only 28x28. I need to generate only rooms and coridors (maze like coridors). The rooms need to be rectangular. How would I generate several diverse random map with these specifications? Thanks in advance. [Edited by - The C modest god on September 9, 2005 8:52:03 AM]
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
Advertisement
Well, there is NeHe Lesson 42 (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=42), where they feature multiple viewports, but in the midle of the lesson, there is a maze generator bein used. It's a very simple one, and I believe that it won't guarantee you that the maze has a solution, but you can modify it to do that.

EDIT: Actually, I was taking another look at the maze generated, and it looks like it will actually aways generate a maze with a solution.
Quote:Original post by algumacoisaqualquer
Well, there is NeHe Lesson 42 (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=42), where they feature multiple viewports, but in the midle of the lesson, there is a maze generator bein used. It's a very simple one, and I believe that it won't guarantee you that the maze has a solution, but you can modify it to do that.

EDIT: Actually, I was taking another look at the maze generated, and it looks like it will actually aways generate a maze with a solution.


The maze I want to create does not have a solution.
Most of the space needs to be connected, but there is no entrance to the maze (just a starting point), and the exit may be somewhere inside the maze (a teleport).
I am not sure this will create big enough rectangular rooms.
I need the maze to be mostly big rectangular rooms, and some few cooridors.
Anyway, this algorithem gave some ideas, how to do a random maze.
More tutorials like this might be helpful.
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
http://www.aarg.net/~minam/dungeon.cgi

That might give you some idea on how to do it..
I figure I'd start with the rooms, how many rooms do I want and how big can they be? and then place them in the map. Then I would try to fill in the gaps with hallways from one room to another.

Anyways I don't know if you need to create them on the fly or if you just wanted a generator.
FOLLOW ME ON TWITTER OR MY BLOG
Quote:Original post by Turt99
http://www.aarg.net/~minam/dungeon.cgi

That might give you some idea on how to do it..
I figure I'd start with the rooms, how many rooms do I want and how big can they be? and then place them in the map. Then I would try to fill in the gaps with hallways from one room to another.

Anyways I don't know if you need to create them on the fly or if you just wanted a generator.


No I want to create it on the fly, but thanks anyway.
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
This page and this one have some good information on the theory of it. Basically what you want to look for is random maze generation algorithms. GameDev even has a featured article on it.
Quote:Original post by The C modest god
Quote:Original post by Turt99
http://www.aarg.net/~minam/dungeon.cgi

That might give you some idea on how to do it..
I figure I'd start with the rooms, how many rooms do I want and how big can they be? and then place them in the map. Then I would try to fill in the gaps with hallways from one room to another.

Anyways I don't know if you need to create them on the fly or if you just wanted a generator.


No I want to create it on the fly, but thanks anyway.


The page shown above has a link to the theory of how the dungeons are made. Using those ideas you can write a generator yourself. It's pretty easy.

you can start with a perfect maze, just like explained in the tutorial mentioned
(this one is v.good http://www.mazeworks.com/mazegen/mazetut/)

then draw rooms over the maze... ie close all walls on the boarder and erase all walls inside, then choose randomly a cell on the room's wall to open it. no you got a room that is connected to the maze... do it again for other rooms

This topic is closed to new replies.

Advertisement