procedural-generation

C# format arbitrarily large BigInteger for endless game

拥有回忆 提交于 2019-12-01 06:21:49
I am trying to create an endless game such as Tap Titans, Clicker Heroes, etc. I have a BigInteger class that is capable of representing arbitrarily large integers as long as they fit into memory. Now I have a class that formats a BigInteger into a specific format. It uses K (thousand), M (million), B (billion), T (trillion), Q (quadrillion) for the 'smaller' numbers, but after that the short hand notations become ambiguous and unintuitive. Q is already ambiguous due to Quintillion, but I can live with that. After Q, I want to start from the letter a. So 1000Q = 1.000a, then 1000a = 1.000b etc

C# format arbitrarily large BigInteger for endless game

喜你入骨 提交于 2019-12-01 04:58:16
问题 I am trying to create an endless game such as Tap Titans, Clicker Heroes, etc. I have a BigInteger class that is capable of representing arbitrarily large integers as long as they fit into memory. Now I have a class that formats a BigInteger into a specific format. It uses K (thousand), M (million), B (billion), T (trillion), Q (quadrillion) for the 'smaller' numbers, but after that the short hand notations become ambiguous and unintuitive. Q is already ambiguous due to Quintillion, but I can

Why does switching from Mersenne twister to other PRNGs in Gradient Noise Generator give bad results?

社会主义新天地 提交于 2019-11-30 15:49:14
问题 I've been trying to create a generalized Gradient Noise generator (which doesn't use the hash method to get gradients). The code is below: class GradientNoise { std::uint64_t m_seed; std::uniform_int_distribution<std::uint8_t> distribution; const std::array<glm::vec2, 4> vector_choice = {glm::vec2(1.0, 1.0), glm::vec2(-1.0, 1.0), glm::vec2(1.0, -1.0), glm::vec2(-1.0, -1.0)}; public: GradientNoise(uint64_t seed) { m_seed = seed; distribution = std::uniform_int_distribution<std::uint8_t>(0, 3);

Why does switching from Mersenne twister to other PRNGs in Gradient Noise Generator give bad results?

别来无恙 提交于 2019-11-30 15:14:28
I've been trying to create a generalized Gradient Noise generator (which doesn't use the hash method to get gradients). The code is below: class GradientNoise { std::uint64_t m_seed; std::uniform_int_distribution<std::uint8_t> distribution; const std::array<glm::vec2, 4> vector_choice = {glm::vec2(1.0, 1.0), glm::vec2(-1.0, 1.0), glm::vec2(1.0, -1.0), glm::vec2(-1.0, -1.0)}; public: GradientNoise(uint64_t seed) { m_seed = seed; distribution = std::uniform_int_distribution<std::uint8_t>(0, 3); } // 0 -> 1 // just passes the value through, origionally was perlin noise activation double

how to create a branching vein/river like structure on a square grid

寵の児 提交于 2019-11-29 12:05:01
I am trying to procedurally generate some rivers. I have a flat (no concept of elevation) square grid as base and want to draw a branching structure on it like shown in the image. Can you share the steps that one may use to get that done? I am not looking for the fastest implementation as there is no real time generation, but the simpler implementation will be prefered. Lua is my language but anything will do. Few more things: The shape should be generated algorithmic ally. The shape should be controllable using a seed value. Spektre I think generating rivers is a backward approach as you

Optimizing numerical array performance in Haskell

泄露秘密 提交于 2019-11-28 16:59:57
I'm working on a terrain generation algorithm for a MineCraft-like world. Currently, I'm using simplex noise based on the implementation in the paper 'Simplex Noise Demystified' [PDF] , since simplex noise is supposed to be faster and to have fewer artifacts than Perlin noise. This looks fairly decent (see image), but so far it's also pretty slow. Running the noise function 10 times (I need noise with different wavelengths for things like terrain height, temperature, tree location, etc.) with 3 octaves of noise for each block in a chunk (16x16x128 blocks), or about 1 million calls to the noise

Mathematical question: procedural generation of a galaxy

萝らか妹 提交于 2019-11-28 15:18:06
I'm going to make a space/trading/combat game that is completely procedurally generated. But, I know that storing all of the details of the whole galaxy in memory is unfeasable. As a result, I've been think that I can use a seed to generate a solar system, and from that solar system, you can use jumpgates to travel to other solar systems. The problem is that if I jump to another solar system from the starting one, I need to be able to get back to the exact same starting solar system with the exact the same features (planets, asteroids, etc.). Essentially, I need to be able to generate a whole

Random 2D Tile-Map Generating Algorithm

半城伤御伤魂 提交于 2019-11-28 13:54:53
问题 Can anyone tell me a way to generate island structures or hill structures like in minecraft? I'm just searching for a proper THEORY for that random-shape generating, but it should keep a defined base pattern.. like: islands schould be rounded but variate in shape and scale ( min/max width & height ). or: rivers schould not be straight lines, they should have curves and a random width. or even: generating some sort of forest, where trees are placed in a way that the user can still walk through

Procedural generation of stars with skybox

谁说我不能喝 提交于 2019-11-28 12:57:47
I am attempting to procedurally generate a star-filled background in OpenGL. The approach I am taking is to create a skybox with a cubemap texture. Each side of the cubemap texture essentially consists of a 2048x2048 black image with randomly selected texels set to White. Here is the result: I'm not sure how obvious it is from the image, but when moving around a very distinct box shape can be made out as stars close to the edge of the box appear smaller and closer together. How can I prevent this? Do I need to abandon the skybox approach and use something like a skysphere instead? EDIT: here

how to create a branching vein/river like structure on a square grid

可紊 提交于 2019-11-28 06:15:59
问题 I am trying to procedurally generate some rivers. I have a flat (no concept of elevation) square grid as base and want to draw a branching structure on it like shown in the image. Can you share the steps that one may use to get that done? I am not looking for the fastest implementation as there is no real time generation, but the simpler implementation will be prefered. Lua is my language but anything will do. Few more things: The shape should be generated algorithmic ally. The shape should