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

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

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

by texmex » Post

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.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

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

Re: Noise params for approx. 1 node thin lines

by paramat » Post

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

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

Re: Noise params for approx. 1 node thin lines

by texmex » Post

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
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

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

Re: Noise params for approx. 1 node thin lines

by paramat » Post

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

Re: Noise params for approx. 1 node thin lines

by paramat » Post

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

Re: Noise params for approx. 1 node thin lines

by paramat » Post

2000x2000 map:

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

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

Re: Noise params for approx. 1 node thin lines

by texmex » Post

This is exactly what I was looking for. This is excellent. Thank you so much paramat!
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

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

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

by texmex » Post

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

Forgot force_placement flag. All good! xD
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

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

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

by paramat » Post

Good to know. Feel free to ask if you need help with tuning the parameters.

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

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

by texmex » Post

After trying it out I think I want a bit squigglier lines since they often run in straight ~90° for quite long stretches. How can I achieve this?
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

ShadMOrdre
Member
Posts: 656
Joined: Mon Dec 29, 2014 08:07
GitHub: ShadMOrdre
In-game: shadmordre
Location: USA

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

by ShadMOrdre » Post

Paramat,

I second that request. I put your decoration into lib_materials, and got myself a river and road network. But they'd look a lot better if the lines had more noise in them. For rivers, I'm using multiple deco defs, setting each deco to use differing altitudes and schematics. This allows me to make rivers wide near sea level, while narrowing the rivers at higher elevations. Same for the road decorations.

Lacunarity over 2.11 or under 1.89 seemed to break the lines. I thought lacunarity would only affect it if it used more than 1 octave, but that is not the case. Adding a lacunarity setting to the noise params, and changing beyond the range of the above values clearly "broke" the lines, of simply broke the decoration definition, rendering the decoration unplaceable.

Anyway, thanks a ton for this single decoration definition. Road and rivers, and so simple.

Shad

Image
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.

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

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

by texmex » Post

Excellent use of the noise, Shad! This is my use case as well.

My worry is that using it extensively will severely slow down map generation (as opposed to, say, a VoxelManip approach).
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

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

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

by texmex » Post

Btw Shad, please tell me when/if you find a solution to place schematics BY the road, not ON them. Having the same problem.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

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

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

by paramat » Post

> I think I want a bit squigglier lines since they often run in straight ~90° for quite long stretches. How can I achieve this?

There is only one octave by necessity (noise flag 'absvalue' only works for this usage with 1 octave), so additional octaves cannot be added to generate finer detail in the pattern. Also, 'lacunarity' and 'persistence' are non-functional with 1 octave. This appearence is inherent for 'eased' noise with 1 octave.

The only possible change in noise character is:
flags = "noeased, absvalue"
That will remove some of the straightness but will cause some sharp angles.

> My worry is that using it extensively will severely slow down map generation

It is fairly lightweight, however, because it relies on 'sidelen = 1' it has a more intensive use of noise compared to typical decorations. So don't use it for large amounts of decorations.
One advantage is that it is not running in Lua so will not cause server lag, use of Voxelmanip will.

ShadMOrdre
Member
Posts: 656
Joined: Mon Dec 29, 2014 08:07
GitHub: ShadMOrdre
In-game: shadmordre
Location: USA

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

by ShadMOrdre » Post

paramat,

Is it at all possible, to say, starting at pos x,y,z, using this, or a similar noise, to then draw a line to pos x,y,z?

If I recall, in your pathsv6/v7 or roadsv6/v7 mods, you spoke with Sokomine, regarding drawing roads from mg_village to mg_village. While mg_villages might have been difficult to determine village edge, for the purpose of ending the road at the end of the mg_village main street, I think I can provide a village mod where this is not an issue.

I'm using Rochambeau's settlements mod to create something akin to mg_villages, minus all the placement/town design complexity, and not requiring a flat circle. These "towns", and the buildings within, are placed at the appropriate y height. I can provide the pos of the center of the village, and give or take 50m, would be happy with a road/path from village to village, that doesn't go in a straight line across the map.

I don't know that this particular decoration noise can be done, but I seem to recall you "had" a solution to address Sokomines suggestion, just that Sokomine wasn't necessarily able to provide the end pos of the main street in those villages.

Any thoughts, suggestions, or outright solutions? As always, thankful for your help, and all the other work you do.

Shad
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.

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

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

by paramat » Post

> Is it at all possible, to say, starting at pos x,y,z, using this, or a similar noise, to then draw a line to pos x,y,z?

No, because noise is random so decoration placement is random =)

With villages, if noise-determined paths intersected a village this was only by coincidence. So i didn't have a solution for specifying points a noise-generated path passes through.

Sokomine
Member
Posts: 4073
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

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

by Sokomine » Post

ShadMOrdre wrote: If I recall, in your pathsv6/v7 or roadsv6/v7 mods, you spoke with Sokomine, regarding drawing roads from mg_village to mg_village. While mg_villages might have been difficult to determine village edge, for the purpose of ending the road at the end of the mg_village main street, I think I can provide a village mod where this is not an issue.
Determining village edges is not such a big problem. The villages use that for detecting weather players are allowed to build there or not. Even knowing where a village might appear is to some degree possible. It's all noise-based. But please don't ask me for the details about using noise for that - that has been programmed by nore.
ShadMOrdre wrote: I'm using Rochambeau's settlements mod to create something akin to mg_villages, minus all the placement/town design complexity, and not requiring a flat circle. These "towns", and the buildings within, are placed at the appropriate y height. I can provide the pos of the center of the village, and give or take 50m, would be happy with a road/path from village to village, that doesn't go in a straight line across the map.
Ah, thanks for reminding me of Rochambeaus settlements mod. Since the time I'd first spotted your posting and now, I've experimented a bit with. That is, taken some core ideas, combined them with information from the heightmap and some way to limit ugly platforms/too high walls to some degree. That code alone provides only places withhin one mapchunk where houses can be placed - in the same circular pattern Rochambeaus settlement mod does. That approach doesn't work for villages that are larger than one mapchunk, and there's no real way to tell in advance if a particular mapchunk will be able to hold a village or not. If you're unlucky, your entire mapgen might not even have one single mapchunk where a village of that kind can be placed.

As your issue seems to be about road generation - something that bzt also showed intrest in - perhaps cooperation is possible?

I'll continue work on the settlements-like placement of villages and try to combine it with mg_villages as far as possible. In the end, most of that "overhead" from mg_villages will be necessary no matter how the houses are arranged. Else mapgen will eat holes in the houses - or the houses will have to be made out of materials mapgen doesn't eat.
A list of my mods can be found here.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests