[0.2-Alpha] Biome API - Now With Trees

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

[0.2-Alpha] Biome API - Now With Trees

by jordan4ibanez » Fri Dec 07, 2012 13:25

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:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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.
If you can think it, you can make it.
 

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

by jordan4ibanez » Fri Dec 07, 2012 22:18

Hey guys, released alpha 0.1, now you can make some simple biomes, have fun!
If you can think it, you can make it.
 

User avatar
InfinityProject
Member
 
Posts: 1009
Joined: Sat Mar 17, 2012 00:52

by InfinityProject » Sat Dec 08, 2012 04:07

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

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

by jordan4ibanez » Sat Dec 08, 2012 05:39

InfinityProject wrote:Nice!
Image

Nice!

Now the Biome API supports tree generation!
If you can think it, you can make it.
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Sat Dec 08, 2012 09:52

YOU ARE EPIC. THIS IS WIN.

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Sat Dec 08, 2012 13:59

Last edited by rubenwardy on Sat Dec 08, 2012 16:01, edited 1 time in total.
 

User avatar
InfinityProject
Member
 
Posts: 1009
Joined: Sat Mar 17, 2012 00:52

by InfinityProject » Sat Dec 08, 2012 15:52

Code to nyan biome:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Sat Dec 08, 2012 17:36

InfinityProject wrote:Code to nyan biome:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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
If you can think it, you can make it.
 

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

by Inocudom » Thu Jan 03, 2013 16:34

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: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Thu Jan 03, 2013 17:07

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

by 0gb.us » Thu Jan 03, 2013 21:10

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?

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 16 guests

cron