[Mod] Map generator with Rivers [mapgen_rivers]

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] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

Done and pushed to master

Default is no more needed
It falls back using the default nodes if biomegen is not there, and if default is missing too, generates only stone.
Just realize how bored we would be if the world was perfect.

User avatar
JackAlidade
New member
Posts: 2
Joined: Wed Jan 19, 2022 00:35

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by JackAlidade » Post

Hello Gael,

Your work here is stunning. I've been following the development of this mapgen and am so appreciative that you are willing to share your talent and work. Many thanks, sir!

For a while I've been playing with your older, python-based version (https://github.com/Gael-de-Sailly/mapge ... s/tree/dev) where you supply demo data. I've really enjoyed the general shape of the terrain generated using the python script. The demo data exhibits large, flatter continents with very long river networks, few lakes, and mountains which rise up near the center of the continents, away from the coast. The left half of the attached image is my attempt to summarize the average continent cross-section using the python generator.

In contrast, after cloning the latest lua-based version advertised by this forum thread, I find that the land generated is much more mountainous. The land rises up steeply from the sea shore, the rivers cut deep canyons near the coast, and the lakes are bigger and more frequent. The right half of the attached image is my attempt to summarize the average continent cross-section of the current mapgen.

I was wondering if you could give me some pointers on what values to use in the mapgen_rivers.conf file which might produce landscapes which look more like the landscapes generated by the demo data provided in the older python version you published last year? I've played around with the settings quite a bit, but have not yet been able to get low, flatter areas near the sea and tall inland mountains.
landforms.png
landforms.png (12.49 KiB) Viewed 5072 times

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] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

Hello Jack and welcome to the forum!

Thank you very much for your review.
I can see that you have explored the mapgen pretty much, and I see what you mean, it's true that the landscapes are different between old and new versions (at least with default parameters).
To be honest, I did not really focus on default parameters (yet) since I wrote the Lua version, and they could be improved. I also think it lacks flat areas.

I've done a little bit of experiments this morning, trying to reproduce what my old Python script was generating, and I can suggest you this set of params:

Code: Select all

river_erosion_power = 0.35
river_erosion_coef = 1
np_base = {
	flags = eased
	lacunarity = 2
	persistence = 0.6
	seed = 2469
	spread = (5000,5000,5000)
	scale = 250
	octaves = 9
	offset = 0
}
tectonic_speed = 0
Here the spread (horizontal scale) of np_base is enlarged to 5000, so continents are larger and less steep. Vertical scale has been slightly reduced to 250.
river_erosion_power is reduced, this makes big and small rivers less unequal in term of erosive capacity, so erosion tends to form wider basins/valleys instead of being focused on major rivers and digging canyons. And tectonic variations between simulation steps are disabled.

If you want to use these params by default you can add them in minetest.conf, but prepanded by mapgen_rivers_.
Last edited by Gael de Sailly on Sun Jan 23, 2022 14:11, edited 1 time in total.
Just realize how bored we would be if the world was perfect.

User avatar
JackAlidade
New member
Posts: 2
Joined: Wed Jan 19, 2022 00:35

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by JackAlidade » Post

Thanks for welcome and the guidance! These settings really do get closer to what I love about the older style landscape. Your instructions give me some insight into how to manipulate the settings. Attached is the map view with the exact settings you suggested. The mountains begin much further inland than I was able to achieve in my own experimentation! Thanks again for the help. I'll be watching eagerly to see how this mod develops.
Attachments
mapview.png
mapview.png (219.37 KiB) Viewed 5053 times

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by MisterE » Post

@gael: I'm interested in your thoughts here:
viewtopic.php?f=47&t=27718

User avatar
j0j0n4th4n
Member
Posts: 249
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by j0j0n4th4n » Post

I keep spawning inside of a mountain when using this mod. Is there some configuration I need to edit?
cdb_894a100ddd76

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] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

j0j0n4th4n wrote:
Thu Feb 17, 2022 23:14
I keep spawning inside of a mountain when using this mod. Is there some configuration I need to edit?
No, for now there is no player spawner implemented so you will always spawn at 0,0,0. I have some ideas about how to do it but it is very tricky (horizontal distortion makes terrain height at point quite hard to predict without actually generating the whole thing). I hope to add this for the next update.

For now the best you can do is to grant all privs and fly up to the ground, and if you want to open the world to multiplayer, define a fixed spawn point.
Just realize how bored we would be if the world was perfect.

Pablo.R
Member
Posts: 42
Joined: Thu Mar 24, 2016 12:02
Location: Chile

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Pablo.R » Post

