All of the noise types give the same result
gaetano-foster opened this issue · comments
I am using the Java version, and after testing it and taking screenshots I noticed that every type of noise gives the same values regardless of what type it is. Seed is -211950573
Yes, I am using it for world generation. Just one thing to add: I'm not sure if this changes anything, but I added a "SetSeed()" method to the FastNoiseLite class so I could change the seed at will. Other than that, the FastNoiseLite code is not modified:
Edit: Just to clear up any confusion, I changed the seed only once just to be 100% sure this was a bug and not a coincidence with that specific seed.
``
// world generation code
public void constructWorld()
{
width = 256;
height = 256;
spawnX = (width * Tile.SIZE) / 2;
spawnY = (height * Tile.SIZE) / 2;
chunk = new int[256][256];
belowChunk = new int[256][256];
defBelowChunk = new int[256][256];
Random random = new Random();
int seed = random.nextInt();
terrainNoise.SetSeed(1423935289); // temporarily hard coded the seed, just to see if there is any difference between types
System.out.println("Seed: " + terrainNoise.GetSeed());
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
// TODO: create a "biome map" based on a noise function which affects the type of tiles to be placed
float noiseValue = terrainNoise.GetNoise(x, y);
if (noiseValue > 0.4f && noiseValue < 0.8f)
chunk[x][y] = 8;
else if (noiseValue > 0.0000000000000000000000000000000001f && noiseValue < 0.4f)
chunk[x][y] = 0;
else if (noiseValue > 0.8f)
chunk[x][y] = 6;
}
}
}
``
Actually, sorry for the inconvenience, but I tested it on another project and the different noise types actually worked. I'll have to try and figure out what went wrong with my project.