Canyon Mapgen Mod

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Canyon Mapgen Mod

by MillersMan » Tue Apr 05, 2016 23:07

At the moment I'm working on implementing an old idea about maps with rivers that go strictly downhill. I'm doing this in a local fork but I would love to see it added to minetest once it got usable.

Update: The Canyon Mapgen Mod is a C++ based modification/fork of Minetest that brings a mapgen with plausible streams that will flow downhill to join and form bigger rivers. You can check out the code at: https://github.com/MillersMan/minetest_canyon_mapgen/tree/canyon-mapgen

Features implemented:
  • A valley-like map with roughly 1000x1000 nodes (Update: spans the whole MT map now)
  • Rivers with a length of more than 1000 nodes
  • A groundwater-heightmap
  • Groundwater is strictly flowing downhill to form rivers
  • Rivers are strictly flowing downhill until they join with other rivers or leave the map
  • Rivers now also affect the biomes close to them

Current limitations:
  • Supporting area for each river is squared (causes straight cliffs)
  • Groundwater might be above ground at the border of the supporting area
  • Rivers might form loops where they almost touch an uphill part of themselves
  • River beds are currently hacked in so they are always sandy and ignore the biomes

Planed features:
  • Paging of generation structure (would allow rivers spanning the whole MT map with decent performance and only a few MB needed for caching, generation without cache also possible but needs a O(log n) duration instead of O(1) for generation of each chunk where n is the size of the whole MT map in one direction) (Update: is implemented now)
  • Random shape for the supporting area of rivers
  • Lakes and Oceans
  • Waterfalls
  • Rivers in caves
  • Changing humidity for biomes: Currently rain is expected to be evenly distributed over the whole map
  • Glaciers as springs for rivers

Image
Image

160406a.png
160406a.png (945.13 KiB) Viewed 6647 times
Last edited by MillersMan on Sun Jun 26, 2016 19:29, edited 4 times in total.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: Canyon Mapgen Mod

by Krock » Sat Apr 09, 2016 06:35

The preview of your mapgen looks good but would it be possible for you to adjust the scaling of the map calculation?
Currently the terrain looks a bit too small. Walk 15 nodes and you've got into a river again. For builders, who would like to have a nice landscape, it would be helpful to have larger and flatter areas.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Canyon Mapgen Mod

by paramat » Sat Apr 09, 2016 22:00

Interesting, something i have wanted to work on, a big challenge, good luck.
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Sun Apr 10, 2016 11:12

paramat wrote:Interesting, something i have wanted to work on, a big challenge, good luck.


Thanks a lot. I just finished the paging which is necessary to have rivers potentially spanning the whole map without having to calculate the map at once.

160411.jpg
Shows how generation structure is split into chunks of 64x64 with stone-borders whereas the first post used one single 1024x1024 chunk
160411.jpg (176.64 KiB) Viewed 6647 times


Here are some details in case anyone wants to try a similar approach from scratch:

I'm generating the rivers together with the landscape as inserting them to finished landscapes will take to much resources for a real-time-generation. I'm using a fractal like approach where I start off with a very low-resolution map and adding details with each iteration. Therefore I can't use complete noise-generators and instead creating the noise together with the whole map. The most basic map in current implementation would create a single NoiseMap (currently ValueNoise instead of PerlinNoise which would be more balanced) with the following properties:
* lacunarity: 2.0 (fixed)
* octaves: fractal iterations / 2 (=10)
* spread: size of whole map (=65536)
* persist: no limitations
* offset and scale: no limitations, but have different values as they are applied per round

I'm currently using two such maps (ground-water-level and ground-level) and another map which contains the location and direction of rivers. At each iteration I'm adjusting all noise-values so that they fit to all noise-values of grid-neighbours without breaking any of the rules.
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Sun Apr 10, 2016 11:32

Krock wrote:The preview of your mapgen looks good but would it be possible for you to adjust the scaling of the map calculation?


I'm planning to fine-tune it once the basic stuff works reliably. The current density of rives has the advantage that it's easy to spot potential issues without having to travel a lot. Some issues on my list are:
  • Avoiding touching of different rivers or sections of rivers (e.g. there is a small loop in the screen-shot of my first post. Or there are two separate rivers almost touching in my second screenshot).
  • Avoiding that small rivers on mountain-tops touch cliffs, cause waterfalls and then flow on to the other side of the mountain.
  • Reducing the chance that rivers build canyons straight through the biggest mountain in the area
  • Expanding rivers so that they might be bigger than a single node
  • Finally creating real mountains and plains as currently everything is just a single noise-function
Of course there is a lot more on my list but those are the priorities.
 

User avatar
prof-turbo
Member
 
Posts: 518
Joined: Mon May 07, 2012 17:02

Re: Canyon Mapgen Mod

by prof-turbo » Sun Apr 10, 2016 13:04

This looks like a cool and hard thing to make. Good luck !

Will you share your work soon ?
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Sun Apr 10, 2016 21:55

prof-turbo wrote:Will you share your work soon ?


I'm planning to get it more stable, do a clean-up and to adjust it to the MT coding style before release. I hope to get to this state in the next weeks, but it really depends on my time and motivation.
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: Canyon Mapgen Mod

by twoelk » Mon Apr 11, 2016 00:28

paramat wrote:Interesting, something i have wanted to work on, a big challenge, good luck.

deja vu?
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Mon Apr 11, 2016 21:20

twoelk wrote:
paramat wrote:Interesting, something i have wanted to work on, a big challenge, good luck.

deja vu?


@paramat: Oh, I wasn't aware that there is a mod with similar goal and same name. I hope this doesn't bother you. Maybe I should rename it...
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Mon Apr 11, 2016 22:31

Some updates with biomes/decoration enabled:

160412.jpg
Relative close to the source with a waterfall in the background
160412.jpg (156.58 KiB) Viewed 6647 times


160412a.jpg
Somewhere more downstream, the waterfall in the middle is a bug, the right one is a small river from an higher region.
160412a.jpg (194.32 KiB) Viewed 6647 times


160412b.jpg
And another one
160412b.jpg (147.43 KiB) Viewed 6647 times


Unfortunately rivers are still limited to a width of one node.
 

User avatar
prof-turbo
Member
 
Posts: 518
Joined: Mon May 07, 2012 17:02

Re: Canyon Mapgen Mod

by prof-turbo » Tue Apr 12, 2016 18:00

Ow. That gets really interesting !
Is it a lua mapgen or a C++ one ?
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Tue Apr 12, 2016 20:26

It's a C++ one. It's just easier to code it in the language I use at work every day (Actually it's C++11, but it could be easily ported back to MT style)
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Wed Apr 20, 2016 22:25

I'm currently preparing a first version for code-release. It's still very rudimentary and has a lot of rough edges (or better blocky canyon walls) but here are a few other screens:

bigger-river.png
bigger-river.png (716.76 KiB) Viewed 6647 times


canyon-at-night.png
canyon-at-night.png (445.69 KiB) Viewed 6647 times


What pages are proposed for image-upload? I don't want to spam the forum with my screen-shots and I'm also not able to inline attachments in the posts :(
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Canyon Mapgen Mod

by azekill_DIABLO » Thu Apr 21, 2016 10:28

i just love this :)

you can also do [img]the%20url[/img]
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Canyon Mapgen Mod

by paramat » Thu Apr 21, 2016 11:13

No problem, my mod is called 'canyon' but it's not essential to avoid that exact name.
My mod is very different and very simple, no attempt at realistic rivers that go downhill.
Good work.
I and some others use http://imgur.com/ it has a limit of 100-200 images.
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: Canyon Mapgen Mod

by ExeterDad » Thu Apr 21, 2016 12:26

Hi MillersMan.

Attach you images as you have done already. When it/they are uploaded, right click and copy link location. Then use the "img" tag and paste the copied image url into it. It will look like this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
[img]https://forum.minetest.net/download/file.php?id=5897[/img]


And it will appear like this when posted:
Image

Repeat as needed up to three attachments per post.
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Thu Apr 21, 2016 23:10

I've forked minetest and pushed my changes:
https://github.com/MillersMan/minetest_canyon_mapgen/tree/canyon-mapgen

I'll also update the initial post.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Canyon Mapgen Mod

by paramat » Fri Apr 22, 2016 10:27

You need 2 more files changed, see my watershed branch as an example https://github.com/paramat/minetest/tree/rivergen
If you feel like contributing to the engine we could do with more C++ talent, see the issues/PRs at github and maybe chat to us on IRC dev channel.
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Fri Apr 22, 2016 15:30

Oh, thanks, shouldn't commit and push the changes late at night, reverted the CMakeList.txt to undo the C++11 related changes and forgot that it is also needed for listing the source-code. Should be updated now.
 

User avatar
Gael de Sailly
Member
 
Posts: 475
Joined: Sun Jan 26, 2014 17:01
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly

Re: Canyon Mapgen Mod

by Gael de Sailly » Sun Jun 19, 2016 21:49

That looks great. I'm very interested in this project. I've tried to understand the code but I… didn't managed :D
I've been trying for months to find an algorithm for creating rivers this way, that really intersects properly. I've never managed to get this.
Could you describe broadly how it works? I'd love to work on it with you!
Really, congratulations.
Very busy this year too, so do not expect me to be very active on the forum or in game. But I'm not about to drop Minetest forever :)
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Sun Jun 26, 2016 18:09

I've pushed a new version.

This version slightly improved river-routing and grew the mountains. Rivers now also affect the biomes. They have a more average temperature and a higher humidity.
 

MillersMan
Member
 
Posts: 13
Joined: Tue Apr 05, 2016 22:03

Re: Canyon Mapgen Mod

by MillersMan » Thu Dec 08, 2016 22:20

Image

Nice location while testing some changes: Two rivers and a small stream join to form a bigger river. The only strange thing is that the rivers come from the mountains while the small stream goes on in valley.

In other news: I'm working on a more generic implementation that might be modable.
 


Return to Minetest-Related

Who is online

Users browsing this forum: No registered users and 4 guests

cron