3D Perlin noise generator for testing

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

3D Perlin noise generator for testing

by SegFault22 » Post

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.

fessmK
Member
Posts: 49
Joined: Wed Sep 25, 2013 15:56

Re: 3D Perlin noise generator for testing

by fessmK » Post

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: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: 3D Perlin noise generator for testing

by Hybrid Dog » Post


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

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

Re: 3D Perlin noise generator for testing

by ArguablySane » Post

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: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: 3D Perlin noise generator for testing

by Hybrid Dog » Post

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 » Post

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: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: 3D Perlin noise generator for testing

by Hybrid Dog » Post

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 » Post

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: 2836
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: 3D Perlin noise generator for testing

by Hybrid Dog » Post

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: 872
Joined: Mon May 21, 2012 03:17
Location: NaN

Re: 3D Perlin noise generator for testing

by SegFault22 » Post

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 » Post

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: 872
Joined: Mon May 21, 2012 03:17
Location: NaN

Re: 3D Perlin noise generator for testing

by SegFault22 » Post

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 » Post

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 » Post

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: 872
Joined: Mon May 21, 2012 03:17
Location: NaN

Re: 3D Perlin noise generator for testing

by SegFault22 » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests