@gears I'm glad those are asked
Yeah, those are voronoi cells.
amitp's famous post for polygonal map generation
really helped me during the implementation. I used simple square based grid & hexagons before I tried polygons and I'm very happy with voronoi.
Distance between cities are calculated simply between two polygons (centers of the cities). But I needed a fast way to calculate distance between nearby polygons when I was working on pathfinding(for scouting). So in data structure every polygon (Land) keeps a list of neighbor polygons & a float array calculated on start for its distance to those neighbors.
Any interesting techniques in your map generation or rendering?
Voronoi generation for 10k polygons is slow. It takes around 2 seconds on my computer. (It takes a LOT in ipad 3) But the thing is random generation is not about voronoi generation. Same voronoi diagram is perfectly ok to be used in all the game sessions. What makes the randomness is the noise you use to generate heightmap. So, since I don't need to generate voronoi on the fly, I can only generate it on the start of the game once. I did more and made a tool that creates the polygonal map and saves it to an xml file. Reading a lot of data from xml takes around 0.5 seconds, but that's better than 2 sec.
This is my first 3D project so I'm still learning about rendering stuff. I really want to get the good feel and I know I'm not there yet. Here's a WIP screenshot with a smooth transition & simple textures. Please let me know your ideas about if it looks better than abrupt boundaries and how can I improve it more. (One limitation of the engine is I can only use 3 different textures - in my case, I used beach, grass, snow textures)
* Fog of War