Jump to content
  • Advertisement
Sign in to follow this  
The C modest god

Small map generator

This topic is 4796 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!