3D Perlin noise generator for testing

User avatar
SegFault22
Member
 
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

3D Perlin noise generator for testing

by SegFault22 » Wed Apr 22, 2015 22:19

I'm trying to make ores generate in the sheet type, but it takes too much time to try to fine-tune the parameters and re-re-reload minetest to check the generation in new chunks to no avail.
So, I'm wondering if there is a quickly useable 3-directional perlin noise generator, which I can use to generate a "sample" based on the parameters Threshold, Offset, Scale, Spread{X, Y, Z}, Seed, Octaves, and Persist, and what it is called or what site I should visit to find it. It should display a cube of no less than 64x64x64 blocks with perspective display from a corner.
 

User avatar
fessmK
Member
 
Posts: 49
Joined: Wed Sep 25, 2013 15:56
Location: Your RAM

Re: 3D Perlin noise generator for testing

by fessmK » Fri May 08, 2015 23:01

I don't know of anything like tat, but, to help you find the ores, make them generate in air, and run it in a singlenode world. Delete the map.sqlite file in the world directory after each test to make it regenerate. I do this when testing custom terrain generators
 

User avatar
Hybrid Dog
Member
 
Posts: 2719
Joined: Thu Nov 01, 2012 12:46

Re: 3D Perlin noise generator for testing

by Hybrid Dog » Mon Aug 31, 2015 10:33


‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

User avatar
ArguablySane
Member
 
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: 3D Perlin noise generator for testing

by ArguablySane » Mon Aug 31, 2015 12:08

fessmK wrote:I don't know of anything like tat, but, to help you find the ores, make them generate in air, and run it in a singlenode world. Delete the map.sqlite file in the world directory after each test to make it regenerate. I do this when testing custom terrain generators

This is the best way to do it. The minetest engine has a few quirks, so I wouldn't trust a third-party perlin noise library to produce the same results. Also it's extremely easy to jump between minetest and a code editor. You just have return to the main menu and enter the game again to see the changes.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.
 

User avatar
Hybrid Dog
Member
 
Posts: 2719
Joined: Thu Nov 01, 2012 12:46

Re: 3D Perlin noise generator for testing

by Hybrid Dog » Mon Aug 31, 2015 13:01

ArguablySane wrote:You just have return to the main menu and enter the game again to see the changes.

l use many mods, it takes minutes until l'm at minetest again.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

User avatar
ArguablySane
Member
 
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: 3D Perlin noise generator for testing

by ArguablySane » Mon Aug 31, 2015 13:21

Can't you just disable all of the mods except the ore-gen one you're testing, or does it lag regardless?
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.
 

User avatar
Hybrid Dog
Member
 
Posts: 2719
Joined: Thu Nov 01, 2012 12:46

Re: 3D Perlin noise generator for testing

by Hybrid Dog » Mon Aug 31, 2015 14:54

ArguablySane wrote:Can't you just disable all of the mods except the ore-gen one you're testing, or does it lag regardless?

l would need to enable the dependencies manually, which is more annoying than waiting because l can't do sth different in the time and l would need to browse in lots of mods.
l'm using the ppa and this doesn't get merged: https://github.com/minetest/minetest/pull/3035

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

User avatar
ArguablySane
Member
 
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: 3D Perlin noise generator for testing

by ArguablySane » Mon Aug 31, 2015 15:51

Hybrid Dog wrote:
ArguablySane wrote:Can't you just disable all of the mods except the ore-gen one you're testing, or does it lag regardless?

l would need to enable the dependencies manually, which is more annoying than waiting because l can't do sth different in the time and l would need to browse in lots of mods.
l'm using the ppa and this doesn't get merged: https://github.com/minetest/minetest/pull/3035

Surely you can create a new world containing only a minimal ore-gen mod? You should only need to re-enable all the other mods once, if at all. Minetest lets you have multiple worlds with different mods enabled in each.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.
 

User avatar
Hybrid Dog
Member
 
Posts: 2719
Joined: Thu Nov 01, 2012 12:46

Re: 3D Perlin noise generator for testing

by Hybrid Dog » Mon Aug 31, 2015 16:40

ArguablySane wrote:
Hybrid Dog wrote:
ArguablySane wrote:Can't you just disable all of the mods except the ore-gen one you're testing, or does it lag regardless?

l would need to enable the dependencies manually, which is more annoying than waiting because l can't do sth different in the time and l would need to browse in lots of mods.
l'm using the ppa and this doesn't get merged: https://github.com/minetest/minetest/pull/3035

Surely you can create a new world containing only a minimal ore-gen mod? You should only need to re-enable all the other mods once, if at all. Minetest lets you have multiple worlds with different mods enabled in each.

l'm working on many mods, l use a script to update them and push them to github because l can't do it manually without missing something accidentally. l don't like en- and disabling mods because often l use e.g. the chatcommand tool to faster set worldedit positions when l want to test changed explosions of the nuke mod.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

User avatar
SegFault22
Member
 
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

Re: 3D Perlin noise generator for testing

by SegFault22 » Tue Sep 01, 2015 02:40

The generator for testing would only have to generate a 2-dimensional noise map just like the Minetest engine does, but only displaying the noise where it is above the threshold value; that way, we can quickly test noise parameters - without having to exit to the menu, change the parameters in the mod file, load the world again, and generate new chunks to see if the changes are good enough. This process takes a lot of time, especially when the changes appear to not be reflected in generation or need to be changed very slightly many times.
 

User avatar
Sane
Member
 
Posts: 103
Joined: Tue Jun 17, 2014 09:31
GitHub: mt-sane
In-game: Sane

Re: 3D Perlin noise generator for testing

by Sane » Tue Sep 01, 2015 06:19

Maybe you could use delete_area in a mod to kill a region and have it regenerate with new parameters.
Trying to stay me.
 

User avatar
SegFault22
Member
 
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

Re: 3D Perlin noise generator for testing

by SegFault22 » Tue Sep 01, 2015 07:31

I have figured out how to delete the map.sqlite database, in order to regenerate the world entirely. However, all methods of testing the generation ingame will require exiting the world and re-loading it after adjusting the parameters. It would be a great advantage to be able to test the parameters in a much lighter/simpler program, before choosing which parameters to use for testing the ore generation ingame - especially considering how I need to repeat the process for over 60 different ores (although the mod will be released with optional light "packs" with less types of ores, the complete one will have everything so that it can be compatible with the next mod I am working on - which will focus on adding a real reason to dig deeper)
 

User avatar
Sane
Member
 
Posts: 103
Joined: Tue Jun 17, 2014 09:31
GitHub: mt-sane
In-game: Sane

Ingame regeneration

by Sane » Tue Sep 01, 2015 09:00

SegFault22 wrote:I have figured out how to delete the map.sqlite database, in order to regenerate the world entirely. However, all methods of testing the generation ingame will require exiting the world and re-loading it after adjusting the parameters. It would be a great advantage to be able to test the parameters in a much lighter/simpler program, before choosing which parameters to use for testing the ore generation ingame - especially considering how I need to repeat the process for over 60 different ores (although the mod will be released with optional light "packs" with less types of ores, the complete one will have everything so that it can be compatible with the next mod I am working on - which will focus on adding a real reason to dig deeper)


Just did a little hack in the minimal test game. This will delete and regenerate an area to the north of your current position. At least the on_generated callback is called.

  • Set ...minetest/games/minimal/mods/test\init.lua to the following code.
  • Start a minmal test game.
  • Left click with the regenerator node wielded.
  • Marvel at the debug printout ...
Code: Select all
local function on_generated(minp, maxp, blockseed)
   print ("---- on_generated (minp="..minetest.pos_to_string(minp)..", maxp="..minetest.pos_to_string(maxp)..", blockseed="..tostring(blockseed)..")")
end

minetest.register_on_generated(on_generated)

local pseudo = PseudoRandom(13)

minetest.register_node("test:regenerator", {
   description = "Use to regenerate.",
   tiles = {"default_clay.png^bubble.png"},
   on_use = function(itemstack, user, pointed_thing)
      
      local pos = user:getpos()
      local minp = {x=pos.x-100, y=pos.y-100, z=pos.z+10}
      local maxp = {x=pos.x+100, y=pos.y+100, z=pos.z+110}
      local newSeed = pseudo:next()
      print ("---- deleting (minp="..minetest.pos_to_string(minp)..", maxp="..minetest.pos_to_string(maxp)..", seed="..tostring(newSeed))

      minetest.set_mapgen_params({seed=newSeed})
      minetest.delete_area(minp, maxp)
      
   end,
})

minetest.register_on_newplayer(function(player)
   player:get_inventory():add_item('main', 'test:regenerator')
end)
Trying to stay me.
 

User avatar
oleastre
Member
 
Posts: 81
Joined: Wed Aug 13, 2014 21:39
GitHub: oleastre
In-game: oleastre

Re: 3D Perlin noise generator for testing

by oleastre » Tue Sep 01, 2015 09:32

To test some mapgen parameters, I first created simple chat command to explore the world. You can find it in:
https://oleastre.be/git/?p=minetest-ole ... /tools.lua

Then, create a world with the correct game, and mods activated (name it 'A'). After having it created, remove the map.sqlite file.

Then loop over the following steps:
1. copy the world 'A' to 'B'
2. launch minetest with world 'B'
3. execute the chat command '/explore_map 100'
4. exit minetest
5. use minetestmapper to create a map of your world and analyse it's content
6. adjust your parameters
 

User avatar
SegFault22
Member
 
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

Re: 3D Perlin noise generator for testing

by SegFault22 » Thu Sep 03, 2015 03:09

I would rather not have to start Minetest at all to test the noise parameters. I just need to generate a 2d noise map, like an image or something, with threshold control (only placing pixels where the noise is above the threshold) and identical algorithm to what Minetest uses. I used a similar generator in the past but it was for a different type of noise, or the algorithm was different and produced the wrong result.
If there is no such, then the method of testing noise in-game is the only option, but if it is not then I would rather use the other.
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 4 guests