Page 1 of 1

Custom biomes

PostPosted: Wed Jul 04, 2012 07:15
by SegFault22
Today I was thinking about Minetest biomes and all, and thought that it would be cool if there was a way to make ''custom biomes'' in LUA instead of C++. What my idea is, is like a mods folder, but called ''biomes'' and inside it you add a folder named after a biome and in that folder is an LUA script that defines the features of the biome, like below:
-Common-ness/rarity of the biome, 1 for rare and 10 for almost everywhere (and anywhere in-between)
-Size of the biome
1 for very small, 10 for massive, and anywhere in-between would be used as a ''scale'' for the size of the biome
-Landforms of the biome
Defined much like ''1 = ponds/lakes, 2 = grassy flats, 3 = hills, 4 = mountains, 5 = mesas'', etc., can have any number of features defined and each one needs a ''scale'' like 1 = very small and 10 = massive (and anywhere in-between)
-Types of blocks used
For deserts it would use ''default:desert_stone, default:desert_sand, default:cactus'', etc., for grasslands it would be ''default:dirt, default:stone, default:dirt_with_grass'', etc., and for snowlands/winter-like regions it would be ''default:dirt_with_snow, default:stone, default:dirt, default:ice'', etc., and for any custom biomes, a simple ''mod'' would be needed to register the nodes in the biome (if no defaults are present for the node) and if any things should be crafted from ''stuff'' in the biome, that would also be defined in the mod.
These nodes would be used for ''surface nodes'', ''middle nodes'', and ''ground-level nodes'' (maybe more levels in-between/below) and the nodes would be added to the map as so, to keep dirt from being in the side of a cliff with stone on the top.
-Vegetation/special nodes
some special nodes that are generated in the biome would be defined here, what ''forms'' they are usually in, and how often they occur (ex. how often cacti occur in a desert, or how often water in a winter biome is turned to ice in map generation)

If this is implemented, it would also require MapGen to be written in LUA (most likely), and it would work kinda like so:
-When a new chunk is generated, the ''chance'' of other biomes is all factored into a random biome picked, if the surrounding chunks in a biome would exceed/be close to the size defined by the biome (ex. if the chunks nearby are all grassy chunks and the percent of grass of each chunk reaches an accumulative percent of 2000, randomly choose a new biome to be spawned in the chunk)
Once it is decided to generate a new biome, the ''chance'' for every biome is factored in to a ''list'' where the chance stands for the number of ''markers'' are added to the list for that biome (ex. like a bag of blue and red marbles, chance is 8 for red and 2 for blue so red gets 8 markers in the list and blue gets 2) and one is randomly selected from the list.
Once the biome is selected, the surrounding chunks are scanned for their ''height'' and nodes are spawned at the same level in the chunk as the one on the other chunk next to it (ex. a chunk of grassland is flat, so the desert biome picked has all of the nodes on the side touching the grassland chunk at the same level as the grassland chunk, or if it is a mountain and a desert biome is picked, make the desert nodes meet the top/sides of the mountain.
The landforms of that biome are listed and some random places are selected depending on the chance of that landform, and then the size range is used to determine the size of the landform.
Finally, the nodes of each level, and the ones defined for the levels of the landmasses present are loaded, and the entire chunk is loaded.
This process may take some time to ''polish'', but it would make the game better and more modifiable, to make Minetest the most it can be for everyone.
Also, it may be better to make biomes ''cubic'' instead of smooth, so that it is easier to keep up with and not too many processings are needed to generate a biome (but if it doesn't really make it lag too much to keep biomes smooth, then it may also be nice to keep smooth-ness)
This does seem very complicated, but it is just an idea someone had while playing Minetest and thinking about making an artificial mountain because the mountains in the area aren't high enough to reach the clouds, like he would need for the city he wants to build.

PostPosted: Wed Jul 04, 2012 08:08
by Stef
Very Nice Idea

PostPosted: Wed Jul 04, 2012 09:29
by Topywo
Maybe you can stick heads together with Mauvebic, he's been exploring that terrain:

http://minetest.net/forum/viewtopic.php?pid=27260#p27260

and did you see this topic: http://minetest.net/forum/viewtopic.php?pid=29506#p29506

PostPosted: Wed Jul 04, 2012 12:09
by mauvebic
Topywo wrote:Maybe you can stick heads together with Mauvebic, he's been exploring that terrain:


Wish i could help but im not doing anything new, got sick of people bitching about my textures with their made-up rules.

PostPosted: Wed Jul 04, 2012 12:37
by sdzen
which made up rules? I've seen so many :)

PostPosted: Wed Jul 04, 2012 13:33
by mauvebic
how big my textures are, where i got them from, people who copy games and movies and tell me i can't do it, etc..

PostPosted: Wed Jul 04, 2012 19:27
by SegFault22
Well it would require Celeron55 to rewrite some of the game itself, so all we can do is wait and hope that celeron55 finds this idea, I guess...unless someone here knows C++

PostPosted: Wed Jul 04, 2012 19:36
by sfan5
I can code in C++, this Idea is good but not so easy to code

PostPosted: Thu Jul 05, 2012 04:16
by SegFault22
What about LUA?

PostPosted: Thu Jul 05, 2012 05:27
by sfan5
Still needs massive changing of C++ Code

PostPosted: Thu Jul 05, 2012 06:09
by SegFault22
yesh :P

PostPosted: Mon Oct 01, 2012 00:16
by Michael Eh?
I was wondering IF latches into C++ code so calls could be made in LUA easier.

Also I would like so see frequency due to latitute. Ie. The higher the North-South coordinates the more or less likely you find a Biome region. Like Finding Snow biome when North South is more than +- 25000 to map edge. Desert biome more likely less than +-3000 North south.

With that, tropics, return of Jungles with more variety. Regions where bambo grows. The map is truly a world and there should be a world of difference.

Re: Custom biomes

PostPosted: Sun Jun 29, 2014 20:35
by DevynCJohnson
It would be wonderful if there were an easy way to make more biomes via Lua.

Re: Custom biomes

PostPosted: Sun Jun 29, 2014 20:52
by Amaz
by Michael Eh? ยป Mon Oct 01, 2012 1:16 am

...

The last post was quite a while ago (understatement!), and this has come on a long way. For example, see the Ethereal mod, or the BFD game. Example biome code for mapgen v7: https://github.com/Jordach/big_freaking ... ua#L21-L34

Re: Custom biomes

PostPosted: Mon Jun 30, 2014 13:06
by rubenwardy
This was a very, very, very bad bump. very very bad.

Re: Custom biomes

PostPosted: Mon Jun 30, 2014 13:29
by Amaz
rubenwardy wrote:This was a very, very, very bad bump. very very bad.

+1