Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate a random 2D map for a castle or building?

Tags:

algorithm

map

I'm creating a game and need to create a random 2d map of a castle or a similar building. It should look like blueprints, i.e. shot from above and only lines are used.

I'm looking for some algorithm that does this. I'm not so interested in the code, but the algorithm itself. Where to start and how to fill the desired area?

like image 590
Milan Babuškov Avatar asked Aug 26 '11 21:08

Milan Babuškov


1 Answers

A maze best describes a random 2D map of an internal structure. What you need is a maze generation algorithm. After implementing the basics you could add your own implementation of random "room" placement etc.

like image 72
edvaldig Avatar answered Sep 26 '22 04:09

edvaldig