Page 1 of 4

[Mod] Forest

Posted: Mon Mar 10, 2014 09:55
by Gael de Sailly
Hello !

Here is my first mod. I am 16, and I start programming. My mod, called Forest, adds numerous things, change the map generation, and especially adds 10 species of trees.

Image
Image
Image
Image

EDIT : Pictures

Download :
Download now (rename to "forest")
Browse the code

You can also download it from the Minetest Mod Database

If you find a bug, or if you have a suggestion, please contact me.

Posted: Mon Mar 10, 2014 10:20
by PilzAdam
Why do you pack so many big screenshots in the download?

What is the license of this mod?

Posted: Mon Mar 10, 2014 11:22
by Gael de Sailly
Oh, sorry !
I have corrected this problem.

Posted: Mon Mar 10, 2014 14:40
by paramat
interesting, i would like to see screenshots (i recommend imgur as a host).

Posted: Mon Mar 10, 2014 14:55
by Inocudom
The mapgen of this mod is rather slow. I think the error below has something to do with it:
10:46:52: ERROR[main]: set_mapgen_params(): flagmask field is deprecated, see lua_api.txt

Posted: Mon Mar 10, 2014 16:32
by Gael de Sailly
You have found this error in the debug.txt ? Strange, considering I have no error ! I have Minetest 0.4.9 on Ubuntu.
But, it is true, the map generation is slow. I know it is very faster to use the voxel manipulation, instead of minetest.set_node.
I make the base map generation by the voxel manip, but ores and tree are generated by minetest.set_node. I've tried to convert the code, but ores and trees uses minetest.find_nodes_in_area, and this function takes existing nodes, and not voxelmanip datas.

Posted: Mon Mar 10, 2014 17:44
by Gael de Sailly
Here is the list of all the changes my mod allows :
  • Fir tree, grows at high altitude
  • Oak tree, make dense forests with beeches
  • Birch tree, grows in plains, in sparse stands
  • Beech tree, temperate forest, with oak tree
  • Cherry tree
  • Mirabele tree
  • Plum tree (these last 3 trees grows at the edge of the forest, usually with beech and birch trees.)
  • Fruitleaves : it is simply leaves which grow on orchard trees, when you dig it, it is turned into normal leaves and you get a fruit
  • Willow tree, near water, or in muddy places
  • Ginkgo tree, relatively rare, in plains near oak forests.
  • Lavender, bush with blue-green leaves, produces flowers, found in dry areas, in medium altitude.
  • Jungle tree (in Vanilla game, it exists but it is not active), very dense forests in hot and wet places.
  • Jungle grass (same thing)
  • Seasons (1 year correspond to 4 hours)
  • Clock
  • Volcano biomes (larges areas of stone, gravel and lava, relatively rare)
  • Mud (it flows like water but it is brown) Found at 2-3 nodes underground. In steep landscapes, we can sometimes find mud coolings.
  • Oil (can be found in deep underground, between 120 and 200 nodes under sea level). Note that it is very unhealthy to swim in the oil.
  • Ice have an other look, it is transparent. It appear in winter when the sea freezes. There is also mud ice.
  • Make marquetry houses ! The different species of trees gives wooden planks in different shades of brown.
  • It is possible to craft a sapling by 9 fruits.
  • The base map is completely changed : there are genuine valleys, high mountains (sometimes more than 140 nodes above sea level), and the gravel is more common than in the Vanilla Minetest Game.
  • Ores can be found in other minerals than stone : desert stone and gravel. Note that the gravel is a good source of iron.
I work on rivers, and on the seasonal disappearence and reappearence of flora, and on the trees falling. Come back regulary on this page, my mod is not finished.
How can I put images in the forum ?

Posted: Mon Mar 10, 2014 17:47
by Krock
This mod is cool but as the other players already said, it's a (for a server) heavy mod.
Also, it cuts through desert, and there's suddenly a part of green (and even snowy dirt!) and everywhere around is sand.

Posted: Mon Mar 10, 2014 17:58
by Gael de Sailly
The game begin in January, so it is normal that all the dirt is snowy. But it is a good idea to think about biome blend like in V6 map generation, and about the place of the desert. Now, it isn't placed in the warmer places.

Posted: Mon Mar 10, 2014 19:05
by Gael de Sailly
Yes, but it is not very convenient. Anyway, it is not the more important in my mod.

Posted: Tue Mar 11, 2014 12:39
by Gael de Sailly
I've tried to create buckets of mud and oil but it has not work. I've tried to use the function bucket.register_liquid but it is unknown. I think my mod is loaded before Bucket.
So I have questions :
  • What is the rule that define the order in which mods are loaded ?
  • Can I change this order ?

Posted: Tue Mar 11, 2014 17:11
by 4aiman
Gael de Sailly wrote:
  • What is the rule that define the order in which mods are loaded ?
  • Can I change this order ?
Previously I believed that mods are loaded in alphabetical order.
I found that not being the truth, cause "moreores" loaded prior to "4items".

I think that the order is defined by findfirst and findnext functions that are (probably) used for getting the list of mods inside a game's dir. So here the time of creation of a folder with a mod kicks in. But that's only a speculation.

Nevertheless, there's oil mod which adds oil and oil buckets.

