Which algorithm should I use for the world generation?

Hey everyone! I’m currently making my diploma game with the title “4X game made with Unity Engine”

The theme of the game is space and now I’m thinking about how to randomly generate a world. The idea is as follows: I have several types of different planets, each with certain resources, and when the game first starts, the world is randomly generated, considering that two planets cannot appear in the same point. In the beginning the player has a certain explored territory and as the game progresses he explores the map discovering previously unknown territories (in the second attached picture I tried to draw a map to make it more or less clear what I mean). I think a good solution for this would be to use object pooling to avoid displaying on the scene objects the player hasn’t been explored yet, and probably some sort of algorithm that actually generates the world (randomly puts planets on the map). But i don’t know what algorithm is best suited for my case. I found one called Perlin noise, but from what I understand this algorithm is more suitable for generating textures and maps that have surface, which is not my case, since i don’t have a surface. Can somebody advice me something? Thank you very much!

P.S. 1-st screenshot shows how my game looks at the moment and the 2-nd one is my attempt to draw a map where black space is unexplored territory and dots of different colours are different types of planets from the explored territory

If you want a simple approach maybe you can use a grid and select a random tile like they did on this Roguelite tutorial.

If you prefer a more advanced hexagonal grid, maybe this tutorial can be useful. The planet placing logic could be the same.

Using an underlaying grid can be useful for the “fog of war” too.

But if you were against the grid idea, maybe you can:

  1. Decide a min distance between planets.

  2. Select a random point in space.

  3. Look for other planets in a min-distance radius from that point.

  4. If there’s no other planet around, place the new planet. If there is, go back to 2.

and so on.