Diamond-square mountain landscape generation

Post Reply
vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Diamond-square mountain landscape generation

by vladts » Post

Hello!

I'm writing mapgen, which creates landscapes with diamond-square algorithm. It can create realistic mountains and hills.

Now i have implemented creation of volcanic islands (on attached image) with this algorithm
Image
Image
Image
https://github.com/minetest/minetest/pull/11216
Attachments
island.jpg
island.jpg (740.03 KiB) Viewed 980 times
island.jpg
island.jpg (633.01 KiB) Viewed 980 times
island.jpg
island.jpg (618.6 KiB) Viewed 980 times

DOOM_possum
Member
Posts: 172
Joined: Sat Mar 27, 2021 22:06
In-game: DOOM_possum

Re: Diamond-square mountain landscape generation

by DOOM_possum » Post

wow, that's a sick One

User avatar
Linuxdirk
Member
Posts: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Diamond-square mountain landscape generation

by Linuxdirk » Post

Looks cool so far, with some decorations and some vertical biomes (tree line, snow cap) this would be a pretty decent mountain. Maybe add a setting for the maximum and minimum height of generated mountains (biomes should scale accordingly). I'd love to see realistically high mountains (3000-8000 nodes), not everywhere but in some places this would be pretty cool.

Needs something that worth climbing the mountains, though. Either inside (some ores) or on top (hidden chest with awesome loot?).

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

Linuxdirk wrote:
Wed Apr 21, 2021 07:32
I'd love to see realistically high mountains (3000-8000 nodes)
It's not a problem to generate such big mountain, but it's a problem to display it whole. Minetest became VERY slow on huge areas with visible nodes. Even landscapes with mountains with height=500 can not be displayed with normal FPS if you set infinite view range distance

User avatar
Linuxdirk
Member
Posts: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Diamond-square mountain landscape generation

by Linuxdirk » Post

vladts wrote:
Wed Apr 21, 2021 07:50
It's not a problem to generate such big mountain, but it's a problem to display it whole. Minetest became VERY slow on huge areas with visible nodes. Even landscapes with mountains with height=500 can not be displayed with normal FPS if you set infinite view range distance
Yes, it's a pity that MT has such heavy performance issues (did some long-term testing some time ago and came to the conclusion that everything larger than roughly 300 nodes causes various issues regardless of other settings). Super high mountains would be cool anyways.

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

Linuxdirk wrote:
Wed Apr 21, 2021 08:00
everything larger than roughly 300 nodes causes various issues
I think this can be fixed, if far-away landscape would be displayed not as nodes, but as smooth polygon approximation.

User avatar
sorcerykid
Member
Posts: 1847
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: Diamond-square mountain landscape generation

by sorcerykid » Post

vladts wrote:
Wed Apr 21, 2021 15:42
I think this can be fixed, if far-away landscape would be displayed not as nodes, but as smooth polygon approximation.
That would be an astounding accomplishment, if it's truly possible! I'm imagining a fog-like silhouette for distant nodes (no textures, just a solid color with translucency based on distance), I'm sure that would dramatically reduce the rendering overhead, and would permit significantly greater viewing range.

User avatar
Linuxdirk
Member
Posts: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Diamond-square mountain landscape generation

by Linuxdirk » Post

sorcerykid wrote:
Wed Apr 21, 2021 15:51
vladts wrote:
Wed Apr 21, 2021 15:42
I think this can be fixed, if far-away landscape would be displayed not as nodes, but as smooth polygon approximation.
That would be an astounding accomplishment, if it's truly possible!
It once was but it was a bad implementation and eventually was removed due to incompatibility with more recent world generators.

But that’s not my point.

Just imagine this: https://www.youtube.com/watch?v=apXAoyKkjDs

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

Linuxdirk wrote:
Wed Apr 21, 2021 18:30
It once was but it was a bad implementation
In which version it was?

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

sorcerykid wrote:
Wed Apr 21, 2021 15:51
I'm imagining a fog-like silhouette for distant nodes (no textures, just a solid color with translucency based on distance)
There are not always fog in mountains

Image

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

About displaying far away areas, i think at distance, where 16x16 block looks small enough, we can display it as single block (like on the video above). It will decrease displayed cubes in big areas in about 16*16*16=4096 times, and allow to significally increase viewing distance

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

Or like this:

Image
Attachments
smooth.jpg
smooth.jpg (231.2 KiB) Viewed 980 times

User avatar
Linuxdirk
Member
Posts: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Diamond-square mountain landscape generation

by Linuxdirk » Post

vladts wrote:
Thu Apr 22, 2021 07:56
Linuxdirk wrote:
Wed Apr 21, 2021 18:30
It once was but it was a bad implementation
In which version it was?
It was removed on 0.4.8 release in 2013 because it was broken.

User avatar
freshreplicant
Member
Posts: 228
Joined: Sun Aug 09, 2020 10:37
In-game: freshreplicant

Re: Diamond-square mountain landscape generation

by freshreplicant » Post

Linuxdirk wrote:
Wed Apr 21, 2021 18:30
sorcerykid wrote:
Wed Apr 21, 2021 15:51
vladts wrote:
Wed Apr 21, 2021 15:42
I think this can be fixed, if far-away landscape would be displayed not as nodes, but as smooth polygon approximation.
That would be an astounding accomplishment, if it's truly possible!
It once was but it was a bad implementation and eventually was removed due to incompatibility with more recent world generators.

But that’s not my point.

Just imagine this: https://www.youtube.com/watch?v=apXAoyKkjDs
Had a look at the other videos - wow. That is impressive stuff. Wonder if it will be open source? Looks like he runs Windows, so it might not run natively on Linux either.

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

Linuxdirk wrote:
Thu Apr 22, 2021 08:49
It was removed on 0.4.8 release in 2013 because it was broken.
When it has appeared? I'm trying 0.4.6 and don't see it

User avatar
Linuxdirk
Member
Posts: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Diamond-square mountain landscape generation

by Linuxdirk » Post

vladts wrote:
Thu Apr 22, 2021 09:11
When it has appeared? I'm trying 0.4.6 and don't see it
2011: farmesh is now usable.

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

It looks like heightmap. Yes, this can not work with more complex landscape

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

Image

mountain range
Attachments
range.jpg
range.jpg (660.31 KiB) Viewed 980 times

User avatar
Linuxdirk
Member
Posts: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Diamond-square mountain landscape generation

by Linuxdirk » Post

vladts wrote:
Thu Apr 22, 2021 10:39
mountain range
Can you generate lakes in the mountains or only at sea level? Mountain lakes would be awesome!

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

Now i simply fill all air with height <= 5 with water. To create mountain lakes i need to write code to detect places, where they are possible

vladts
Member
Posts: 23
Joined: Tue Jan 31, 2017 23:08

Re: Diamond-square mountain landscape generation

by vladts » Post

Also I think that it would be useful to allow to create mountain after map is generated. So there should be some API for calling mapgen from lua. Is it possible now?

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests