[Mod][Merged] Valleys Mapgen [valleys_mapgen]

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

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

by duane » Post

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.
Believe in people and you don't need to believe anything else.

blert2112
Member
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

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

by blert2112 » Post

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.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

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

by paramat » Post

> 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.

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

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

by Gael de Sailly » Post

Gone for some time, again :/

I've not found the time to change plants parameters. Sorry.
Is there anyone that can do it?
Just realize how bored we would be if the world was perfect.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

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

by duane » Post

paramat wrote:>i'm busy but will review the PR as soon as possible.
No hurry. Let me know if I can help.
Believe in people and you don't need to believe anything else.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Valleys C++ With Lua Features

by duane » Post

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.
Attachments
c-demo-54.jpg
c-demo-54.jpg (386.12 KiB) Viewed 481 times
Last edited by duane on Fri Jan 15, 2016 01:59, edited 1 time in total.
Believe in people and you don't need to believe anything else.

blert2112
Member
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

Re: Valleys C++ With Lua Features

by blert2112 » Post

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')
Attachments
screenshot_20160104_111516.png
screenshot_20160104_111516.png (384.45 KiB) Viewed 481 times
screenshot_20160104_111720.png
screenshot_20160104_111720.png (624.76 KiB) Viewed 481 times

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: Valleys C++ With Lua Features

by duane » Post

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.
Believe in people and you don't need to believe anything else.

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

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

by Nathan.S » Post

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?
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

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

by sofar » Post

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.

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

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

by Nathan.S » Post

Thanks sofar, I'll take a look into that.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

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

by duane » Post

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.
Believe in people and you don't need to believe anything else.

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

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

by Nathan.S » Post

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

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

by duane » Post

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.
Believe in people and you don't need to believe anything else.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

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

by paramat » Post

C++ version is now merged into the engine.

u34

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

by u34 » Post

+1 good work ...

Xanthin
Member
Posts: 126
Joined: Fri Mar 07, 2014 14:05
GitHub: Xanthin
IRC: Xanthin
In-game: Xanthin
Location: Germany

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

by Xanthin » Post

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?
Attachments
water/lava cave
water/lava cave
screenshot_20160114_190636.png (231.57 KiB) Viewed 481 times
riverbed
riverbed
screenshot_20160114_190316.png (736.78 KiB) Viewed 481 times

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

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

by duane » Post

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?
Believe in people and you don't need to believe anything else.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

C++ Support In The Lua

by duane » Post

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
Attachments
c-demo-56.jpg
c-demo-56.jpg (265.83 KiB) Viewed 481 times
Believe in people and you don't need to believe anything else.

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

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

by Don » Post

Congrats on your mapgen getting added minetest. Your work is great! Thanks for everything you do.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

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

by twoelk » Post

duane wrote:Also, you can't switch mapgens without creating a new world.
duh?

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

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

by Gael de Sailly » Post

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 :)
Just realize how bored we would be if the world was perfect.

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

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

by Nathan.S » Post

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

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

by paramat » Post

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.

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

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

by Gael de Sailly » Post

Image
Image
It seems that on dry places, the humidity is higher when climbing up. That should be the contrary.
Just realize how bored we would be if the world was perfect.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests