How can I find multiple starting areas on a procedural map?

by edthethird   Last Updated April 12, 2018 18:13 PM

I'm using perlin noise to generate a 2d map, with ground types and natural resources.

When you start a new game I need to place your town hall as well as your opponents in such a way they are on grassland and near natural resources.

For an oversimplification, I have a 2d array of integers where a block of 0s and a couple 1s would be great for starting but anything lower than a 0 would be bad. How can I isolate a few blocks of what I'm looking for, ideally with a distance threshold so town halls aren't next to each other.

How does civilization do this for example?

Tags : tilemap

Answers 1

An option is to avoid searching for locations and just force them.

You could place all the starting locations a suitable distance away from each other, and for every location, change the local terrain to grassland and add resource nodes nearby if there aren't enough.

April 12, 2018 17:49 PM

Related Questions

Impassable Tiles With XNA/C#

Updated April 15, 2015 04:05 AM

How to create a map from graph

Updated May 25, 2015 23:05 PM

Infantry Size in 2D RTS game , [SDL C++]?

Updated July 17, 2015 14:05 PM