fogleman / Craft

A simple Minecraft clone written in C using modern OpenGL (shaders).
http://www.michaelfogleman.com/craft/
MIT License
10.44k stars 1.39k forks source link

Seed based terrain ? #206

Closed tripulse closed 6 years ago

tripulse commented 6 years ago

I appreciate the work you did. Getting good FPS and no lags at all. But what about seed based world generation ?

srand(seed);
rand(); // Numbers around seed.
twetzel59 commented 6 years ago

The terrain is generated using the noise functions, not just rand(). Luckily, the noise lib has a function called seed(). If you call it somewhere in main() before terrain is generated, you should be able to get new terrain.

tripulse commented 6 years ago

Thanks. I was a noob back then and don't know about noise functions.