r/howdidtheycodeit • u/ANNOYING_TOUR_GUIDE • Jun 30 '22
Question How does Minecraft generate terrain split into chunks?
I understand the idea of Perlin noise. I also feel like I get the gist of random tree placement. Caves seem tricky but I could still understand, maybe making some kind of sphere move about underground that carves a cave out.
What I DON'T understand AT ALL is how the generation is done a 16x16 chunk at a time. How are all these things, Perlin, continuous caves, etc., done in such small blocks at a time, and then connect together seamlessly?
I could understand, a lot more simply, how to generate a finite world using Perlin noise. Making the world infinite and doing it a chunk at a time makes it a lot more difficult seeming, how is it done?
View all comments
Show parent comment
1
u/Syracus_ Jul 01 '22
While that's technically feasible, you'd have to be very careful about recursion though, which can be tricky with random procedural generation.
There's also the issue of performance.