[Mod][Merged] Valleys Mapgen [valleys_mapgen]

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

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

by philipbenr » Thu Oct 08, 2015 19:06

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 » Thu Oct 08, 2015 23:34

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: 1591
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

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

by duane » Fri Oct 09, 2015 08:34

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: 1591
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

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

by duane » Fri Oct 09, 2015 08:48

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: 1591
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

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

by duane » Fri Oct 09, 2015 09:06

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: 1688
Joined: Fri Jun 14, 2013 01:56
Location: United States
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi

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

by philipbenr » Fri Oct 09, 2015 15:23

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 » Fri Oct 09, 2015 17:11

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: 3448
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

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

by paramat » Sat Oct 10, 2015 08:35

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/valleys_mapgen/blob/2.2/mapgen.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: 3448
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

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

by paramat » Sat Oct 10, 2015 08:41

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 » Sat Oct 10, 2015 15:33

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: 733
Joined: Sun Jan 26, 2014 17:01
Location: Lyon, France
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly Ginkgoo

Re: Nerd Poles

by Gael de Sailly » Sat Oct 10, 2015 18:34

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: 1591
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

Re: Nerd Poles

by duane » Sun Oct 11, 2015 10:26

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: 1591
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

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

by duane » Sun Oct 11, 2015 10:41

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 16 times
Believe in people and you don't need to believe anything else.
 

User avatar
paramat
Developer
 
Posts: 3448
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

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

by paramat » Sun Oct 11, 2015 11:56

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 » Sun Oct 11, 2015 12:01

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 » Sun Oct 11, 2015 15:49

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: 1591
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

Simple Caves

by duane » Sun Oct 18, 2015 10:07

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
Location: Melbourne, Australia
GitHub: vlapsley
In-game: demon_boy

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

by demon_boy » Wed Oct 21, 2015 12:07

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: 1591
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

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

by duane » Thu Oct 22, 2015 04:19

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: 733
Joined: Sun Jan 26, 2014 17:01
Location: Lyon, France
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly Ginkgoo

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

by Gael de Sailly » Sat Oct 24, 2015 18:13

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: 733
Joined: Sun Jan 26, 2014 17:01
Location: Lyon, France
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly Ginkgoo

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

by Gael de Sailly » Mon Oct 26, 2015 21:35

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: 1591
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

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

by duane » Tue Oct 27, 2015 01:15

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
Location: Melbourne, Australia
GitHub: vlapsley
In-game: demon_boy

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

by demon_boy » Wed Oct 28, 2015 03:30

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: 733
Joined: Sun Jan 26, 2014 17:01
Location: Lyon, France
GitHub: Gael-de-Sailly
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly Ginkgoo

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

by Gael de Sailly » Thu Oct 29, 2015 10:04

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: 544
Joined: Tue Jun 16, 2015 16:23

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

by amadin » Tue Nov 10, 2015 08:08

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 :)
 

PreviousNext

Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 4 guests