To generate settlements I overlay my landscape with a Voroni graph and select cells based on the following criteria
- All the voroni points are within a given deviation in height so my settlements are on relatively flat land
- The voroni sides contain either a river or a road – my settlements are no in the middle of nowhere
- The voroni point heights are in the lower third of the landscape range – my settlements are lowland settlements.
Once I have a target site I generate a random set of points within a bounding circle inside the Voroni cell. I then triangulate these and remove the underlying landscape vertexes and insert the new settlement vertexes. This overrides the natrual landscape with the settlement and allows me to vary the settlement footprint heights as needed and change the texture that it gets painted with. For now I am painting the settlement using a uniform mud texture to make it stand out, but will get more subtle later.
To create a settlement topology I take the settlement voroni graph and describe some paths using the following rules
- Take a hull voroni point
- Get a random adjacent voroni point, rejecting any other hull points. This will lead my path inward.
- Walk the adjacement voroni points iteratively until either (a) I hit another hull point, or (b) I hit an existing path point.
I use these path points as control points on a spline to generate a set of interconnected smooth curver paths. Again I texture these distinctly for debugging but will make them stand out less later. An example of the voroni graph with paths shown in red is below. The yellow points are building locations which are simply the tangents from the centre point of each path line.
The simplistic algorithm is a good start to generating topologically pleasing villages.