[Mod][Merged] Valleys Mapgen [valleys_mapgen]

Post Reply
User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

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

by philipbenr » Post

Code: Select all

WARNING: Undeclared global variable "darkage_mapgen" accessed at ...etest/minetest/bin/../mods/valleys_mapgen/mapgen.lua:589
I keep getting fatal freezes and ^^^ this in my debug.txt when I am exploring a world. I don't have darkage enable FYI.

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

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

by blert2112 » Post

philipbenr wrote:

Code: Select all

WARNING: Undeclared global variable "darkage_mapgen" accessed at ...etest/minetest/bin/../mods/valleys_mapgen/mapgen.lua:589
I keep getting fatal freezes and ^^^ this in my debug.txt when I am exploring a world. I don't have darkage enable FYI.
I get the same global var error. On occasion the game crashes with a "LUA out-of-memory" error. Can't use any other mods that use the VoxelManip reliably? Seems to have a big issue with my Pyramids fork which I converted to VoxelManip, I find very very few pyramids, which is fine, but they are mostly cut in half. Sokomine's mg_villages mod works fine so I may have to find a way to put pyramids into it.

I must say, I really dig this mapgen. I had tried it before but it was crushingly slow. On my new laptop it seems just as fast as v6 (which is what I normally use.. with a crap ton of mods). Frame-rate seems to take a +10 hit during generation though, but it seems to play just fine even when flying around fast. I think I might miss dungeons though, will have to see if I can find a mod to put them back in.

Edit: Which fork of DarkAge is recommended? My fork of DarkAge does not use a LUA mapgen, it uses register_ore instead. I assume my fork will work fine with this mapgen? Still, would like to know which fork of DarkAge you had in mind when you wrote the compatibility part in as I can make my Pyramids fork work in the same way. Also, which noise describes deserts?

Edit again: Oh, how I wish I could use this. :(
The game crashes with a "LUA out-of-memory" error, after about ten of minutes of play, nearly every time. Oh well, I may attempt to compile the c++ version and see how that does, but that is for another day.

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

philipbenr wrote:

Code: Select all

WARNING: Undeclared global variable "darkage_mapgen" accessed at ...etest/minetest/bin/../mods/valleys_mapgen/mapgen.lua:589
I keep getting fatal freezes and ^^^ this in my debug.txt when I am exploring a world. I don't have darkage enable FYI.
That darkage error is a red herring. It shows up normally, and it couldn't have anything to do with freezes.

Is there anything else relevant in your debug output?
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:

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

by duane » Post

blert2112 wrote:Edit again: Oh, how I wish I could use this. :(
The game crashes with a "LUA out-of-memory" error, after about ten of minutes of play, nearly every time. Oh well, I may attempt to compile the c++ version and see how that does, but that is for another day.
I can't think of anything in vmg (lua) that uses much memory other than the perlin noise maps. It's mostly just tinkering with the datamap the system gives it. You could try setting "vmg_caves = false" in your minetest.conf. That will free up most of the memory the noisemaps use (vmg caves use multiple 3D maps). Of course, you won't have any caves.
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:

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

by duane » Post

blert2112 wrote:Edit: Which fork of DarkAge is recommended? My fork of DarkAge does not use a LUA mapgen, it uses register_ore instead. I assume my fork will work fine with this mapgen? Still, would like to know which fork of DarkAge you had in mind when you wrote the compatibility part in as I can make my Pyramids fork work in the same way. Also, which noise describes deserts?
I know next to nothing about DarkAge. However, it's possible that the code we have in there to support it is unnecessary after the 2 Oct commit that puts vmg in front of any other mods. At some point, I need to check it. As far as I know, nothing will be incompatible with the latest github code unless it uses biomes or decorations. If it does, you're out of luck. Vmg (lua) is not likely to support those any time soon.

Deserts are not described by noise directly. Sand is put in based on a sand noise (v15), but that's not connected to the temperature and humidity, as it would be in the default game. Plants are placed based on temperature, humidity, soil, etc.

Valleys C, on the other hand, calculates temperature and humidity, then lets the game select a biome to match, similar to what the default game does. Decorations show up in the biomes they request.
Believe in people and you don't need to believe anything else.

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

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

by philipbenr » Post

I have absolutely no other out of the ordinary debug messages. It just ends with minetest freezing and exiting after about 3 seconds.

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

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

by blert2112 » Post

duane wrote:
blert2112 wrote:Edit again: Oh, how I wish I could use this. :(
The game crashes with a "LUA out-of-memory" error, after about ten of minutes of play, nearly every time. Oh well, I may attempt to compile the c++ version and see how that does, but that is for another day.
I can't think of anything in vmg (lua) that uses much memory other than the perlin noise maps. It's mostly just tinkering with the datamap the system gives it. You could try setting "vmg_caves = false" in your minetest.conf. That will free up most of the memory the noisemaps use (vmg caves use multiple 3D maps). Of course, you won't have any caves.
When I was converting DarkAge to VoxelManip (before I then converted it again to register_ore sheet type) I found that if you pass the data and area variables around too much it would always crash with the "LUA out-of-memory" error. It would always crash randomly with different memory usage values, as low as 37Mb or as high as a few hundred Mb. Why it happens I don't know. Maybe something to do with the way Lua handles variables passed to functions... Maybe pointers should be passed instead, I'm not fluent enough in Lua to know.

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

philipbenr wrote:I keep getting fatal freezes and ^^^ this in my debug.txt when I am exploring a world. I don't have darkage enable FYI.
That's a harmless warning due to the code here in v2.2 https://github.com/Gael-de-Sailly/valle ... n.lua#L589
"if darkage_mapgen then -- Compatibility with darkage mod by CraigyDavi. If you see error messages like "WARNING: unknown global variable" at this line, don't worry :)"

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

blert2112 wrote:Edit again: Oh, how I wish I could use this. :(
The game crashes with a "LUA out-of-memory" error, after about ten of minutes of play, nearly every time.
If you're using LuaJIT try disabling it, it restricts lua memory use to a low limit, because the lua version of this mapgen uses 6 3D noises it uses huge amounts of memory to process those noises (1 3D noise = 80 2D noises).
However you will still need a machine with roughly 2GB free memory to cope.
There are some optimisation methods available now in 0.4.13 to reduce memory use by noise, i need to learn these then i can share some examples of use.

My riverdev lua mapgen uses a similar number of 3D noises so probably has the same problem.

Even core mgv7 only uses 4 3D noises.

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

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

by blert2112 » Post

paramat wrote:
blert2112 wrote:Edit again: Oh, how I wish I could use this. :(
The game crashes with a "LUA out-of-memory" error, after about ten of minutes of play, nearly every time.
If you're using LuaJIT try disabling it, it restricts lua memory use to a low limit, because the lua version of this mapgen uses 6 3D noises it uses huge amounts of memory to process those noises (1 3D noise = 80 2D noises).
However you will still need a machine with roughly 2GB free memory to cope.
There are some optimisation methods available now in 0.4.13 to reduce memory use by noise, i need to learn these then i can share some examples of use.

My riverdev lua mapgen uses a similar number of 3D noises so probably has the same problem.

Even core mgv7 only uses 4 3D noises.
How would I go about disabling LuaJIT? Is there a command line option I can't find or do I need to compile the game without it?
Running a Core I5 2.2GHz Broadwell with 8G of RAM and a GeForce940m with dedicated 4G of RAM. Memory should not be an issue with this game on this laptop.

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: Nerd Poles

by Gael de Sailly » Post

duane wrote:I think I've eliminated the nerd poles spawning in the mountains. Here's two shots of the same spot in the same game, before...

Image
These "nerd poles" don't exist in the Lua version, where there would be overhang cliffs (with a slope > 90°). Possible cause : the C++ code looks for the highest node and don't check the lower ones.
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: Nerd Poles

by duane » Post

Gael de Sailly wrote:These "nerd poles" don't exist in the Lua version, where there would be overhang cliffs (with a slope > 90°). Possible cause : the C++ code looks for the highest node and don't check the lower ones.
I must have been mistaken. That's good news -- no need to fix the lua.
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:

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

by duane » Post

blert2112 wrote:Edit again: Oh, how I wish I could use this. :(
The game crashes with a "LUA out-of-memory" error, after about ten of minutes of play, nearly every time. Oh well, I may attempt to compile the c++ version and see how that does, but that is for another day.
I still can't duplicate this. However, this patch to mapgen.lua might help. Give it a try, and if it works, we can put it into the main code. It solved some problems with integral trees. My suspicion is that lua forgets to garbage collect under some circumstance. Every now and then, memory use would just run away. It's not an issue of memory still being referenced or the extra garbage collection wouldn't help. It doesn't happen very often, so the change doesn't affect the speed of chunk generation much.
Attachments
mem.zip
(525 Bytes) Downloaded 54 times
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

Compile with:
cmake . -DRUN_IN_PLACE=TRUE -DENABLE_LUAJIT=FALSE
?

BobbyBonsaimind
Member
Posts: 97
Joined: Tue Apr 14, 2015 19:32
GitHub: RobertZenz
IRC: Robert_Zenz
In-game: Bobby

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

by BobbyBonsaimind » Post

paramat wrote:
blert2112 wrote:Edit again: Oh, how I wish I could use this. :(
The game crashes with a "LUA out-of-memory" error, after about ten of minutes of play, nearly every time.
If you're using LuaJIT try disabling it, it restricts lua memory use to a low limit, because the lua version of this mapgen uses 6 3D noises it uses huge amounts of memory to process those noises (1 3D noise = 80 2D noises).
I don't think LuaJIT is *directly* to blame here, because my Australopithecus mapgen is using 32 2D and 7 3D noises in its current version (I already had versions with 8 and 9 3D noises running without a problem, I'm only using LuaJIT since the beginning). So this might actually be the system that *really* runs out of memory here, and not a problem with LuaJIT in itself.

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

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

by blert2112 » Post

duane wrote:
blert2112 wrote:Edit again: Oh, how I wish I could use this. :(
The game crashes with a "LUA out-of-memory" error, after about ten of minutes of play, nearly every time. Oh well, I may attempt to compile the c++ version and see how that does, but that is for another day.
I still can't duplicate this. However, this patch to mapgen.lua might help. Give it a try, and if it works, we can put it into the main code. It solved some problems with integral trees. My suspicion is that lua forgets to garbage collect under some circumstance. Every now and then, memory use would just run away. It's not an issue of memory still being referenced or the extra garbage collection wouldn't help. It doesn't happen very often, so the change doesn't affect the speed of chunk generation much.
I have applied the patch and flew around for a while. No problems yet but no "Manually collecting garbage." message either. I put it into my sub-game (approx. 60 other mods including mg_villages, plantlife-modpack, moretrees, mobs_redo with nearly every mob available... to name the bigger mods), still cannot reproduce it yet but I have only been messing with it for a few minutes. Won't have much time to test in the next few days but I will continue trying. Thanks for helping out with this. Oh, I am now using the latest master instead of the 2.2 download if that makes a difference.

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

Simple Caves

by duane » Post

There's now an option in Valleys Mapgen on github for simpler caves (vmg_simple_caves=true) which speeds up terrain generation considerably without having to sacrifice cave creation. On my system, chunks take two-thirds the normal time to generate when this is enabled.
Believe in people and you don't need to believe anything else.

User avatar
demon_boy
Member
Posts: 48
Joined: Thu Apr 09, 2015 10:53
GitHub: vlapsley
In-game: demon_boy
Location: Melbourne, Australia

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

by demon_boy » Post

The addition of volcanoes has been slow progress - have I mentioned my programming is hacky?

I've scrapped my previous giant volcano mountains because I couldn't get them to spawn correctly and they smashed the memory on my machine and crashed minetest frequently. Plus I couldn't get lava into the cone.

My new volcano is an extension of a mountain or sometimes along mountain ridges. They will fill up with lava and sometimes overflow.

Image

Image

There is still a bit of work to do to avoid this:
Image

Sometimes the lava generates outside the volcano surface and you end up with a cataclysmic lava flow and ensuing fire.

TODO:
  • Tune code to avoid lava outside the volcano surface
  • Reduce generation of trees/plants near 'active' volcanoes. Tree generation happens after volcanoes and sometimes places them inside to fuel a fire!
  • Fix the placement of snow so it sits on top of the obsidian for a snow-capped volcano.
I'll upload a new branch to the github repo soon (on the weekend I think) as I'm sure Duane will be able to make some improvements!

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

demon_boy wrote:My new volcano is an extension of a mountain or sometimes along mountain ridges. They will fill up with lava and sometimes overflow.
Very cool.
demon_boy wrote:Sometimes the lava generates outside the volcano surface and you end up with a cataclysmic lava flow and ensuing fire.
I'd like to keep at least some chance of this. Disasters happen, after all.

It might look prettier if the lava stone blends a bit more with the rest of the environment.
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

Ok I'm again active during the short holidays. I'm working on a plants API, to allow other mods to register plants (or any decoration) to be generated on a VMG world.

Important rewrite, switched to a new branch: ordened_plants.

I'm not sure to finish it during the next week.
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][WIP] Valleys Mapgen [valleys_mapgen]

by Gael de Sailly » Post

This has been faster that I thought. I think that it's finished, it seems to work, but it needs more tests. You can watch the diff here.
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

Gael de Sailly wrote:This has been faster that I thought. I think that it's finished, it seems to work, but it needs more tests. You can watch the diff here.
Ingenious. This cleans up the code nicely. It seems to be producing a lot more bare patches though. Maybe I'm imagining it, because I can't see any reason in the source why that would be the case.
Believe in people and you don't need to believe anything else.

User avatar
demon_boy
Member
Posts: 48
Joined: Thu Apr 09, 2015 10:53
GitHub: vlapsley
In-game: demon_boy
Location: Melbourne, Australia

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

by demon_boy » Post

duane wrote:
Gael de Sailly wrote:This has been faster that I thought. I think that it's finished, it seems to work, but it needs more tests. You can watch the diff here.
Ingenious. This cleans up the code nicely. It seems to be producing a lot more bare patches though. Maybe I'm imagining it, because I can't see any reason in the source why that would be the case.
I haven't tested yet, but I am hoping to get around to it soon.

More bare space could be used for oak and willow trees. I'm also thinking about mangrove trees for where rivers meet the beach.

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

demon_boy wrote:More bare space could be used for oak and willow trees. I'm also thinking about mangrove trees for where rivers meet the beach.
I don't think there is more bare space. But if you want bare space, you can change the "check" parameter for some plants.
And in fact you don't really need bare space. The plants API allow to have several plants at the same place.
Just realize how bored we would be if the world was perfect.

amadin
Member
Posts: 549
Joined: Tue Jun 16, 2015 16:23

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

by amadin » Post

Thanks for this mod.
- How decrease the amount (quantity) of rives?
- In README.md: "First, make sure that you've added the `valleys_mapgen` dependancy in your depends.txt (followed by a question mark if optional)" - so i must to add it in all mods?
- Does where a way to increase speed of valleys_mapgen? Maybe if turn off some options in settings or something else.
- I think the better file settingtypes.txt name will be setting_exaple.txt because i tryed to change values in it at first :)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 13 guests