[Mod][Merged] Valleys Mapgen [valleys_mapgen]

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

I got the same error yesterday after it hit 100%. I tried it on Lubuntu 14.04, using the one-line-script (with run_in_place) just with

Code: Select all

git clone -b valleys_c --single-branch https://github.com/duane-r/valleys_c.git;


I'm pretty new in this things, I guess the compiler is from build-essential and there g++ and gcc?

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

Xanthin wrote:I got the same error yesterday after it hit 100%. I tried it on Lubuntu 14.04, using the one-line-script (with run_in_place) just with

Code: Select all

git clone -b valleys_c --single-branch https://github.com/duane-r/valleys_c.git;


I'm pretty new in this things, I guess the compiler is from build-essential and there g++ and gcc?
You're getting the CaveV7plus issue too... Well, the easiest way to take care of that is to revert the cavegen files, which I've just done. Try it now.

Make sure the line you use for the single branch is

Code: Select all

git clone -b valleys_c --single-branch https://github.com/duane-r/minetest.git
since the other address doesn't resolve, at least for me.
Believe in people and you don't need to believe anything else.

Ivà
Member
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua
Location: Catalonia

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

by Ivà » Post

As far as I know, gcc-4.8 throw the errors above but gcc-4.9 is ok. I don't know why anyway, sorry.

MultiCoder
New member
Posts: 5
Joined: Sat Dec 19, 2015 11:59
GitHub: MultiCoders
IRC: Nikoloz
In-game: Nikoloz

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

by MultiCoder » Post

Less jumping more walking plz
2 much mountains imo

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

Ivà wrote:As far as I know, gcc-4.8 throw the errors above but gcc-4.9 is ok. I don't know why anyway, sorry.
The ubuntus are using 5.2.1. Even my Debian stable is up to 4.9.2. If anyone is still using 4.8, they might want to consider upgrading.
Believe in people and you don't need to believe anything else.

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

You're were right, I had the version 4.8 and after upgrading to 4.9, it compiled without an error and runs fine. And yes, it was a bit too early in the morning for me to remember it, ofc it's /duane-r/minetest.git. :)

Ivà
Member
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua
Location: Catalonia

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

by Ivà » Post

duane wrote:
Ivà wrote:As far as I know, gcc-4.8 throw the errors above but gcc-4.9 is ok. I don't know why anyway, sorry.
The ubuntus are using 5.2.1. Even my Debian stable is up to 4.9.2. If anyone is still using 4.8, they might want to consider upgrading.
Ubuntu LTS and Linux Mint are still on 4.8.2. You must install explicitly the gcc-4.9-base package to get the 4.9.1 version.

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

Ivà wrote:Ubuntu LTS and Linux Mint are still on 4.8.2. You must install explicitly the gcc-4.9-base package to get the 4.9.1 version.
Now that's conservative.

However, I just compiled it under 4.8 [on Debian and Mint] without any problems as well, so I don't think that's the only issue.
Believe in people and you don't need to believe anything else.

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

I've compiled it this morning, without any problem, with your bugfix.
The terrain seems smoother, except some vertical cliffs, but I recognize the style. What have you changed precisely ? (just to know, you can merge it in the core anyway :) )

-+-+-+-+-+-+-+-

For the new Lua version: 2.3 or 3.0?
Just realize how bored we would be if the world was perfect.

User avatar
bobomb
Member
Posts: 162
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

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

by bobomb » Post

i like the concept of your biome system -- determined by environmental factors rather than a map or perlin noise. I was thinking that other factors for the biome system could include: slope, aspect, distance to rivers, distance to lakes, distance to urban disturbances, latitude (z), in addition to your use of elevation, plus a random factor. also maybe a tree should have a concept of which trees are near? realterrain mod has methods for calculating slope, aspect, curvature and distance.

i have learned a lot from your code. thanks. i might steal some trees code for realterrain. ;-)

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

Gael de Sailly wrote:What have you changed precisely ? (just to know, you can merge it in the core anyway :) )
It should be pretty much the same, except that I removed as many 3D noises as I could. This is the actual terrain building code, complete with your comments:

Code: Select all

float MapgenValleys::baseGroundFromNoise(s16 x, s16 z, float valley_depth, float terrain_height, float *rivers, float valley_profile, float inter_valley_slope, float *valley, float inter_valley_fill, float cliffs, float corr)
{
	// The square function changes the behaviour of this noise:
	//  very often small, and sometimes very high.
	float valley_d = pow(valley_depth, 2);

	// valley_d is here because terrain is generally higher where valleys
	//  are deep (mountains). base represents the height of the
	//  rivers, most of the surface is above.
	float base = terrain_height + valley_d;

	// "river" represents the distance from the river, in arbitrary units.
	float river = fabs(*rivers) - river_size;
	*rivers = -31000;

	// Use the curve of the function 1−exp(−(x/a)²) to model valleys.
	//  Making "a" vary (0 < a ≤ 1) changes the shape of the valleys.
	//  Try it with a geometry software !
	//   (here x = "river" and a = valley_profile).
	//  "valley" represents the height of the terrain, from the rivers.
	*valley = valley_d * (1 - exp(- pow(river / valley_profile, 2)));

	// approximate height of the terrain at this point
	float mount = base + *valley;

	float slope = *valley * inter_valley_slope;

	// Rivers are placed where "river" is negative, so where the original
	//  noise value is close to zero.
	if (river < 0) {
		// Use the the function −sqrt(1−x²) which models a circle.
		float depth = (river_depth * sqrt(1 - pow((river / river_size + 1), 2))) + 1;
		*rivers = base;

		// base - depth : height of the bottom of the river
		// water_level - 2 : don't make rivers below 2 nodes under the surface
		mount = fmin(fmax(base - depth, water_level - 2), mount);

		// Slope has no influence on rivers.
		slope = 0;
	}

	// The penultimate step builds up the heights, but we reduce it 
	//  occasionally to create cliffs.
	float delta = sin(inter_valley_fill) * slope;
	if (delta != 0) {
		if ((spflags & MG_VALLEYS_CLIFFS) && cliffs < 0.2)
			mount += delta;
		else
			mount += delta * 0.66;

		// Use yet another noise to make the mountains look more rugged.
		if ((spflags & MG_VALLEYS_RUGGED) && mount > water_level && fabs(inter_valley_slope * inter_valley_fill) < 0.3)
			mount += (delta / fabs(delta)) * pow(fabs(delta), 0.5) * fabs(sin(corr));
	}

	return mount;
}
Of course, the surfaces are placed the same way v7 does, and it uses the default decorations, so it ends up looking completely different. Actually, I did double the range of the river/valley noise by default, but that can be changed in the mapgen settings.

I could make it match more closely by using another 3D noise, but that slows it down by almost half. Even as it stands, the other mapgens run noticeably faster.

Here's how it looks at the moment on my system.

Image

Edit: And now that I check it, several of the noises are off. I'm putting them all back to default. Part of the problem is that there are two default sections, one in the settings and one in the code (in case there are no settings).

Yes, that makes a noticeable difference.

Image
Attachments
c-demo-35.jpg
c-demo-35.jpg (406.59 KiB) Viewed 692 times
c-demo-34.jpg
c-demo-34.jpg (420.14 KiB) Viewed 692 times
Last edited by duane on Fri Jan 15, 2016 02:02, edited 1 time in total.
Believe in people and you don't need to believe anything else.

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

Switched to branch new_biomes. I added dry dirt yesterday.
3.0 may come on Christmas.
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:

Screenshots

by duane » Post

I haven't given up on getting Valleys C into the codebase, but it's still proving to be a challenge. Here are some screenshots of my latest attempts.
Spoiler
Image
Spoiler
Image
Spoiler
Image
Spoiler
Image
Spoiler
Image
Spoiler
Image
Spoiler
Image
Believe in people and you don't need to believe anything else.

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

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

by Fixer » Post

Nice!

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

Looks good.

User avatar
kaadmy
Member
Posts: 706
Joined: Thu Aug 27, 2015 23:07
GitHub: kaadmy
IRC: KaadmY
In-game: KaadmY kaadmy NeD

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

by kaadmy » Post

How are villages done for the terrain?
Never paint white stripes on roads near Zebra crossings.

Pixture

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

kaadmy wrote:How are villages done for the terrain?
I haven't really done any villages. I just put some lua in the support project to make random house schematics that get planted as decorations. They show up in ridiculous places sometimes, like hanging over a cliff.


At this point, the C++ code seems to be producing exact duplicates of terrain from the lua (including the occasional floating block), with the nofast flag set. I'll test it thoroughly over the next few weeks.
Believe in people and you don't need to believe anything else.

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

Re: Screenshots

by sofar » Post

duane wrote:I haven't given up on getting Valleys C into the codebase, but it's still proving to be a challenge. Here are some screenshots of my latest attempts.
Just pulled your branch and noticed:

seed: 17472738859635311922

- spawn was quite deep under ground. I'm assuming you haven't paid attention to the spawn position yet.
- floating islands at y+=128, lots of them, clearly disjoint but related to the nearby high topography
- some cut-off trees (topside) suggesting chunks didn't properly finish generating
- lack of flat plains, could just be the seed (I travelled 4km or so +/-)
- could use some more water lilies in some of the near-water biomes, they're really quite rare as well

other than that, appears to work well and fast!

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

Re: Screenshots

by duane » Post

sofar wrote:Just pulled your branch and noticed:

seed: 17472738859635311922

