Re:Show HN: TerrainVer – Generate Worms-Style Cartoon Terrai...
by thexa4 on Saturday April 07, 2018 @09:40PM
(#16784084)
If you can create a function that creates an infinite grid of buildings you can blend that using another perlin noise function.
The techniques used in raytracing can probably help as well: https://www.youtube.com/watch?v=KYekhnLHGms
Re:Show HN: TerrainVer – Generate Worms-Style Cartoon Terrai...
by progval on Sunday April 08, 2018 @04:08AM
(#16785164)
Why no fractions? If you are worried about loss of precision caused by floating-point numbers, you can use exact fractions. For instance, there is "mpq" in GMP (for C), the "fractions" module in Python's stdlib, or you could hand-write a small fractions library yourself.
Re:Show HN: TerrainVer – Generate Worms-Style Cartoon Terrai...
by lurquer on Sunday April 08, 2018 @12:06PM
(#16786722)
Agreed. It's a sort of silly constraint. Not truly necessary. But, there are other aspects of the project that make it much easier to completely and utterly do away with floating point.
Re:Show HN: TerrainVer – Generate Worms-Style Cartoon Terrai...
by juliango on Sunday April 08, 2018 @06:44AM
(#16785526)
Generating constructions is very different from generating terrain, so I'd probably try a 2-step process where the building generator can be seeded by the terrain relief. But it's not trivial for sure. See also https://github.com/mxgmn/WaveFunctionCollapse#higher-dimensi... because it's relevant and looks awesome :)
I've been working on a procedural terrain generator for fun. Voxel-based. Just big chunks of 16x16x256 sections. Like minecraft.
My goal is create a function that will take any 3D integer coordinate and output a particular type of block for that coordinate... be it air, granite, dirt, etc.
The constraint, however, is that the only knowledge the function has is the coordinate; that is, it has no knowledge of adjoining blocks.
The second constraint -- (because one can never trust floating point) -- is to have the function (and the requisite RNG) use only integers between 0 and 100,000 with no calculations that involve fractions. This constrain is to guarantee that with a given seed, the same terrain will be generated on any system. Rolling hills and mountains and caves and all the typical minecraft kinda stuff is trivial. But, I'm trying to get my magical black-box function to create buildings with walls, windows, etc. that's trickier.
Have you come across anything like this?