Originally Posted by
mtwgamer0
Method I used was to add multiple random points to a bitmap, assign each point a color. Then loop through every pixel in the bitmap and color it depending on which of those coloured points is nearest to the current pixel.
This is the generic voronoi algorithm. My question is which type of voronoi did you use? In other words, I wish to know how you calculate pixel proximity.
There are 3 most common used voronoi type: Euclidean, Manhattan and Minkowski.
For example, let's take Medieval 2 map_height:
Using a java code made by me, i've create 199 random regions using all this 3 voronoi types.
Euclidean:
Manhattan:
Minkowski:
As you can see, the last type (Minkowski) seems to be the better voronoi type to create Medieval 2 regions.
All this 3 voronoi types work as you wrote. The only difference between them is the pixel proximity calculation. Calling the distance "d", this is how it's calculated:
Euclidean: d = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
Manhattan: d = Math.abs(x1 - x2) + Math.abs(y1 - y2);
Minkowski: d = Math.pow(Math.pow(Math.abs(x1 - x2), p) + Math.pow(Math.abs(y1 - y2), p), (1 / p));