Does anyone know a simple algorithm to create irregular semi-round shapes? Something like a pond or lake.
Something like this? (
http://i.imgur.com/4QGluRG.png http://i.imgur.com/CFSk8bl.png )
If those are the sorts of shapes you want, here's the algorithm:
1. Choose a maximum radius for the shape, so you have a clear stopping point. (You could also experiment with other termination criteria, like the total number of cells, etc.)
2. Start with a single cell of "water" surrounded by plenty of empty space.
3. Choose a cell at random.
4. If the chosen cell is empty space AND is next to water, continue to 5. Otherwise, go back to step 3.
5. Randomly decide whether the chosen cell will become water. The probability should be based on distance from the center (the original water cell). For example, I used (100 - (euclidean_distance * 10))%, for a maximum radius of 10.
6. If you just changed the chosen cell to water AND the chosen cell was at the desired maximum radius, go to 7. Otherwise, the shape isn't finished yet - go back to 3.
7. Finally, smooth it out just once using the "4-5 rule" mentioned here:
http://roguebasin.com/index.php?title=Cellular_Automata_Method_for_Generating_Random_Cave-Like_Levels .
Hope this helps.