0

I'm creating a 2D space game where the map is made up of square tiles. I would like a noise function that I can use to generate circular planet, by circular planets I mean 'circles' made out of squares (basically like a circle in Minecraft). The planet's radius should be of all different sizes. The reason I want to use noise is that I want the user to be able to generate a map with a seed so they can generate the same planets again. (the planets should be randomly distributed, not uniformly spaced) How would I implement this using noise so that it procedurally generates?

james clarke
  • 89
  • 1
  • 2
  • Stack Overflow is not a code writing service, you need to try this problem yourself and ask about a specific problem. What is it that you are having trouble with: generating random numbers, using perlin noise, distributing your planets, what? – Draco18s no longer trusts SE Jan 09 '18 at 20:18
  • I have tried using Perlin noise and then generating predetermined centers for the planets using an algorithm related to the seed, however the problem with this is that the planets are always uniformly spaced out and it looks un-natural. I was wondering if there was a noise function that could basically be used to generate a map of points randomly distributed and maybe these points could be modified to be ranges of sizes – james clarke Jan 09 '18 at 20:25
  • *~I was wondering if there was a noise function that could basically be used to generate a map of points randomly`* [Lots of ways](https://forums.arcengames.com/private-alpha-discussion/helping-out-with-external-code/). That thread is entirely devoted to Badger and my (mostly Badger) writing such functions. Obviously whatever you were doing with the perlin noise was wrong, and if you want it fixed, you need to show that code. – Draco18s no longer trusts SE Jan 09 '18 at 20:28
  • While it might be possible to have a single solver, this seems like two different problems: A) generating the planet compositions & B) generating the planet locations (distributing them). Which of the two are you interested in focusing on? – Pikalek Jan 10 '18 at 04:39

1 Answers1

0
  1. Place randomly positioned points (circle center)

  2. Then using the same seed generate variable circle radius

  3. To get 'voxels' cut the circle into a grid using division ...

    This should do the trick.

Community
  • 1
  • 1
Christophe Roussy
  • 16,299
  • 4
  • 85
  • 85