JackAlidade wrote:
Sun Jan 23, 2022 14:08
Thanks for welcome and the guidance! These settings really do get closer to what I love about the older style landscape. Your instructions give me some insight into how to manipulate the settings. Attached is the map view with the exact settings you suggested. The mountains begin much further inland than I was able to achieve in my own experimentation! Thanks again for the help. I'll be watching eagerly to see how this mod develops.
That is a really interesting map, the water only map border make it like a island. How do you obtained it?

[EDIT] Found it in dev version. Awesome!

Pablo.R
Member
Posts: 42
Joined: Thu Mar 24, 2016 12:02
Location: Chile

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Pablo.R » Post

Gael, I has been playing with the dev version, and only can say Thanks!
mapgen_rivers
mapgen_rivers
MTG_Rivers_07B.png (870.94 KiB) Viewed 4756 times

Pablo.R
Member
Posts: 42
Joined: Thu Mar 24, 2016 12:02
Location: Chile

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Pablo.R » Post

Today I found a very weird river.
ksnip_20220404-214503.png
ksnip_20220404-214503.png (940.3 KiB) Viewed 4667 times

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by MisterE » Post

I suggest sinking the rivers so that they have a bank, you can use noise to modulate that too, so some banks are steep, others are shallow.

Also, again I ask for a C++ implementation :)

Even if it can't be merged, it would be nice for servers to have this mapgen as a fast terrain generator.

Even with Jordach's new largescale terrain, which uses mostly noise; while its great; this terrain is another style that would also be nice to have in C++

You could have an option to either have the world end in a waterfall all around or give way to infinite noise-generated ocean all around the border.

Pablo.R
Member
Posts: 42
Joined: Thu Mar 24, 2016 12:02
Location: Chile

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Pablo.R » Post

MisterE wrote:
Tue Apr 05, 2022 18:26
Even if it can't be merged, it would be nice for servers to have this mapgen as a fast terrain generator.
I have using it for some time to generate 60000 x 60000 maps and is already very fast (but you need to adjust the generator parameters to create a map this large).
MisterE wrote:
Tue Apr 05, 2022 18:26
You could have an option to either have the world end in a waterfall all around or give way to infinite noise-generated ocean all around the border.
The dev version of this map generator already has an option to generate only ocean in the map border

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by MisterE » Post

Gael, how do I make the mountains higher?

Pablo.R
Member
Posts: 42
Joined: Thu Mar 24, 2016 12:02
Location: Chile

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Pablo.R » Post

I think that you need to change the scale and/or offset parameter of the np_base noise with a bigger number.

The top mountain high must be something near offset + scale (and the deeper place -1*scale - offset).

Code: Select all

np_base = {
	flags = eased
	lacunarity = 2
	persistence = 0.6
	seed = 2469
	spread = (5000,5000,5000)
	scale = 250
	octaves = 9
	offset = 0
}

User avatar
j0j0n4th4n
Member
Posts: 249
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by j0j0n4th4n » Post

I am playing in 5.7 and for some reason the trees aren't spawning with this mod, neither with the master branch or the v1.0.2.
cdb_894a100ddd76

Pablo.R
Member
Posts: 42
Joined: Thu Mar 24, 2016 12:02
Location: Chile

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Pablo.R » Post

mapgen_rivers is a experimental (proof of concept) mapgen. See it as an alpha release, i.e. not ready to play yet.

But if you include in Minetest Game mapgen_rivers with biomegen mod, it can generate the decorations (trees and others) of the game defined biomes (without biomegen mods there is no decorations).

QBSteve
Member
Posts: 19
Joined: Wed Mar 15, 2023 00:00
In-game: QBSteve

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by QBSteve » Post

I just checked this out, and I think this is a great mapgen!
I managed to load a 62,000 * 62,000 world on a 7 year old potato.
Now all this needs is caves, and I'll be satisfied! :D
Edit: I added a map of the world I made :)
Attachments
Figure_1.png
Figure_1.png (257.4 KiB) Viewed 3614 times
Hello! I'm just some random person with an ancient 7 year old potato that is my laptop :)

User avatar
j0j0n4th4n
Member
Posts: 249
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by j0j0n4th4n » Post

I managed to load a 62,000 * 62,000 world on a 7 year old potato.
Don't you mean 32000 by 32000?
cdb_894a100ddd76

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by ShadMOrdre » Post

j0j0n4th4n,