- spawn was quite deep under ground. I'm assuming you haven't paid attention to the spawn position yet.
- floating islands at y+=128, lots of them, clearly disjoint but related to the nearby high topography
- some cut-off trees (topside) suggesting chunks didn't properly finish generating
- lack of flat plains, could just be the seed (I travelled 4km or so +/-)
- could use some more water lilies in some of the near-water biomes, they're really quite rare as well

other than that, appears to work well and fast!
Thanks for the comments.

Make sure you're using the valleys_c branch. I'm going to delete the merge branch, just to avoid confusion. I haven't had any spawn problems since I updated the *AtPoint functions a few hours ago, but I'll check it.

The floating islands are there in the original lua too (in the exact same places). If there's a way of getting rid of them without getting rid of the nice mountains, I don't know it. Of course that's what I did with the fast flag option, but it lacks the character of the original.

You may not find many flat plains. That's a drawback of Valleys. It's all about... well, valleys.

The cut-off trees are a known issue with the decoration manager, and the water lilies (on the sea) are part of the default game. I'm only concerned with the mapgen for the moment. I put some lilies on the rivers with the lua support code, but that's beyond the purview of a C++ mapgen.

"...hung in the sky in much the same way that bricks don't."
Image
Attachments
island.jpg
island.jpg (261.32 KiB) Viewed 692 times
Last edited by duane on Fri Jan 15, 2016 02:06, edited 1 time in total.
Believe in people and you don't need to believe anything else.

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

Re: Screenshots

by sofar » Post

duane wrote: Make sure you're using the valleys_c branch. I'm going to delete the merge branch, just to avoid confusion. I haven't had any spawn problems since I updated the *AtPoint functions a few hours ago, but I'll check it.

The floating islands are there in the original lua too (in the exact same places). If there's a way of getting rid of them without getting rid of the nice mountains, I don't know it. Of course that's what I did with the fast flag option, but it lacks the character of the original
ok, I switched to valleys_c branch and that looks slightly different now (same seed)

The hanging islands here look fine to me, I have nothing against a few floating blocks and these are not as bad as with the old branch, so I'm fine with how it looks. Will let it generate some more terrain ;^)

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

Looks really good, great to see progress and a match to the lua mapgen.

> The cut-off trees are a known issue with the decoration manager

Correct.

Don't bother with the fast flag, if this 3D terrain noise is coded correctly it won't have much impact on mapgen speed, also the surface terrain should be faithful to the lua version and be interesting, however i agree the c++ version needs simple caves using 2 3D noises instead of 5. Am i right in thinking the current c++ cave code is your own duane? it looks fine to me.

Also, the c++ version should perhaps have a larger scale river noise than the original (noise 2 has spread 256 and 5 octaves, this creates small river systems with small river loops), however that can be tuned later when we set the default noise parameters.

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:Don't bother with the fast flag, if this 3D terrain noise is coded correctly it won't have much impact on mapgen speed, also the surface terrain should be faithful to the lua version and be interesting, however i agree the c++ version needs simple caves using 2 3D noises instead of 5. Am i right in thinking the current c++ cave code is your own duane? it looks fine to me.

Also, the c++ version should perhaps have a larger scale river noise than the original (noise 2 has spread 256 and 5 octaves, this creates small river systems with small river loops), however that can be tuned later when we set the default noise parameters.
I want to keep the fast flag. I kind of like the terrain it generates, and it is about 25% faster so far. The simple caves were my take on your Intersecting mod, of course, and they're very light-weight.

I agree about the rivers. The first thing I usually do is double the spread of the river noise (n2 in the original) and the valley fill noise (n6), but then I was raised in the great plains, not the Alps. However, I hesitate to change the defaults from the lua values. People are already accustomed to them, and every time I play with them much I mess things up.
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:

Compare

by duane » Post

Here are screenshots from the same location of the original valleys mapgen and the latest C++. They're not block-for-block the same, but they're very close.

The dark spots on the right in the C++ are caves. They were turned off in lua. I turned off all decorations in C++ because the area was heavily forested.

If anyone spots any problems, let me know.

Image

Image
Attachments
c-demo-53.jpg
c-demo-53.jpg (377.6 KiB) Viewed 692 times
c-demo-52.jpg
c-demo-52.jpg (399.36 KiB) Viewed 692 times
Last edited by duane on Fri Jan 15, 2016 02:08, edited 1 time in total.
Believe in people and you don't need to believe anything else.

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

I've tried using the seed that produces the highest mountain I know (I call it Mount Major).
Spoiler
Mount Major in VMG C++:Image

Mount Major in Lua:Image
Same elevation (278).

Funny structure near the mountain, in VMG C++:Image

The same structure in VMG Lua:Image
Just realize how bored we would be if the world was perfect.

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

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

by blert2112 » Post

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.

BTW, I still get Lua OOM crashes a plenty even with just the helper mod installed. I don't understand why more people don't have this issue... my PC is not old or too wimpy and OOM crashes when there are 4-5GB of free memory just sitting there is beginning to tick me off to the point of just giving up on this game. 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests