My name is Chris and I'm working on my first Java game. Thus far, I have created a tile based 2D game, however my level is done in such a way so that if I create an image and its all green, then that green would stand for a grass tile. If I put a pixel of blue, the game would assign that as a water tile.
However, that limits the game to how I design the level, I'd much rather have an infinite terrain of tiles.
Being a beginner, I looked up different ways to do so. A particularly poignant method was something called a Perlin Noise.
I looked into it but it seemed very complex.
Would somebody mind defining it in simpler terms?
Also, if you have any tutorials that 'dumb' it down a bit and give a brief overview, that'd be fantastic!
Sorry I haven't been too specific, I'm actually avoiding from doing so.
I'd suggest skipping Perlin Noise and taking a look at something called OpenSimplex Noise.
It's useful for basically all of the same things as Perlin Noise, but it has significantly fewer visible directional artifacts. Basically, the noise takes an input coordinate (in 2D, 3D, or 4D) and returns a value between -1 and 1. The output values vary continuously with the input coordinate changes.
Here are three 256x256 images generated using noise (x / 24.0, y / 24.0):
Note that there's also Simplex Noise (different algorithm from OpenSimplex) that has reduced directional artifacts compared to Perlin Noise, but the 3D and higher implementations of Simplex Noise (if you happen to want to use 3D noise to vary anything in 2D over time) are saddled with a patent.
OpenSimplex Noise is actually an algorithm I've developed for a game of my own, so shameless plug I know, but I think it's the best for you out of what's available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With