[0.2-Alpha] Biome API - Now With Trees

Post Reply
User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

[0.2-Alpha] Biome API - Now With Trees

by jordan4ibanez » Post

Since terrain generation became greatly sped up, this is now possible to do in an ethical manor.

Download

Jungle biomes can be brought back with this.
Image

Currently this has support for 3 layers of biome, an ore that generates in the 3rd layer, and trees.

This is how you use this:

Code: Select all

new_biome(required_noise,first_layer_depth,first_layer,second_layer_depth,second_layer,third_layer_depth,third_layer,ore,ore_chance,tree,tree_height,tree_chance,stump,leaves,remove_tree)
Required noise: The rarity of the biome (0-1, Higher is rarer)

First_layer_depth: How deep the first layer is (example: 10)
First_layer: What node makes up the first layer? (example: "default:glass")

Second_layer_depth: see First_layer_depth
Second_layer: see First_layer

Third_layer_depth: see First_layer_depth
Third_layer: see First_layer

Ore: What ore should generate in this biome? (example: "default:mese")
Ore_chance: How rare should the ore be? Now I recommend you use 0.05 and below or your biomes will be FLOODED with ores! (example: 0.05)

Tree: Spawn trees? This must be a boolean (True/False)(example: True)
Tree_height: How tall should the trees be? (example: 5)
Tree_chance: How thickly should these trees spawn? (example:0.05)
Stump: What should the body of the tree be made of? (example:"default:wood")
Leaves: What should the leaves be made of? (example: "default:stone")
Remove_tree: Should the map generator remove default trees in the biome? This must be a boolean (True/False) (example: True)

And in case all that doesn't make sense, here's a jungle biome I created:

Code: Select all

new_biome(0.0,1,"default:dirt_with_grass",5,"default:dirt",30,"default:stone","default:stone_with_iron",0.08,true,10,0.1,"default:jungletree","default:leaves",false)
Have fun!
Last edited by jordan4ibanez on Sat Dec 08, 2012 05:38, edited 1 time in total.
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

Hey guys, released alpha 0.1, now you can make some simple biomes, have fun!
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
InfinityProject
Member
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Post

Nice!
Image
Last edited by InfinityProject on Sat Dec 08, 2012 04:35, edited 1 time in total.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

InfinityProject wrote:Nice!
Image
Nice!

Now the Biome API supports tree generation!
hello, am program. do language in rust. make computer do. okay i go now.

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

YOU ARE EPIC. THIS IS WIN.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

Last edited by rubenwardy on Sat Dec 08, 2012 16:01, edited 1 time in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
InfinityProject
Member
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Post

Code to nyan biome:

Code: Select all

new_biome(0.0001,2,"default:nyancat",6,"default:nyancat_rainbow",18,"default:cloud","default:mese",0.05,false,6,0.1,"default:nyancat_rainbow","air",true)
Is the size of a biome chosen at random when it's generated?

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

InfinityProject wrote:Code to nyan biome:

Code: Select all

new_biome(0.0001,2,"default:nyancat",6,"default:nyancat_rainbow",18,"default:cloud","default:mese",0.05,false,6,0.1,"default:nyancat_rainbow","air",true)
Is the size of a biome chosen at random when it's generated?
Yes, it uses perlin noise
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

It appears you are aware of this mod now, Hybrid Dog. If those pictures are of a jungle biome you made yourself, then you are learning how to make biomes with this mod. It should be much faster than the habitat mod, which even it's creator says it takes up a lot of CPU to work, hence the lag with your swamp mod.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

Let's hope jordan4ibanez will be back soon and include RealBadAngles new trees. Until then, maybe the tree generation of the biome api can be abused for planting saplings? (That is, "trees" with a height of 1 and no leaves). The diffrent layers ought to be fine for the swamp mod, and its vegetation could spawn with VanessaEs plantlife-master on the swamp nodes.
A list of my mods can be found here.

User avatar
0gb.us
Member
Posts: 841
Joined: Sun Sep 16, 2012 01:55
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

Someone I know has requested perfectly flat biomes for easier building. Is there a way to generate those with your biome API?

EDIT: Never mind, I don't think it is possible. But I found a way to make flat biomes work buy reading your code. Thanks!

I don't see a licence on your code though. Is it alright if I use this part of your code in my plugin?

Code: Select all

    local env = minetest.env
    local perlin1 = env:get_perlin(112,3, 0.5, 150)
    local divlen = 16
    local divs = (maxp.x-minp.x);
    local x0 = minp.x
    local z0 = minp.z
    local x1 = maxp.x
    local z1 = maxp.z
    local ground_y = nil
    if not (perlin1:get2d({x=x0, y=z0}) > required_noise) and not (perlin1:get2d({x=x1, y=z1}) > required_noise)
    and not (perlin1:get2d({x=x0, y=z1}) > required_noise) and not (perlin1:get2d({x=x1, y=z0}) > required_noise)
    and not (perlin1:get2d({x=(x1-x0)/2, y=(z1-z0)/2}) > required_noise) then
        return
    end
Last edited by 0gb.us on Thu Jan 03, 2013 22:20, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests