[Solved] Noise params for approx. 1 node thin lines

User avatar
texmex
Member
 
Posts: 1536
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

[Solved] Noise params for approx. 1 node thin lines

by texmex » Wed Sep 11, 2019 11:30

I'd like to know if a decoration's noise params can be tweaked to somehow generate long, thin patterns. I'd like for it to be somewhat consistently producing 1 node-wide lines, but I don't care if it would become 2 node wide at times nor if it at times collapsed into 0 node wide. Is it possible?
Last edited by texmex on Tue Sep 17, 2019 06:50, edited 1 time in total.
 

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

Re: Noise params for approx. 1 node thin lines

by paramat » Thu Sep 12, 2019 00:46

Will think on this, how big a spacing between the lines?
Are the lines straight or curved?
 

User avatar
texmex
Member
 
Posts: 1536
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: Noise params for approx. 1 node thin lines

by texmex » Thu Sep 12, 2019 11:12

Pretty wide as I'd like for a line to not be seen from standing by another one. 500 nodes or so. I'd like them to be curved and squiggly like a walked path (I assumed perlin noise always generates curved output). Something like this perhaps, but avoiding the looped lines:

Image

I'd would be desireble if crossing lines didn't "swell" but somewhat kept their normal thickness. Multiple noise runs are okay for achieving this.
Attachments
noise.png
(68.15 KiB) Not downloaded yet
 

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

Re: Noise params for approx. 1 node thin lines

by paramat » Tue Sep 17, 2019 01:01

If the spacing between lines is large, such as 500 nodes, then it will be impossible to keep the lines width to 1-2 nodes, it will inevitably swell wider sometimes.
There will always be some loops.
Sorry to be slow on this, i hope to report back with a suggestion.
Last edited by paramat on Tue Sep 17, 2019 02:12, edited 2 times in total.
 

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

Re: Noise params for approx. 1 node thin lines

by paramat » Tue Sep 17, 2019 02:00

Interesting challenge, this is the best i can come up with, better than i thought possible. The lines are usually roughly 1-2 nodes wide.

Image

Try this code as a mod, depending on 'default' and 'flowers'.
Use in mgflat with caves and dungeons disabled.

Code: Select all
minetest.clear_registered_biomes()
minetest.clear_registered_ores()
minetest.clear_registered_decorations()

minetest.register_biome({
   name = "",
   --node_dust = "",
   node_top = "default:sand",
   depth_top = 1,
   node_filler = "default:sand",
   depth_filler = 3,
   --node_stone = "",
   --node_water_top = "",
   --depth_water_top = ,
   --node_water = "",
   --node_river_water = "",
   --node_riverbed = "",
   --depth_riverbed = ,
   --node_cave_liquid = "",
   --node_dungeon = "",
   --node_dungeon_alt = "",
   --node_dungeon_stair = "",
   --vertical_blend = ,
   y_max = 31000,
   y_min = -31000,
   heat_point = 50,
   humidity_point = 50,
})

minetest.register_decoration({
   deco_type = "simple",
   place_on = {"default:sand"},
   sidelen = 1,
   noise_params = {
      offset = 100.0,
      scale = -30000.0,
      spread = {x = 256, y = 256, z = 256},
      seed = 513337,
      octaves = 1,
      persist = 0.5,
      flags = "defaults, absvalue"
   },
   y_max = 31000,
   y_min = -31000,
   decoration = "default:obsidian",
})


Note that because there is 1 octave, changing 'persistence' has no effect.
For wider lines, but also fewer less gaps in the lines change 'scale' towards -20000.0.
For lines further apart, increase the scale of the entire pattern by increasing all components of 'spread'. This will make the lines wider so you will then need to tune 'scale'.
Attachments
screenshot_20190917_024943.png
(30.72 KiB) Not downloaded yet
 

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

Re: Noise params for approx. 1 node thin lines

by paramat » Tue Sep 17, 2019 02:10

2000x2000 map:

Image
Attachments
linesIND.png
(26.56 KiB) Not downloaded yet
 

User avatar
texmex
Member
 
Posts: 1536
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: Noise params for approx. 1 node thin lines

by texmex » Tue Sep 17, 2019 06:49

This is exactly what I was looking for. This is excellent. Thank you so much paramat!
 

User avatar
texmex
Member
 
Posts: 1536
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Solved] Noise params for approx. 1 node thin lines

by texmex » Tue Sep 17, 2019 23:40

Hmm, somehow place_offset_y doesn't work for this deco… Bug?

Forgot force_placement flag. All good! xD
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 4 guests