Here is my code:
def generate(octaves):
global world, xpix, chunkSize #set globals (for other references in the rest of the script etc)
chunkSize = (12, 12)
xpix, ypix = chunkSize[0], chunkSize[1]
world = []
noise1 = PerlinNoise(octaves=octaves, seed=seed) #make noise
for i in range(xpix): # make list for drawer to use
row = []
for j in range(ypix):
noise_val = noise1([(i / xpix) + chunkCoordX * xpix, (j / ypix) + chunkCoordY * ypix])
if noise_val <= .05:
tiletoplace = tileclassdata.water
elif noise_val <= .13:
tiletoplace = tileclassdata.sand
else:
tiletoplace = tileclassdata.grass
placed_tile = classes.tile(tiletoplace, i, j)
row.append(placed_tile)
world.append(row)
I am trying to make the chunks I generate connect. For example:
I could have a chunk at 1,-4 and one at 0,-4. But this is what they'd look like:


I would like them to connect so that I can get things like islands generating across chunks instead of just have random blobs scattered around my game's map.
I have tried refactoring the sum for working out the chunks position in the perlin-noise map but I have not been able to devise a sum that figures it out.
Quick and dirty example of the idea in the comments:
Example output:
After that, I'd take a desired water/sand %%, calculate quantiles and apply the threshold.