Bukkit Plugin: WGen Noise and Smoothing

Any help topics that don't fit in the current categories can go here.
Post Reply
thepackett
Posts: 11
Joined: Sun Jun 10, 2012 10:57 pm
Location: United States

Bukkit Plugin: WGen Noise and Smoothing

Post 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
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugin: WGen Noise and Smoothing

Post 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.
Image
thepackett
Posts: 11
Joined: Sun Jun 10, 2012 10:57 pm
Location: United States

Re: Bukkit Plugin: WGen Noise and Smoothing

Post 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
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugin: WGen Noise and Smoothing

Post 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
Image
thepackett
Posts: 11
Joined: Sun Jun 10, 2012 10:57 pm
Location: United States

Re: Bukkit Plugin: WGen Noise and Smoothing

Post by thepackett »

Thanks for the help :D
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugin: WGen Noise and Smoothing

Post by jacek »

Sorry I wasn't more use. Advanced or natural terrain generation is still a bit beyond me to be honest :(
Image
thepackett
Posts: 11
Joined: Sun Jun 10, 2012 10:57 pm
Location: United States

Re: Bukkit Plugin: WGen Noise and Smoothing

Post 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
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugin: WGen Noise and Smoothing

Post 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 !
Image
thepackett
Posts: 11
Joined: Sun Jun 10, 2012 10:57 pm
Location: United States

Re: Bukkit Plugin: WGen Noise and Smoothing

Post by thepackett »

That helped a lot, thanks! :D
thepackett
Posts: 11
Joined: Sun Jun 10, 2012 10:57 pm
Location: United States

Re: Bukkit Plugin: WGen Noise and Smoothing

Post 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?
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugin: WGen Noise and Smoothing

Post by jacek »

I've been wrong before ;) Maybe it can be higher than 1 :s
Image
thepackett
Posts: 11
Joined: Sun Jun 10, 2012 10:57 pm
Location: United States

Re: Bukkit Plugin: WGen Noise and Smoothing

Post 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?
thepackett
Posts: 11
Joined: Sun Jun 10, 2012 10:57 pm
Location: United States

Re: Bukkit Plugin: WGen Noise and Smoothing

Post 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
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugin: WGen Noise and Smoothing

Post 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
}
Image
thepackett
Posts: 11
Joined: Sun Jun 10, 2012 10:57 pm
Location: United States

Re: Bukkit Plugin: WGen Noise and Smoothing

Post 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/)
Post Reply