Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Uhhh, how does terraforming work in this game?

I got started on the Planet generation code late yesterday and today, which immediately meant I had to answer this question at least somewhat. After five minutes on Wikipedia looking up the speculation on terraforming and deciding to make stuff up, here’s

How to Terraform a Planet in Three Easy Steps:

Step 1: Fire a Solar Strawberry into the core to heat up an inner core, outer core, and mantle, and get them circulating so there’s are magnetic poles.

Step 2: Seed a breathable atmosphere with an Ozone Orange

Step 3: Create the right soil/bacterial mix with Space Compost, a byproduct of the combat sequences with the Giant Space Hot Dog, all for 6 easy payments of $19.99. There might be other ways to generate Space Compost, but this is the one I’m focusing on for now.

More design notes on Planet generation

Because I’ve decided that some plants will not grow around dimmer stars (ex. An Ozone Orange requires at least a Class G star), this has a few implications for the random generation of the planets around these stars, and the three stars in which I am having a heavier hand in their generation (the starting system, the G class star system, and the B class star system):

  • Shops on the inhabited planets will ONLY sell space fruit that grows in the GDA zone corresponding to their star. For example, a shop in a Class M star system will only sell Apogee Apples, Waxing Watermelons, and Solar Strawberries.

    • Shops in any star system will buy ANY fruit, regardless of the GDA zone it grows in.

    • Shops will not sell space fruit, or they won't at least until the player has sold AT LEAST ONE instance of that fruit.  I'll come back to this.

    • None of the above will apply to seeds.

    • This is to prevent the player from skipping ahead and starting to terraform a planet before growing their own Ozone Oranges first.

  • The G class star MUST have a farmable planet, since it will be impossible to grow the materials needed for terraforming otherwise.

  • The B class star MUST have a planet that is either farmable or terraformable.

This leads to my planet generation code. It has a method in the ConstellationFactory class, CreatePlanet(), that decides three mutually exclusive boolean values: isInhabited, isFarmable, and isTerraformable. It then performs three calls to the Random.Range method (think of this as a coin toss, but I get to choose the weight instead of 50-50 all the time) to answer these three questions in this sequence:

  • Is the planet inhabited?

  • Is the planet farmable?

  • Is the planet terraformable?

Because the result of one question has no impact on the probability distribution of the next question, the events are independent, and the probability tree is kind of like a coin toss (again, not 50-50, and I can control the odds from sliders in the Unity editor).

This does open the possibility that the planet is not inhabited, not farmable, and not terraformable. I’m calling these planets duds for now, but I am well aware that that is no fun, and I should add more mechanics later to bring them into the gameplay.  Maybe I can add a mining minigame when you can extract minerals for Space Soil Amendments?

Now the above is one version of CreatePlanet(). I’ve overloaded that function so that I can send it the exact boolean values I want. Elsewhere in the constellation construction, this means I can make sure the player can start off owning a farmable planet around a class M or K star, that there is a farmable planet around a class G star in the constellation, and that there is at least one terraformable planet around a class B star.

To summarize all this, I’m trying to guide the procedural generation of the planets in this game so that the player starts out on a dim class M or K star with a small number of plants they can grow. The player can then buy a farmable planet orbiting a class G or B star with credits earned by selling space fruit, and from there grow Ozone Oranges, which with Solar Strawberries and Space Compost are the ingredients for terraforming.  Then  the player can buy/terraform a planet in a Class B star system and grow Lunation Lemons, which can...

From here on, I think the next milestones involve the creation of Plants, Meaties, and some stuff to handle the shops. All of this as assets start coming in from Mike and Katt.