Page 1 of 1

Biome support in the API

PostPosted: Wed Oct 24, 2012 10:11
by PilzAdam
Hello everyone!
I think it would be great if there where some functions in the API that mods can define biomes.
Here are some ideas how these functions could look like:
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
minetest.register_biome("desert", {
    rarity = 0.1,
    stone_like_node = "default:desert_stone",
    dirt_like_node = "default:default:desert_sand",
    dirt_with_grass_like_node = "default:desert_sand",
    generate_trees = true,
    tree_rarity = 0.01,
    leaves_like_node = "air",
    tree_like_node = "default:cactus",
}

This is an example for the desert biome.
There should be also a global table that cotains all definitions ordered by name:
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
minetest.registered_biomes

If this would be implemented into upstream, the API would be much more powerful and mod creators could create variet maps.
Please post what you think about it and what you would add/remove to the functions.

PostPosted: Wed Oct 24, 2012 10:19
by jin_xi
i agree, this would be great. but i think some more degrees of control would be good, esp for placement of biomes.

PostPosted: Wed Oct 24, 2012 10:35
by PilzAdam
Another idea: In minetest.register_on_generated() there should be the biome as one param:
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
minetest.register_on_generated(minp, maxp, seed, biome)

"biome" should contain the name of the biome or a table with all biomes in that block.
So the mod developers can check if they are in a desert and create some oasis there.

PostPosted: Wed Oct 24, 2012 10:43
by Topywo
Good idea.

Would it also be possible to let the mod makers use more 'like' nodes and use other than the minetest_game mods?

For example:
stone_like_node = "default:desert_stone",
stone_like_node_a = "modmakersmod:granite"

PostPosted: Wed Oct 24, 2012 14:17
by BrandonReese
Topywo wrote:Good idea.

Would it also be possible to let the mod makers use more 'like' nodes and use other than the minetest_game mods?

For example:
stone_like_node = "default:desert_stone",
stone_like_node_a = "modmakersmod:granite"


for something like that it would be better to make stone_like_node an array

stone_like_node = { 'default:desert_stone','modmakersmod:granite' }

In the biome definition should it include a size range. So you could make the desert biome rare, but you could make it very large. If it's just rare it could end up being small too.

PostPosted: Fri Oct 26, 2012 13:31
by PilzAdam
Another idea: Different types of trees.
New fields in the definition table:
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
tree_small = true,
tree_medium = true,
tree_big = false,

PostPosted: Sat Oct 27, 2012 05:43
by kotolegokot
This is very great idea! I have some amendments. I think trees must be generated separately. I mean it must be generated by minetest.register_on_generated function. Also, we need function, that get biome name from position. Example: minetest.env:get_biome_name(pos).

PostPosted: Sat Oct 27, 2012 11:03
by PilzAdam
kotolegokot wrote:Also, we need function, that get biome name from position. Example: minetest.env:get_biome_name(pos).

I already had the idea to pass the biome to minetest.register_on_generated(). But this would be cool too, to use it in abms.

PostPosted: Sat Oct 27, 2012 16:40
by PilzAdam
2 new ideas:
1) A new layer above_dirt (for snow biomes)
2) Some params to control the mapgen (e.g. high mountains or flat).

PostPosted: Sun Oct 28, 2012 16:09
by OdnetninI
I think the same that you, we need more control of mapgen (like mines). +3

PostPosted: Sun Oct 28, 2012 16:36
by sky
I like this biome idea i can make a jungle biome a snow biome and plains biome if it will work

PostPosted: Sun Oct 28, 2012 16:37
by PilzAdam
Maybe textures that depend on the biome would be nice. When you place a grass block in a swamp biome it looks different than in a grass biome.

PostPosted: Sun Dec 09, 2012 12:44
by jmf
A height parameter would be nice, so for example snow biomes are only generated at great heights.

PostPosted: Tue Dec 11, 2012 16:31
by 0gb.us
PilzAdam wrote:Maybe textures that depend on the biome would be nice. When you place a grass block in a swamp biome it looks different than in a grass biome.


That sounds like it would requite work on the client side.

Or on the server side, it could be implemented as a separate node that gets switched in.