View Single Post
 
Old 07-16-2013, 12:29 PM
ephestion ephestion is offline
Newcomer
 
Join Date: Aug 2006
Posts: 10
Default

I would probably go with Map templates with randomised variables. Much better than pure random and better than one standard way of producing maps.

Dungeons and walls would probably need hardcoding since you will need to ensure they close properly and have doorways. Open area maps can be script based. For example you have a text or xml file with a format similar to this:

//Player Startup Objects
Player Sprite
Player Location (specific or variable +- 5 tiles)
Place Player On (Grass, Mountain, Walkable, or any other tile specs you want to define.)

//Land Fill
Base Land (First Layer, Water or Grass or other)
Player Start Base (Some template to draw a starting town or village or outland area on which player starts...may inlcude hardcoded things like preset encounters, tavern, inn etc.)
Player Avoids (Trees, Unwalkables, Water, buildings or any other class you defined for your tiles.)

//Place terrain
Place Terrain Objects X On (Base Land/Water, trees, grass etc)

//Create Rooms
Area To Turn To Building (Define a Rectangle or select tiles to be used for buildings)
Enclose Building (a method fires to draw all around the tiles needed)
Make Exits On Walls X (Where X can be Number of Doors min to add to walls)

You can also use your pathfinding procedure to outline a particular path you want kept clear and the rest of teh specified area can be filled with walls, doors and items.

Script like this are used in Random Map Generation for games like Empire Earth, Age Of Empires and Age of Mythology series.

An Alternative is just have template blocks of say 5 x 5 tiles of predefined things. Like a 5x5 Village, A 5x5 Forest area with a small path, a 5x5 Dungeon and all these are added upto the number of tiles wide and high you want to append them. If entire map is 25x25 tiles then you place 5 (5x5) chunks randomly together or base don some % chance.
Reply With Quote