LWJGL Perlin Noise cave gen placement

Hi,

Thanks to trollwarrior1, I now have a cave generator and world generator, however I want to place the cave generator under the world gen,
Here is the code for the world gen:
http://pastebin.java-gaming.org/715c20a3f8e

and here is the cave gen code which I want to display under the world thats been generated:
http://pastebin.java-gaming.org/15c2a1f3e85

Thanks,

  • Dan

Well, I guess the first question is do you know exactly what that code does, every line? If you don’t then you should figure it out.

Now… These two classes look like they’re run completely separately from each other. What you want to do is have a world class with your tile array. You can run the terrain generator on the world first and then the cave generator. I’m not completely sure how you have a 2d cave, but placing the cave generator “under” the terrain generator is not a trivial problem. Just have it affect the tiles under the terrain generators tiles or have it modify the same tiles depending on what you want to accomplish.

Remember, if you copy, paste, and change a couple values then you will probably never fully understand what that code does. Remember to learn each line of code so that you can debug it easier later.