Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noise fields #17

Open
sbrl opened this issue Jun 21, 2020 · 4 comments
Open

Noise fields #17

sbrl opened this issue Jun 21, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@sbrl
Copy link
Owner

sbrl commented Jun 21, 2020

It would be very cool indeed to expose Minetest's inbuilt noise primitives in a practical worldeditadditions command.

The API documentation can be found here: https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L6305

We could have 2 commands: 1 that operates in 2D (e.g. a heightmap), and 1 that operates in 3d (e.g. caves / blobs / sky islands etc). It's probably best to consider them both separately.

Let's think about the 2D version first. We'd want to expose the all the interesting parameters in a command (maybe //noise? it would fit what we've done with //maze if we later added //made3d).

We'd also perhaps want to add the ability to perturb the existing heightmap by a percentage or something to allow for both altering existing terrain, and layering multiple different kinds of noise to make fractals.

Speaking of, if we design the syntax right we should be able to allow for defining multiple kinds of noise at the same time that we can layer together in a single command to allow for easier complex fractal noise.

In the future we might want to add new different noise functions too, so maybe adding room for that would be worth doing too (though we want to make the invocation concise, so specifying the noise function should be optional and default to the inbuilt Minetest perlin noise).

@sbrl sbrl added the enhancement New feature or request label Jun 21, 2020
@VorTechnix
Copy link
Collaborator

The question is can you scale the 3d noise? If you want to use it for teeth of time then you want very fine noise to eliminate a few blocks here and there and not the cave generating scale of noise that would remove whole buildings at a time.

@sbrl
Copy link
Owner Author

sbrl commented Mar 13, 2021

Yeah, we should be able to. Minetest's inbuilt version definitely can, but unfortunately I can't make heads or tails of the documentation, so I'm having to look at sourcing a pure Lua version. I did this yesterday and committed it just now, but it's untested as I'm just taking my first proper forays into metatables to properly instance the generator.

It's really just a bunch of maths to scale it. If you've done algebra before, it's that kinda principle. I intend to implement a table of properties to control it.

Eventually I want to add noise implementations for a number of different noise functions (e.g. OpenSimplex, Worley, , but I'll probably have to port them from my earlier C♯ project NoiseBox I'd guess if I can't find an implementation elsewhere to steal borrow.

The current goal is to get the noise engine setup first and make sure it's functioning as intended. Then we can build it out.

@sbrl
Copy link
Owner Author

sbrl commented Jul 18, 2021

Ok, so we have a system that kinda works - realistically we need to port something like OpenSimplex to Lua to get anything that looks good. I suggest here that we first port it on it's own in isolation (like I did with the maze algorithm), and then once we've confirmed it works fold it into Minetest (it really is a pain how Minetest has so many restrictions such as the inability to use require(), and being stuck on Lua 5.1 when the latest version 5.4, etcc).

@sbrl
Copy link
Owner Author

sbrl commented Oct 12, 2021

//noiseapply2d is now a thing! Now for //noiseapply3d.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants