Asked by rapidflowstudios
Hello there! Haha yes - Me too, it has taken me a good while to understand the basic concepts of Perlin Noise, sometimes it still makes my mind wonder on what im doing, but i have got the hang of it now, it is fun just changing a number to a slightly different value, and looking at the amazing results you get in return.
Another tip can be that make sure you in some way cache or store the values you get out from the noisemap, mine i store in an array sorted by height, y then x value, just to obtain the blocks i need easier, this way i can preload the map before and store it on the server, when the user joins, pick a random one or create another one. Thats the plan anyway, but at the moment it just preloads a new map using a random seed each time they refresh the page. This is going to change though im sure.
For a simple snippet of how im using it to generate some blocks, take this, its a simple little feature i added to generate baby trees dotted around the map (I plan to have these grow into full trees over time).
I’ve uploaded a few examples of my code to pastebin, hopefully you will be able to understand my code - I agree it’s not entirely efficient, but at the moment i just want it working, then i will go back and optimize everything, it’s a working method for me.
If you need any more help, just ask. As you can guess i end up babbling on too much, but i hope this helps!