Possible Problem With the Way Planets are Generated

Posted on Tuesday, October 15, 2019

The Mysterious Outpost event spawns a class 1 planet that sometimes has 2 tiles.  Despite having two tiles, it is still labeled as a class 1 planet.  I think this is caused by the order used to generate what is on the planet.

Sometimes the generated planet has only one tile with a planet feature on it along with the planet capital.  This really shouldn't happen, because the planet feature is wasted.

Sometimes the generated planet is class 1 but has 2 tiles.  This only happens when one of the tiles has a Trade Resource or Artifact on it.  The other tile contains the capital.

Here are some screenshots showing the variety.

One tile with the capital.

One tile with the capital with a planet feature on the same tile.

Two tiles with one containing a trade resource in a "normal" location and one containing the capital in the bottom-left corner.

Two tiles with one containing a relic in a "normal" location and one containing the capital in the bottom-left corner.

When the class 1 planet contains 2 tile, the tile with the capital is always in the bottom-left corner no matter what the terrain is.

This makes me think the procedure to generate a planet would be better if it was something like this:
1. Generate tiles equal to planet class.
2. Add planet capital to a tile.
3. Check for empty tiles.  If there aren't any, exit this whole process, since the planet is full.
4. Otherwise, check each empty tile, and add planet feature if random number is right.  The tile is no longer empty.
5. Check each empty tile, add Trade Resource or Artifact if random number is right.

This way the capital is added before anything else, planet feature are only added to empty tiles, then Trade Resources and Artifacts are only added to the remaining empty tiles.  This would solve the problem with the class 1 planet.

However, any method that prevents the problems in the last 4 screenshots would be great.