So I have a game that needs randomly generated maps. I need to randomly generate provinces for the landmasses. I can generate decent looking, for my purposes, landmasses. I can even do acceptable heights. The map is 2D but I need heights for terrain and biomes. But I can think of a simple reliable way to generate provinces, even with iffy shapes. I want to generate anywhere from 2000 to 10000 and I have a map size conducive to that. Hand drawn maps in GIMP of the same size can easily fit decent shapes and 10000+ provinces.
I feel like a major issue is the program knowing which pixels are part of congruent landmasses. It'd sort of have to know where coasts are in some sense. I know I can do something like set a pixel total and use a random number generator and expand out from a random starting pixel.
Roughly I could pick a start and then using random directions and distances draw out a border and fill it in. Then prune a bit to make sure the size is okay by counting the total number of pixels with the unique province color.
I'm including a link to an imgur album of some of the maps I generate:
I'm concerned about making sure I don't have a bunch of small leftover areas that can't become a proper size province, although I could just flip all land that doesn't have a unique color to water at the end. Water provinces will be a lot easier I think since they don't need a certain kind of shape.