bravoserver / bravo

UNMAINTAINED: Reverse-engineered Minecraft stuff. Worked with 1.4.x protocol
http://bravoserver.org/
Other
206 stars 45 forks source link

Caves #141

Closed MostAwesomeDude closed 13 years ago

Varriount commented 13 years ago

I have some code somewhere that I made that could take a list of coordinates and an offset, and split them into chunks... The aim was to make it easy for a generator to generate a large structure, send it to this splitter, and then modify the chunks.

MostAwesomeDude commented 13 years ago

http://archive.gamedev.net/community/forums/mod/journal/journal.asp?jn=259175 is a decent approach. Note that his "multiridged fractal" is just a folded noise map. The big problem with this is that it requires around 8 octaves of 3D noise for every occupied block in the chunk, which is an awful lot.

Varriount commented 13 years ago

And considering that 3d noise is a bit sluggish in bravo, 8 layers of its seem a bit.. expensive. I was considering using cellular automata to make caves. Dig out an area, and branch off, moving in random directions. The upside to this is it's fairly easy, the downside is, its also fairly random. Heres the technique http://properundead.com/2009/03/cave-generator.html

MostAwesomeDude commented 13 years ago

Well, 3D noise is only slightly spendier than 2D noise, and in fact runs faster on most of my machines for some reason I don't understand. (Not a lot faster, but enough to confuse me.) The main cost is in doing it for every block (up to 32k per chunk) rather than every column (up to 256 per chunk).

MostAwesomeDude commented 13 years ago

Caves have been added, using a pair of noise fields per column to fake 3D regions fairly convincingly. Some fine-tuning probably still needs to take place, but the main code is there, so I'm closing this.