Page 6 of 18

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

Posted: Thu Oct 08, 2015 19:06
by philipbenr

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.

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

Posted: Thu Oct 08, 2015 23:34
by blert2112
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.

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

Posted: Fri Oct 09, 2015 08:34
by duane
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?

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

Posted: Fri Oct 09, 2015 08:48
by duane
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.

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

Posted: Fri Oct 09, 2015 09:06
by duane
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.

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

Posted: Fri Oct 09, 2015 15:23
by philipbenr
I have absolutely no other out of the ordinary debug messages. It just ends with minetest freezing and exiting after about 3 seconds.

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

Posted: Fri Oct 09, 2015 17:11
by blert2112
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.

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

Posted: Sat Oct 10, 2015 08:35
by paramat
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 :)"

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

Posted: Sat Oct 10, 2015 08:41
by paramat
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.

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

Posted: Sat Oct 10, 2015 15:33
by blert2112
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.

Re: Nerd Poles

Posted: Sat Oct 10, 2015 18:34
by Gael de Sailly
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.

Re: Nerd Poles

Posted: Sun Oct 11, 2015 10:26
by duane
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.

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

Posted: Sun Oct 11, 2015 10:41
by duane
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.

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

Posted: Sun Oct 11, 2015 11:56
by paramat
Compile with:
cmake . -DRUN_IN_PLACE=TRUE -DENABLE_LUAJIT=FALSE
?

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

Posted: Sun Oct 11, 2015 12:01
by BobbyBonsaimind
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.

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

Posted: Sun Oct 11, 2015 15:49
by blert2112
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.

Simple Caves

Posted: Sun Oct 18, 2015 10:07
by duane
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.

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

Posted: Wed Oct 21, 2015 12:07
by demon_boy
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!

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

Posted: Thu Oct 22, 2015 04:19
by duane
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.

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

Posted: Sat Oct 24, 2015 18:13
by Gael de Sailly
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.

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

Posted: Mon Oct 26, 2015 21:35
by Gael de Sailly
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.

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

Posted: Tue Oct 27, 2015 01:15
by duane
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.

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

Posted: Wed Oct 28, 2015 03:30
by demon_boy
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.

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

Posted: Thu Oct 29, 2015 10:04
by Gael de Sailly
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.

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

Posted: Tue Nov 10, 2015 08:08
by amadin
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 :)