Hello, I am making a 2d Game and I currently have a working Perlin Noise script that makes separate temp/rainfall stats for each tile and it is completely random. Only I do not want it to be completely random (I am using Perlin Noise), I want it to be pseudo Random, in which biomes are a minimum size, or at least look more natural. (Separate Biomes, Natural Look)
These lines are rechoosing ALL the random offset every single cell for every single axis for every single quantity for every single point.
Despite the involvement of PerlinNoise, this rechoosing makes your output essentially indistinguishable from random noise.
BEFORE you make your level, store the x, y offsets for rain and temperature, and use them throughout the generation.
NOTE: you will also likely need a scaling term that you multiply the X and Y by, because moving at +1 per step is pretty fast. If you don’t know what I mean, refer to a few examples of Perlin noise on the net.
Computers cannot create real randomness out of the box. When you use such functions you always get pseudo random numbers. As Kurt pointed pointed out you get this because you add a random factor to your sampling coordinate. I wondered yesterday in your other thread already what this should be good for. For an approach which uses the location of a “cell” as seed for a custom pseudorandom number generator I can recommend this video. It’s in another Engine but the concepts also apply to Unity.
As for biomes I suggest to lookup some tutorials about biome generation as there are many different approaches. Probably you will need to use scaled coordinates for your biome perlin as when you sample it with “real world” coordinates you get many bumps. You need to sample it from a smaller region to have few bumps similar to mountains.
Edit: As clarification. When you scale the sampling coordinates with a value < 1 you “zoom in” the noise. I suggest to visualize the noise in a texture so you get a feeling how perlin of a certain scale looks like.
What should this be good for? I assume you only need the noise for creation time (when you don’t want to run further simulations like precipitation). So once the tiles are decided you would discard it anyway. So you could also calculate it “on the fly” for each tile/cell and save the memory.
I already suggested to visualize the noise you get from perlin and look for patterns you would like your biomes to look like. Perlin will give you some values similar to heights of hills. For biomes usually voronoi noise is suited better. Or you “combine” different perlin values similiar like you already did fe one map for temp, one for humidity, one for height and decide which biome this is.
If you feel overwhelmed this is natural since procedrual terrain generation IS a complex topic. Even more so when you want it to “look right” or realistic. Then watch some tutorials. You could also define a biome map in another application (remember voronoi noise) and use a random section of it. Or you leave it as is and focus more on gameplay for the moment as I doubt it to be game breaking.
Make sure you stay focused on the problem at hand. Your questions so far have to do with producing these areas of your game and getting the frequency reasonable.
If that is still what you are interested in, multidimensional arrays have nothing to do with this. They would simply be one possible way to store data about your world for later rapid lookup.