Reputation: 1
Here is my problem:
I have a int[,] object (a 2d array of integers) full of 0's of size N^2. This is the base for my game's map.M
Now I need to take this array and with the following parameters: separationDistance
andnumberOfIslands
, I need to put numberOfIslands
number of 1's at pseudo-random indexes in the array so that:
separationDistance
away from any other 1, andThe 0's are gonna be water, and the 1's are the "anchors" for each island.
Does anyone know an algorithm that would be applicable here?
Initially I thought that the perlin noise algorithm would be the perfect tool for the job, but as I took the ticket and actually got to work, I quickly realised it's not at all what I need at this stage.
Upvotes: 0
Views: 30
Reputation: 1
To anyone else with the same problem; I found the following algorithms that seem to be exactly what I'm looking for:
Upvotes: 0