Page 1 of 1

Bukkit Plugin: WGen Noise and Smoothing

Posted: Thu Jun 14, 2012 12:40 pm
by thepackett
Hey, i was wondering if there were any tips that anyone could give me on noise and terrain smoothing (between biomes)
I am for the most part attempting to recreate (roughly) default minecraft terrain generation in order to learn about how to make realistic looking minecraft terrain (cliffs, hills, non repetitive, etc)
Any advice, tips, or tricks would be appreciated :D

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Thu Jun 14, 2012 1:38 pm
by jacek
Interesting topic !

I did a video on natural-ish hills which explains the basics of using the noise generators that comes with Bukkit. The default Minecraft terrain is a lot of those all multiplied together pretty much.

I think I would probably look at the actual Minecraft source for this, grab MCP and decompile the server, the wgen code is pretty easy to find.

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Thu Jun 14, 2012 1:46 pm
by thepackett
I saw your video, it was really helpful :D
its just that is wasn't entirely clear to me about how to put it together in order to form more complex/natural terrain gen such as found in minecraft. You mentioned that you were thinking about doing another tutorial on world gen, if you do end up doing that i would advise showing some examples of how you can put the noise generators together in order to form minecraft-like terrain (probably one biome in particular for simplicity's sake).

But back on topic, what is MCP and where can i find it? :D

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Thu Jun 14, 2012 8:03 pm
by jacek
I might have a go at something with biomes at some point since wgen is one of the things I find most interesting.

MCP is Minecraft Coder Pack and it's a tool for decompiling and de-obfuscating Minecarft which you can get from http://mcp.ocean-labs.de/index.php/MCP_Releases

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Fri Jun 15, 2012 1:38 am
by thepackett
Thanks for the help :D

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Fri Jun 15, 2012 2:16 am
by jacek
Sorry I wasn't more use. Advanced or natural terrain generation is still a bit beyond me to be honest :(

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Fri Jun 15, 2012 3:47 am
by thepackett
To be honest i just realized that myself too xD
After telling me to look at the minecraft code i saw a striking familiarity to your plugin skylands plus :P
Notch must be a genius to understand that xD
Is there anything you can tell me about smoothing terrain generation between biomes maybe? :D

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Fri Jun 15, 2012 3:25 pm
by jacek
Other than "add noise" no not really.

Each biome type has it's own noise generators in the game, and they are multiplied by the biome weight function to make them line up.

Imagine generating some hills, then take every point above y = 70 to be a desert and every point below y = 70 to be forest. You actually ignore the height completely in terms of setting blocks but use it to decide what the biome is. If you then generate hills in one biome and less hills in the other but multiply the resulting height by the biome noise it will kind of smooth off. But there is still the problem of the hills maybe not lining up so you would get a peak next to a trough, to get around that you use the same seed for the generators Random() object which means they will generate in the same place as the other hill type would.

That should give you smooth terrain with varying land type, to make it look more natural you add, subtract, divide and multiply by some more random noise functions to make it look less generated and more, well natural.

Actually the source of http://dev.bukkit.org/server-mods/terrain-control/ should be a good place to look !

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Fri Jun 15, 2012 6:51 pm
by thepackett
That helped a lot, thanks! :D

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Sun Jun 17, 2012 1:17 am
by thepackett
Actually its not ok >.>
after experimenting with the noise generator (simplex) i found out that it doesn't generate a number between -1 and 1 like you said in your video, because i got values of 1.3627 and such. do you know why?

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Sun Jun 17, 2012 1:48 am
by jacek
I've been wrong before ;) Maybe it can be higher than 1 :s

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Sun Jun 17, 2012 2:53 am
by thepackett
Also i tried the world.generateTree() method on the corner of chunks and it doesn't get cut off, also tried populating another chunk in the one i was at (adding 16 to the x or z) and it generated just fine like that. However sometimes generating the trees it got cut off, but only sometimes, and never with small trees (normal trees), only with jungle trees and large trees was it ever cut off. when i populated the chunk with grass however (the one i offset by 16) it seemed to work fine. ideas?

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Sun Jun 17, 2012 4:47 am
by thepackett
Also do you know how to calculate the biome from the humidity and temperature? I've decided to use those values as a solution to biome smoothing :D

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Sun Jun 17, 2012 1:04 pm
by jacek
thepackett wrote:Also i tried the world.generateTree() method on the corner of chunks and it doesn't get cut off, also tried populating another chunk in the one i was at (adding 16 to the x or z) and it generated just fine like that. However sometimes generating the trees it got cut off, but only sometimes, and never with small trees (normal trees), only with jungle trees and large trees was it ever cut off. when i populated the chunk with grass however (the one i offset by 16) it seemed to work fine. ideas?
I noticed the same thing, not really sure as to the reason. My best guess is that a few chunks are generated at a time and if it happens that the tree overflows into one that is being created or has been created already then it's fine. It probably gets cut off by the chunk generating next to it replace the leaves with air.
thepackett wrote:Also do you know how to calculate the biome from the humidity and temperature? I've decided to use those values as a solution to biome smoothing :D
Not a clue. Best guess is that a given range is assigned to a specific biome
if (humidity < 5 && temperature > 50){
    // desert
}

Re: Bukkit Plugin: WGen Noise and Smoothing

Posted: Sun Jun 17, 2012 9:41 pm
by thepackett
Ok, thanks for the help :D

also, since you like terrain generation you may want to look into spout, custom biomes, blocks, map heights, and lots of fun things like that :D
(http://www.spout.org/)