Can this be merged (made compatible) with ethereal? Biomes'o'Plenty would die of jealousy :)

Posted: Tue Mar 11, 2014 17:41
by lightonflux
Can you add a recognised license? Free and public doesn't help. And even if you mean PublicDomain,… well we in Germany don't have that legal concept.

The equivalent of Public Domain as a license is CC0. There is also the WTFPL which is very often used for MT mods. And then GPL and BSD.
And you should clear the situation about the third party code.

If you have questions, please ask. Don't have to be here. Open another thread, ask me via PM or IRC or how ever you want. :)

Posted: Tue Mar 11, 2014 17:58
by paramat
Gael de Sailly wrote:What is the rule that define the order in which mods are loaded ?
Can I change this order ?
The 'depends.txt' file speciies which mods are to be loaded before yours, add 'bucket' to this file on a new line under 'default'.

Posted: Wed Mar 12, 2014 08:49
by Gael de Sailly
lightonflux wrote:Can you add a recognised license? Free and public doesn't help.
I don't know what license can I write because I don't know what's what about law texts.
paramat wrote:The 'depends.txt' file speciies which mods are to be loaded before yours, add 'bucket' to this file on a new line under 'default'.
Thank you ! It works ! I've added the new version of my mod (1.1)

Posted: Wed Mar 12, 2014 10:09
by 4aiman
Sorry for insistence, but could you make this terrain generator compatible with ethereal?
Maybe as a sky realm?

Posted: Wed Mar 12, 2014 12:25
by Gael de Sailly
What is Ethereal ? The question may be obvious, but I'm a beginner. I program mods in LUA, that's it ! I have already heard this word, and I've searched on the Web, but I've not understood wholly, and I do not see the link with Minetest.

Posted: Wed Mar 12, 2014 12:40
by thetoon
Gael de Sailly wrote:What is Ethereal ?
It's a mod. You should take a slightly more thorough look at the forums, it could help.

Posted: Wed Mar 12, 2014 13:04
by Sokomine
This is a very intresting mod which adds quite a lot to the game. It deserves a longer description in the first posting and a few screenshots that show players what to expect :-) Else readers might just move on to the next topic and never realize what they miss.

Unfortionately, mapgen is extremly slow. There are alternatives to lua voxelmanipulator which may speed up tree generation considerably. One is L-System, which is used for example for the huge trees in the moretrees mod. It allows each tree to be individual. The other option are schematics. Those are used for example for the trees (and other structures) in the ethereal mod. Schematics have the advantage that they can be placed very fast and easy, especially with mapgen v7. See ethereal for that. Of course they also have a disadvantage: Tree shapes may be less diverse than with L-System. You may add a probability for a node to appear when the schematic is placed - but that's about it. Astonishingly enough, that is enough. The trees in ethereal look convincing, and the ones in RealTest do as well. RealTest does not use schematics, but the trees are always the same shape depending on species. And it does look well enough in the "world".

Another point are the wood colors. Yours look very realistic (perhaps the cherry wood ought to be darker?). I'd prefer a diffrent approach here - more like the one in RealTest: Distinctly diffrent colored wood to build with. In reality, we usually do not build with plain wood, but put glaze and paint on it which makes the wood look pretty diffrent. With diffrent tree species, the wood colors can be exaggerated so much that you don't need any extra glaze anymore and can build nice houses.

Turning the mod into a modpack would also be nice. That would allow to use the trees (you can never have enough trees in a world :-)) in combination with other mapgen mods and in other worlds.

And please add screenshots to your fist posting :-)

Posted: Wed Mar 12, 2014 19:26
by paramat
Interesting mod ... There is a way to generate trees fast within the lua voxel manipulator, without using L-systems or schematics, and with as much randomness and variation as you want, see my recent mapgens.

EDIT
Also, you'll notice a huge increase in mapgen speed when using the new perlin maps, which calculate perlin noise in bulk, creating 80x80 or 80x80x80 flat arrays of noise values to be used by the mapgen loop.

Posted: Thu Mar 13, 2014 08:17
by 4aiman
Here is ethereal.

Mapgen speed is good enough for a 2 cored Intel (R) Atom (1.6Ghz) CPU.
The only thing that slows down LVM created worlds is debug output.
With output enabled in, for example, paragen I have only 4 fps and rather slow results which are only 2 times faster than set_node().
But when I disable those, then I got 15-22 fps and a world generation as swift as the default mapgen (ie not the one from a mod).

Posted: Thu Mar 13, 2014 08:30
by Gael de Sailly
It's very silly but I'm only 16, so my parents impose me a time limit for using computer. I can't continue programming before Saturday.

Posted: Thu Mar 13, 2014 08:33
by Inocudom
We still need screenshots...

Posted: Thu Mar 13, 2014 09:23
by 4aiman
Gael de Sailly wrote:It's very silly but I'm only 16, so my parents impose me a time limit for using computer. I can't continue programming before Saturday.
No need to worry, take your time :)
*cough* too bad the parents where I live fail to impose almost anything... *cough*

Posted: Thu Mar 13, 2014 09:44
by thetoon
4aiman wrote:*cough* too bad the parents where I live fail to impose almost anything... *cough*
Is it just me, or do you have something on your mind regarding your place, today? ;)