-1
\$\begingroup\$

My tile map takes a spritesheet, slices the tiles up based on a resolution, and assigns each tile to an array, which uses an integer. Since perlin noise generates a float between 0 and 1, I multiply the float by the number of tiles I want to use for terrain generation, round (perlin*tileNum) to a whole number, and then use the whole number integer as the number for the color of the tile.

The code I have to make terrain works, but I noticed that no matter the number that scale is, it basically generates the same terrain, and just stretches it based off of scale to fit the tile map. They essentially are all the same terrain, which is what I don't want.

Here are pictures of what's happening, as well as a pastebin of my tile map engine. I apologize if my wording of the problem is difficult to understand.

What would I need to do to make each generated landscape different? I know I need to reevaluate the Perlin Noise aspect, but I don't know exactly what to fix.

\$\endgroup\$
1
\$\begingroup\$

All you need to do is add an offset to your noise lookups.

Effectively, treat (0, 0) like it's (123.4, 987.6) or some other arbitrary shift.

This centers a different part of the noise domain and you'll get different results.

If using multiple octaves of noise, you can even play with different offsets per octave to mix it up further, so it's no longer a simple translation of the whole noise domain.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.