3 ms·
When I first learned about noise (many years later than I should have), I remember finding out that Perlin noise was patented, so I looked into OpenSimplex[1] i
by sephoric 8y ago
When I first learned about noise (many years later than I should have), I remember finding out that Perlin noise was patented, so I looked into OpenSimplex[1] instead which is Java but has been ported to other languages. It turns out Love2d has love.math.noise built in which does the same thing. Would be great if PICO-8 had it too, although I think this one[2] is free too. But one of the coolest things was realizing that Minecraft landscapes are mostly just multiple applications of noise functions on top of each other, which means it only needs to store changes to the environment, and that it can completely regenerate the same environment using noise functions. Sometimes I envy game developers, until I remember how their working conditions are usually very horrible.
[1] https://gist.github.com/KdotJPG/b1270127455a94ac5d19 https://gist.github.com/KdotJPG/b1270127455a94ac5d19
[2] http://staffwww.itn.liu.se/~stegu/simplexnoise/Noise.lua http://staffwww.itn.liu.se/~stegu/simplexnoise/Noise.lua
- bepvte 8y agoi think that minecraft stores the generated data along with modifications nowadays, instead of the neat little format you describe, because generating this frequently is usually very difficult for the computer. im not completely sure though.
- PavlovsCat 8y agoYou're correct, Minecraft generates chunks around as players get near them, then they get stored on disk. To reset a chunk you can just delete it IIRC, it gets regenerated to the initial state as soon as a player comes near it. There would be not much practical use for it I think, but in theory it should be possible to "compress" a Minecraft world by figuring out the delta between the original generated state and the current state, and then for each chunk either saving the delta or the the full chunk, whatever is smaller.
- the_gipsy 8y agoIt is still practical in some cases, like moving the world border at will.
- veli_joza 8y agoI actually missed the built-in noise function and instead used the same library you linked to. I tried switching to built-in C++ implementation just now and it was actually slower. The Lua library for simplex does some FFI trickery and avoids crossing Lua/C++ barrier. Mike Pall is credited in comments, so I guess I'm not surprised it's faster.
- Sharlin 8y agoAs far as I know, Perlin noise has never been patented. According to Wikipedia, however (emphasis mine): > in 2001 he was granted a patent for the use of 3D+ implementations of simplex noise for texture synthesis. OpenSimplex is a variant of simplex noise developed specifically to work around that patent.