A Minetest world extends from -31000 to 31000, so yes, 62000 x 62000. That's 62km on each side, so a Minetest worlds volume is 238,328,000,000,000 nodes. That's 238 trillion nodes.


Something to be said in favor of Minetest. :)


Shad

Pablo.R
Member
Posts: 42
Joined: Thu Mar 24, 2016 12:02
Location: Chile

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Pablo.R » Post

If anybody needs a spawn generator for mapgen_rivers, I was working to make one (still basic beta stuff, but working) feel free to use this code (is a WIP that can be taken with CC BY-NC-SA 4.0).

Use the constants (kl_spawn.*) to fine tuning the search to the parameters you use in mapgen_rivers. I tested this with the last mapgen_rivers dev and stable versions of Gael located here https://gitlab.com/gaelysam/mapgen_rivers.


-- KL Spawn
-- Inspired on random_spawn mod by Nathan Salapat and minetest_mod_spawnrand by minenux

kl_spawn = {}

local debug_log_level = "info"
--kl_spawn.dev_mode = minetest.settings:get_bool("kl_utils_dev_mode", false)
kl_spawn.dev_mode = true

local mapgen_limit = tonumber(minetest.settings:get("mapgen_limit")) or 30000
kl_spawn.radius_max = 15000
--kl_spawn.radius_inc = 500
--kl_spawn.spawn_count_coef = 0.0001
kl_spawn.min_spawn_elevation = 1
kl_spawn.max_spawn_elevation = 300
kl_spawn.respawn_max_intents = 30
kl_spawn.emerge_radius = 30
kl_spawn.emerge_area_delay = 1
kl_spawn.new_player_wait_time = 5
kl_spawn.new_player_max_intents = 30
kl_spawn.valid_spawn_node_list = {"group:soil", "group:sand"}


if kl_spawn.radius_max > mapgen_limit then
kl_spawn.radius_max = mapgen_limit
end


--TODO: Optimize search by using river mapgen data
--TODO: start search near (0,0) and progresively aument distance from (0, 0)
function kl_spawn:random_spawn(player, intent)

--can not found a valid spawn pos
if intent >= kl_spawn.respawn_max_intents then
minetest.log(debug_log_level, string.format("[kl_spawn] Can not found a valid spawn position"))
--minetest.log('action', string.format("[kl_spawn] Can not found a valid spawn position, set player pos to (0, 0, 0)"))
--player:set_pos({x = 0, y = 0, z = 0})
else
local posx = math.random(-kl_spawn.radius_max, kl_spawn.radius_max)
local posz = math.random(-kl_spawn.radius_max, kl_spawn.radius_max)
local new_random_node = minetest.get_node({posx, kl_spawn.min_spawn_elevation, posz})
-- if node in unloaded area, delay search
if new_random_node.name == 'ignore' then
minetest.emerge_area(
{x = posx + kl_spawn.emerge_radius, y = kl_spawn.max_spawn_elevation, z = posz + kl_spawn.emerge_radius},
{x = posx - kl_spawn.emerge_radius, y = kl_spawn.min_spawn_elevation, z = posz - kl_spawn.emerge_radius})
minetest.after(kl_spawn.emerge_area_delay,
(function() kl_spawn:find_spawn_elevation(player, {x = posx, y = kl_spawn.min_spawn_elevation, z = posz}, intent + 1)
end))
else
kl_spawn:find_spawn_elevation(player, {x = posx, y = kl_spawn.min_spawn_elevation, z = posz}, intent + 1)
end
end
end


-- TODO: Add checks for protection, specific node types, etc.
-- NOTE: minetest.find_nodes_in_area* functions don't work... maybe are only for standard mapgen?
-- It works, but group value used must be 1
function kl_spawn:find_spawn_elevation(player, pos, intent)

local posx1, posy1, posz1 = pos.x - kl_spawn.emerge_radius, kl_spawn.min_spawn_elevation, pos.z - kl_spawn.emerge_radius
local posx2, posy2, posz2 = pos.x + kl_spawn.emerge_radius, kl_spawn.max_spawn_elevation, pos.z + kl_spawn.emerge_radius

minetest.log(debug_log_level, string.format("[kl_spawn] Searching Spawn Position: intent: %d area: (%d, %d, %d) and (%d, %d, %d)",
intent, posx1, posy1, posz1, posx2, posy2, posz2))

-- area not fully loaded, wait anf force emerge
if #minetest.find_nodes_in_area({x = posx1, y = posy1, z = posz1}, {x = posx2, y = posy2, z = posz2}, "ignore") > 0 then
minetest.log(debug_log_level, string.format("[kl_spawn] Area from (%d, %d, %d) to (%d, %d, %d) not fully loaded waiting",
posx1, posy1, posz1, posx2, posy2, posz2))
minetest.emerge_area({x = posx1, y = posy1, z = posz1}, {x = posx2, y = posy2, z = posz2})
minetest.after(kl_spawn.emerge_area_delay,
(function() kl_spawn:find_spawn_elevation(player, pos, intent)
end))

else
local node_list = minetest.find_nodes_in_area_under_air({x = posx1, y = posy1, z = posz1}, {x = posx2, y = posy2, z = posz2}, kl_spawn.valid_spawn_node_list)
minetest.log(debug_log_level, string.format("[kl_spawn] Found %d Posible Spawn Positions between (%d, %d, %d) and (%d, %d, %d)",
#node_list, posx1, posy1, posz1, posx2, posy2, posz2))

--node_list is empty, retry in another position
if #node_list == 0 then
kl_spawn:random_spawn(player, intent)

--see if node list has a valid position
else
local is_valid_pos = false
local i = 1
local posAux
repeat
posAux = node_list
minetest.log(debug_log_level, string.format("[kl_spawn] Validating pos (%d, %d, %d)",
posAux.x, posAux.y, posAux.z))
local under_node = minetest.get_node({x = posAux.x, y = posAux.y, z = posAux.z})
local current_node = minetest.get_node({x = posAux.x, y = posAux.y + 1, z = posAux.z})
local above_node = minetest.get_node({x = posAux.x, y = posAux.y + 2, z = posAux.z})
-- check above and under for valid position
if current_node.name == 'air' and above_node.name == 'air' and under_node.name ~= 'air'
and minetest.registered_nodes[under_node.name].drawtype ~= 'liquid'
and minetest.registered_nodes[under_node.name].drawtype ~= 'flowingliquid'
then

is_valid_pos = true
else
i = i + 1
end
until i > #node_list or is_valid_pos

-- valid pos found, set new player pos
if is_valid_pos then
minetest.log(debug_log_level, string.format("[kl_spawn] Valid Spawn Position found at position (%d, %d, %d) on node %s",
posAux.x, posAux.y, posAux.z, minetest.get_node(posAux).name))
player:set_pos({x = posAux.x, y = posAux.y + 1, z = posAux.z})
else
kl_spawn:random_spawn(player, intent)
end
end
end
end


-- spawn a new player (can wait if player not exists, for example if world is not generated yet)
function kl_spawn:spawn_new_player(player, intent)
if player ~= nil then
kl_spawn:random_spawn(player, 0)
else
if intent > 0 then
minetest.after(kl_spawn.new_player_wait_time, (function() kl_spawn:spawn_new_player(player, intent - 1) end))
end
end
end


-- random spam in new player join
minetest.register_on_newplayer(function(player)

kl_spawn:spawn_new_player(player, kl_spawn.new_player_max_intents)

end)


-- on player dead respawn in the same position, there is not set home functionality yet
-- it can be replaced with a full random search calling kl_spawn:random_spawn(player, 0) but it afects
minetest.register_on_respawnplayer(function(player)

if player ~= nil then
pos = player:getpos()
player:setpos(pos)
return true
end

end)


--active dev tools
if kl_spawn.dev_mode then
minetest.log(debug_log_level, "[KL Spawn] DEV Mode Active, Registering Spawn Test Chat Command")

minetest.register_chatcommand("search_spawn_pos", {
params = "[here] | [<x, y, z>]",
description = "Search a Valid Spawn Position at the specified position, use here to search at player position or leave empty to do a random search",
func = function(name, param)
local player = minetest.get_player_by_name(name)

if player then
local player_pos = player:get_pos()
-- search a random valid position around player pos
if param == "here" then
minetest.log(debug_log_level, string.format("[KL Spawn] Player %s at (%d, %d, %d) call Spawn Test Chat Command (here)",
name, player_pos.x, player_pos.y, player_pos.z))
kl_spawn:find_spawn_elevation(player, player_pos, kl_spawn.respawn_max_intents)
return true
end

local pos = {}
pos.x, pos.y, pos.z = string.match(param, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
pos.x = tonumber(pos.x)
pos.y = tonumber(pos.y)
pos.z = tonumber(pos.z)

-- no parameters full random search
if not pos.x or not pos.y or not pos.z then
minetest.log(debug_log_level, string.format("[KL Spawn] Player %s at (%d, %d, %d) call Spawn Test Chat Command (Random)",
name, player_pos.x, player_pos.y, player_pos.z))
kl_spawn:random_spawn(player, 0)
return true
end

if (pos.x < -kl_spawn.radius_max) or (pos.x > kl_spawn.radius_max) or
(pos.y < -kl_spawn.radius_max) or (pos.y > kl_spawn.radius_max) or
(pos.z < -kl_spawn.radius_max) or (pos.z > kl_spawn.radius_max) then

return false, "[KL Spawn] Position out of range in search_spawn_pos chat command"
end

-- search a random valid position around pos indicated by the user
minetest.log(debug_log_level, string.format("[KL Spawn] Player %s at (%d, %d, %d) call Spawn Test Chat Command with position (%d, %d, %d)",
name, player_pos.x, player_pos.y, player_pos.z, pos.x, pos.y, pos.z))
kl_spawn:find_spawn_elevation(player, pos, kl_spawn.respawn_max_intents)
return true

end
end,
})

end

Pablo.R
Member
Posts: 42
Joined: Thu Mar 24, 2016 12:02
Location: Chile

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Pablo.R » Post

For who is interested, I have created a 100 times faster version of the spawn logic and liberated it as a module in https://gitlab.com/paanrama/mg_rivers_s ... _type=tags

Also have a liberated a customized new version of mapgen_rivers with the changes that Gael was developing (map border and better rivers) plus other changes (biomegen is required, bury rivers to prevent overflow, a new setting that compensate distort logic to prevent rivers discontinuity and default values tuned for 62000x62000 maps). Default values now generate rivers with 3 to 80 nodes witdh (the really big rivers are not too common because them require a big catchment area). You can find this version in https://gitlab.com/paanrama/mapgen_rive ... _type=tags

There is a copy of biomegen mod (not customized yet) in https://gitlab.com/paanrama/biomegen/-/ ... _type=tags

All this was tested over a month where I generated more than 30 worlds of Minetest Game (standard without additional mods) ten of them over 1GB in size.

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] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

That's very nice that you're still working on this.
I looked into your spawn generator (and tried it!) and it is interesting, I haven't thought about generating parts of the map before searching for spawn, and it seems to work well. It is a really great addition!

I have quickly tested your new version of mapgen_rivers and I am quite interested in the changes you made, especially about the continuity of small rivers, even if I would not, personally, use your default settings. I may merge some of your changes if you are okay.
I hope I can start again working on this project ; winter has come and thus I have no excuse on my free time, but it's gonna be hard to dive again into this project after more than a year.

And merry Christmas to all ;)
Just realize how bored we would be if the world was perfect.

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] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

I'm coding again on mapgen rivers
By reading my code after 2yrs, I'm realizing how much it looks like a bunch of spaghetti (like, a file calls another and transfers functions/data to yet another one...), so I will refactor it before making substantial changes (except merging some of Pablo's changes).

I'm also trying to optimize terrainlib_lua (the code that does erosion simulation during pre-generation). I have identified several bottlenecks in river flow routing code (in particular I suspect my use of the next function to have O(n²) complexity), and I am trying to get rid of as many indexed arrays as possible, to use linear arrays instead, and maybe unroll nested functions. I expect an important speedup (possibly 30-50%, and ability to use bigger arrays without OOM'ing) if I go to the end of this rewrite.

Just to give news and say how happy I am to have found this energy again :)
Just realize how bored we would be if the world was perfect.

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] Map generator with Rivers [mapgen_rivers]

by Gael de Sailly » Post

So I worked on pregen optimization and pushed my changes to master. Flow routing algorithm has been sped up by 56% on my device, which results in an overall speedup of 35% for pregen (it takes only 8 seconds on my 9-yo laptop!). At least for LuaJIT.

I'm very happy with the speed of this pregen code, which went far beyond my initial expectations. IIRC i talked about an hour-ish time when I started this project, which was roughly what I got for my first experiments in Python, and then I learned about more efficient algorithms, and I was also very surprised by the speed of LuaJIT.

So that we could afford adding new features in pregen. There are plenty of things to explore in this direction, like using multiple input noises to produce more varied patterns at large scale and/or transform them with some math, or implement spatially variable erosion parameters. For the latter there is already a piece of code that deals with variable erosion parameters, but it is unused for now; these parameters could depend on noises too, which would bring more variety to the landscapes as well.
Just realize how bored we would be if the world was perfect.

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Map generator with Rivers [mapgen_rivers]

by Nordal » Post

Great that you continue working on mapgen_rivers!
CFS - still widely unknown

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests