Page 9 of 18

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Sat Jan 02, 2016 23:59
by duane
blert2112 wrote:Using the C mapgen... How can I mellow out the terrain some? It's a bit too mountainous for my liking and I would like some flatter areas. Going to play with the noises a bit and see what happens in the mean time.
The first thing I'd try would be doubling or tripling the spread [(n,n,n)] of the river and valley fill noises, which will spread the features over a wider area. Be careful not to change the ratio of the numbers within each spread [fill is always (1,2,1)]. You could also try reducing the scale [second integer] of the terrain height and valley depth to flatten everything.
blert2112 wrote:BTW, I still get Lua OOM crashes a plenty even with just the helper mod installed. ... Yes, yes... it's LuaJit's problem, well there are ways around that but no one seems to care too much. (Sorry, ranting) Anyway, I recompiled without LuaJit so we shall see if that helps.
I run a ten-year-old lenovo T61 laptop with 4G of memory, and I constrain minetest so that only 3G are available to it. I also compile with LuaJit, but I hardly ever see out-of-memory errors. I used to get them a lot when I was using 512-pixel textures, but I scaled back to 128-pixel. I can force one by exploring as fast as possible (flying) for a half-hour or so, but if I rest any, the game usually drops enough visible chunks to keep going.

I use these mods: body_pillow caverealms datastorage delete_unknown farming_plus gemalde integral kpgmobs mapp mobs mobs_bat mobs_birds mobs_butterfly mobs_crocs mobs_fish mobs_goblins mobs_jellyfish mobs_sharks mobs_turtles polbox slimes unified_inventory valleys_c wallhammer

I'm running Debian stable, so almost everyone here has a more modern operating system than I do. The newer versions of the libraries could be an issue.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Sun Jan 03, 2016 02:45
by blert2112
Thanks, I will try fiddling with those numbers.

I have tried so many different build configurations the past two days trying to figure it out. It never fails, the game always crashes with OOM. The only thing that seems to "fix" it is compiling without LuaJit. LuaJit3 is not supposed to have this limitation but who knows when that will happen. Any idea what kind of performance hit I should expect by not using LuaJit? I would compare the two but the crashes forbid that.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Sun Jan 03, 2016 02:49
by paramat
> I want to keep the fast flag. I kind of like the terrain it generates, and it is about 25% faster so far.

That's fine to keep it.
Good work, i'm busy but will review the PR as soon as possible.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Sun Jan 03, 2016 20:02
by Gael de Sailly
Gone for some time, again :/

I've not found the time to change plants parameters. Sorry.
Is there anyone that can do it?

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Mon Jan 04, 2016 09:49
by duane
paramat wrote:>i'm busy but will review the PR as soon as possible.
No hurry. Let me know if I can help.

Valleys C++ With Lua Features

Posted: Mon Jan 04, 2016 10:10
by duane
I've started a project based on the Valleys Mapgen master which puts the original's soil types and vegetation into the Valleys C++ mapgen (using most of the same code and encountering all of the same problems). You can download the zip here.

It automatically selects Valleys C++ as the mapgen, so you obviously have to have compiled the C++ code here. It looks very familiar, but there are still problems with the beaches. It's fairly slow on my machine. I'd be interested to know how it works for others.

Is it lua or is it C++? [It's both!]

Image
Gael de Sailly wrote:I've not found the time to change plants parameters. ... Is there anyone that can do it?
I'll take a look at the plant parameters as I can, but I'm really not sure what to do with them.

Re: Valleys C++ With Lua Features

Posted: Mon Jan 04, 2016 16:26
by blert2112
duane wrote:I've started a project based on the Valleys Mapgen master which puts the original's soil types and vegetation into the Valleys C++ mapgen (using most of the same code and encountering all of the same problems). You can download the zip here.

It automatically selects Valleys C++ as the mapgen, so you obviously have to have compiled the C++ code here. It looks very familiar, but there are still problems with the beaches. It's fairly slow on my machine. I'd be interested to know how it works for others.
So, what is the difference between this one and the 'valleys_c' helper mod?
Seems no slower than the 'valleys_c' mod for me, generation feels about the same. Also get a lot of fir trees that look like this...
Image
Is that by design?
Darkage is an optional dependency... If you use my fork of Darkage (the 'reg_ore-FIX' branch) you can speed it up a bit as I have converted it to register_ore (type 'sheet')

Re: Valleys C++ With Lua Features

Posted: Mon Jan 04, 2016 23:08
by duane
blert2112 wrote:So, what is the difference between this one and the 'valleys_c' helper mod?
The helper mod uses the v7 biomes and the decoration manager, and doesn't have any extra soil types at the moment. This one shares most of its code with the original and is similarly incompatible with decorations.
blert2112 wrote:Darkage is an optional dependency... If you use my fork of Darkage (the 'reg_ore-FIX' branch) you can speed it up a bit as I have converted it to register_ore (type 'sheet')
I'm going to take the Darkage references out. They don't have any effect on this code. In fact, they probably aren't necessary in the original since it inserts itself at the head of the voxelmanip queue now.

I don't know what the deal with the trees might be. I'll look at it.

Edit: Yes, that's happening in the original as well. I think the top rings sometimes end up being so narrow that they don't actually produce any leaves. Although in one case, it looks like the top leaves were displaced about eight meters.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Wed Jan 06, 2016 21:09
by Nathan.S
Flowers seem to be very rare in my worlds with this mapgen, I looked at the code for the flowers and it looks like they are being placed as mgv6 decorations. I know very little about mapgen, is there a version of mgv7 decorations that I can change/add to the code so I'll get flowers back?

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Wed Jan 06, 2016 21:41
by sofar
Nathan.S wrote:Flowers seem to be very rare in my worlds with this mapgen, I looked at the code for the flowers and it looks like they are being placed as mgv6 decorations. I know very little about mapgen, is there a version of mgv7 decorations that I can change/add to the code so I'll get flowers back?
mgv7 decorations are provided to mapgen from lua, so you can just clone e.g. mapgen.lua from the default minetest_game and get those decorations. However, you'd have to make sure you're not creating conflicting or overlapping biomes.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Wed Jan 06, 2016 21:52
by Nathan.S
Thanks sofar, I'll take a look into that.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Thu Jan 07, 2016 03:09
by duane
Nathan.S wrote:Flowers seem to be very rare in my worlds with this mapgen, I looked at the code for the flowers and it looks like they are being placed as mgv6 decorations. I know very little about mapgen, is there a version of mgv7 decorations that I can change/add to the code so I'll get flowers back?
Decorations (including flowers and trees) are placed by valleys_mapgen/mapgen.lua or valleys_mapgen/plants*.lua in the all lua versions of Valleys. In the C++, they're placed by the default game's flowers mod unless you use the valleys_c or valleys_mapgen for C++ mod, in which case they're placed by the valleys_c/deco_plants.lua or valleys_mapgen/plants*.lua.

The default game uses decorations which depend on a perlin noise and biomes. The Valleys lua places them based on humidity, temperature, soil type, and other factors. The valleys_c mod copies the default game's v7 decoration code, for the most part, though it adds more flowers in jungles.

The default game looks at mg_params.mgname to determine what mapgen is running (which always gives "valleys" or "singlenode" depending on which [non-mod] mapgen you selected). Version 7 decorations are the default unless v6 is selected, so v6 decoration code shouldn't ever run in Valleys.

If you want to increase the flowers, you'll have to edit either valleys_c/deco_plants.lua or valleys_mapgen/plants.lua, or minetest_game/mods/flowers/mapgen.lua, if neither of those exist.

Edit: Well, of course, you could just modify the temperature, humidity, and soil noises to make conditions more favorable for flowers in any game.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Thu Jan 07, 2016 04:17
by Nathan.S
Thanks for the response Duane I think I got it. I needed a single red flower to make some dye and spent a whole Minetest day walking to find no flowers, I made a few changes and now they are a little more available.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Sat Jan 09, 2016 06:31
by duane
sofar wrote:
amadin wrote:Only now I noticed the almost complete absence of grass (default_grass_1, default_grass_2 etc) and flowers on many big areas
So what needs to happen is plants.lua needs to have several listings placing different densities and grass lengths in all the biomes. I'd say it'll end up being 20 or so register_plant lines to fix or at least make a decent spread and variation.
Ok, I've finally had time to put your idea in and test it. It is producing more grass, but it may not be enough for some. If I change the soil parameters any more, we'll end up with grass on bare clay and sand (which happens, but I've never seen it last long). It grows longer in better soil, but I've removed it from the dry grassy nodes since that looked odd.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Thu Jan 14, 2016 07:30
by paramat
C++ version is now merged into the engine.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Thu Jan 14, 2016 18:34
by cHyper
+1 good work ...

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Thu Jan 14, 2016 22:18
by Xanthin
Testing it again with default values, I like that the generated landscape doesn't look so rough like in the version I tested before.

What I've noticed now are patches where the river steps over the riverbed like here.
image riverbed
It doesn't look too bad, but causes more grass to dirt transformations then.

What I thought that will change for the final version is the single source placement of water/lava in caves (often both types close together).
image water/lava cave
Is this an intended behaviour or will it be changed in the future?

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Fri Jan 15, 2016 00:33
by duane
cHyper wrote:+1 good work ...
Thank you, and thanks to everyone who helped put this together, especially Gael de Sailly and paramat.
Xanthin wrote:What I've noticed now are patches where the river steps over the riverbed like here.
Unfortunately, I had to choose between that and really high banks in places where the river happens to be low. We can add another parameter for the actual water depth to make that adjustable. My concern was that people would get irritated if they fell into a river and couldn't get out immediately.
Xanthin wrote:What I thought that will change for the final version is the single source placement of water/lava in caves (often both types close together). Is this an intended behaviour or will it be changed in the future?
Simple caves work that way by design. Putting in groups of sources requires another noise, ideally a 3D noise, which I was trying to avoid since speed is one of the few advantages of the C++ version, and the appeal of Valleys tends to be focused above ground. Nodes appear randomly on the floor of any cave.

I had intended to make the version 7 caves available as well, but the most efficient way to do that involves templates, and some of the people compiling had issues with those. How and where would you like to see lava/water spawn?

C++ Support In The Lua

Posted: Fri Jan 15, 2016 01:23
by duane
The project I started to use the lua in the main Valleys Mapgen project is now merged into the "mc" branch of the main project. You can download a zip file, here.

Once you've downloaded, unzipped and renamed the directory, you can use Valleys Mapgen normally, or if you select "valleys" as your mapgen from the latest Minetest daily/source, the lua will adapt itself to plant decorations and soil types on the C++ generated landscape. This should reduce the time it takes to create a chunk of map by at least half.

The only drawback I can see is the duplication of settings required for fully lua compatibility. I'm not sure there's an easy way around that, but the extra lua settings are ignored while the C++ mapgen is in use. Also, you can't switch mapgens without creating a new world.

Image

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Fri Jan 15, 2016 03:52
by Don
Congrats on your mapgen getting added minetest. Your work is great! Thanks for everything you do.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Fri Jan 15, 2016 07:56
by twoelk
duane wrote:Also, you can't switch mapgens without creating a new world.
duh?

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Fri Jan 15, 2016 22:11
by Gael de Sailly
paramat wrote:C++ version is now merged into the engine.
Thank you very much !! :)
Works well, very fast (reduce the lag by 4 times).

Thank you duane for sustaining this mod :)

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Fri Jan 15, 2016 22:28
by Nathan.S
I'm going to have to see if I can change my subgame to use the C++ mapgen, would love to have the speed increase, though I've never really noticed any problems with that on either of my machines.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Sat Jan 16, 2016 07:08
by paramat
The C++ version helps when travelling by boat, because there is very little lua lag which of course makes the boat misbehave.

> What I've noticed now are patches where the river steps over the riverbed like here.

I had to fine tune that in my rivergen branch (mgwatershed) so that it doesn't overflow but it is usually possible to climb out of the water, the fine tuning of the river height needs to be a float not an integer so may not be possible in mgvalleys.

Re: [Mod][WIP] Valleys Mapgen [valleys_mapgen]

Posted: Sat Jan 16, 2016 10:20
by Gael de Sailly
Image
Image
It seems that on dry places, the humidity is higher when climbing up. That should be the contrary.