[LibGDX] 2D (top down) procedurally generated terrain.

I’m not as advanced as others here, but I guess any time I have a null pointer exception, I immediately think “what ISN’T initialized properly”.

So I guess I would ask how is “tile” initialized?

At least find out which reference is null. Use a debugger or print something.

      for (int x = x0; x < x1; x++) {
         for (int y = y0; y < y1; y++) {
            try{
                  tiles[x][y].getTile().draw(batch);
            }
            catch(NullPointerException e)
            {
                  System.out.println(x + ", " + y);
                  System.out.println(Objects.toString(tiles));
                  System.out.println(Objects.toString(batch));
                  System.out.println(tiles == null ? "..." : Objects.toString(tiles[x][y].getTile());
                  e.printStackTrace();
                  System.exit(1);
            }
         }
      }

Also, Hugo Elias’s “Perlin noise” is not Perlin noise. Read Ken Perlin’s presentation if you care what Perlin noise actually is. Simplex noise was also made by Perlin. Different types of gradient noise are often interchangeable and the concept behind the algorithms are simple, yet it is not necessary to know it. It is absolutely important to know what “Perlin noise” is NOT, so you can wrap your mind around the various totally different concepts people describe which people think are related to Perlin noise. Then you can look at the algorithms as something totally unrelated and just disregard the Perlin part, docking points based on how absurdly they get the terminology wrong.