Planet Generation

Reviving a thread from a long time ago :slight_smile:

So all of the stuff which is above here is about star and planet generation. There’s a code prototype here. What it does is it generates variables but no geography or anything spatial like that.

For the star it works out mass and from that it works out Life span, Radius, Temperature, Luminosity, the spectrum of the light the star emits and the habitable zone for the star in which planets can have liquid water.

For the planet it takes the radius and orbital distance and works out temperature and relative masses of the atmosphere, lithosphere and oceans. It also takes the composition of the atmosphere and works out the spectrum of light that hits the planet.

What I’m proposing is to work on this by adding an update step. So the star will change over time and get hotter or cooler, maybe it flares. For the planet the changes in the star will change it’s temperature and maybe damage it, maybe there will be volcanoes or asteroid impacts etc.

I think the value of this is that it can really help with patch map generation by having good variables to build on (how much of this planet is frozen, what percentage is ocean etc). It will hopefully provide some good ongoing gameplay where you need to adapt to changing planet conditions. Hopefully once this system is built it will last well, probably this is enough to get us into the strategy stages.

I’m hopeful I can do most of this work myself, I’d like to try it as a project to learn more about coding for the game, I’ll probably need some help with plumbing it in and anyone who is interested in contributing is totally welcome. Maybe 0.4.3 isn’t the right time for this so feel free to say if people have other priorities, also if anyone has ideas and contributions for this system I’d appreciate hearing them.

3 Likes

I was doing a bit of prep for the star and planet generator and I wanted to ask everyone’s opinions on what options the player should have when starting a new game.

I was thinking something along the lines of you press new game and you get a page with maybe 4 buttons on it:

Default - which makes a stable star and a reasonably earthlike planet with guaranteed land and a low amount of disasters. This would be the normal Thrive experience.
Friendly - which makes something very habitable and has no disasters.
Extreme - which makes a planet which may have poor habitability (too hot too cold) and lots of disasters however will definitely have land so you can get to all stages.
Custom.

Custom lets you choose the mass of the star and the amount of solar disasters. It also lets you choose the orbital radius of the planet and what it’s atmo is like and how many planetary disasters it has. Maybe even you can turn specific disasters on and off. You can if you want make a planet which is all water and permanently frozen, for example, or one which has massive meteor strikes frequently. This would block you from later stages but it might be possible to have a warning.

What do you all think?

3 Likes

Sounds good, could these settings apply to compound availability and cell behaviour as well? So very aggresive predatory cells won’t appear on Easy mode for example.

@DonGororo That starts to mess with realness so I’d rather not have simulation restrictions. I have a good book about creating accurate planets so I’ll post some thoughts and ideas here once I’m done reading.

1 Like

Good question. I think difficulty levels are probably a bigger debate. For now I might just have it impact the planet variables only. It’s an important thing to discuss though if you want to start a thread about it.

It’s exciting that we’re getting close to implementing this! I could have sworn there was a page that had collated this info, but all I could find was this thread:

Here’s a summary of all the settings not related to difficulty:


General Settings

Homeworld Type: Planet, Satellite, Random
Satellites (If homeworld is a planet): Yes, No, Random
Satellite Number (If planet has moons): [Enter number], Random
Terrestrial to Aquatic Ratio: Fully terrestrial, Mostly terrestrial, Balanced, Mostly aquatic, Fully aquatic, Anything Except “Fully aquatic”, Random
Natural Disaster Frequency: Frequent, Normal, Uncommon, Never
Life as We Know It: Yes, No

Microbe Settings

Starting Biome: Hydrothermal Vent, Tidepool, etc.
Compounds: Abundant, Normal, Rare
Endocytosis Chance: Certain, High, Normal, Low


Since there are so many starting options, and there will be tons more when the game is fleshed out, it’d be a good idea to allow the use and creation of presets. The game would ship with a few, and the player could make some of their own, or download ones other players have made on the forums.

Some ideas for presets would be:

Classic (Normal or random settings for everything, LAWK on, etc.)
Terracentric (Start on a balanced land to water planet with one satellite, normal settings, LAWK on, etc.)
Hardcore (All the hardest options, high disaster rates, slow evolution rates, fully random homeworld, etc.)

1 Like

https://experilous.com/1/blog/post/procedural-planet-generation

3 Likes

Forum Elaboration

There are two common ways to generate planets that won’t drive the programmer who takes it on mad.

The Quad Sphere and The Icosphere

The Way of the Past
The Quad Sphere is the classic way you see in Spore. You take a cube, you texture it, apply various data to it through maps, then turn it into a ball. End result is a fairly triangle efficient planet. The issue is this method has problems with seams, map glitches, corruption, file bloat (lots of images compared to the competition) and it was only done for one reason and one reason only.

Old GPUs used to struggle really hard with high triangle counts. I am not lying to you when I say modern integrated graphics are better than some dedicated stuff from back then at this. Modern computers and GPUs can almost draw triangles as easily as pixels, the problem arises when triangles are smaller than pixels or, in the case of software like Blender 3D, triangles are stored in RAM for manipulation.

But what makes Quad Spheres good for Spore but no good for us? Problem back then was the other competing method is an inefficient proposal in terms of triangle count as when you would subdivide it (make the triangles smaller, allowing that seamless zoom into a planet surface), you would get lots more triangles than when you applied such operations to a Quad Sphere. Couldn’t have that on a 2005 desktop. So, games like Spore which begun development in the early 2000s decided to use Quad Spheres and that’s what eventually spread. However, if you really need convincing:

  • You can’t map the surface of a Quad Sphere without image processing for the maps and textures that give it shape and features. For us that would mean writing graphics programming and writing shaders. Many of them. Ugly ones.

  • The shape a Quad Sphere comes from is a cube, so when you do various operations, you always have to keep this in mind.

  • You can’t reuse a lot we’ve done so far in terms of pathing or placement. The Quad Sphere would need logic for traversing a sphere or converting UV coordinates (2D surface coordinates) to usable units

  • Selecting spots on a Quad sphere requires either that UV / Sphere Math nonsense again, or some whole new interaction system we haven’t wrapped our minds around yet.

The Icosphere
In computer graphics, the Icosphere is a very special shape. It comes from the largest Platonic Solid (of which there are 5 in the universe, every face is the exact same size), the Icosahedron. In computer graphics this is big money huge because the means you can deform it in any direction with predictable results and you can subdivide it easily and reliably. It can also be truncated (snip off every pointy corner, that’s what truncation does) into another useful shape, The Hexasphere. The Hexasphere is, as you would guess, a sphere made out of hexes, and though it looks different, it has the exact same triangle layout as a Icosphere (because it secretly is one).

Fun Fact: there are 12 pentagons on a hexasphere no matter the number of hexes

Unfortunately, only a few projects have ever harnessed the power of the Icosphere so there are limited things to view out there that truly show their capability. Besides those who needed Hexaspheres like the game Rim World. Here are some advantages demonstrated by Rim World we may like:

  • You can use hex math to do everything on the surface of an Icosphere. Everything. In Rim World, Caravans will auto path their migrations, roads will be built, and all manner of insane things be placed purely by referencing and calculating positions on the hex grid that is the Icosphere surface.

  • You can smoothly subdivide it when you zoom in, the thing is you will be subdividing a giant triangle the closer you get to the surface (which is easy but worth knowing about) rather than a plane like on a Quad Sphere.

  • Quite compact and so is the data. The hexasphere you use to abstract positions of the surface to the player, abstract positions to yourself to use coordinates, and the shape you subdivide and mold into valleys and mountains and seas, are all one shape.

The Considerations
If I have convinced those reading that the Icosphere is shamelessly superior (it is) there are considerations. There are specific ways things must sometimes be done when it comes to handling the Hex state and the Ico state. Stretching shouldn’t really be done unless you’re willing to write warp code to un-stretch things. You can’t go modifying the Hexasphere in elaborate ways as if it exists in isolation from the Icosphere, whenever you do something, you must consider how you preserve the compactness of having one shape fill 2 roles. In general, the simpler the better. Also, it’s worth noting the Icosphere is, although a simple thing to wrap the mind around once you understand it, horribly documented. It is however, very modular and flexible.

Start small, end fantastically.

4 Likes

So the planet generaton prototype is looking good from what saw, and i want to throw in my 5 cents to this idea so. When generating a planet you can radomize it along with my idea choose its size. From my understanding some laptops or pc’s will have an easier time rendering, generation and simulating life on a smaller planet unless the player (not me) has a good pc and can have the option to generate larger planets.

MY IDEAS FOR THIS:
-planet size will by choosen by defult depending on your PC or Laptop system
-In multiplayer when free evolution (maybe) where the player can go through the whole game together
the planet size would also be how many players can be on your server.

  • 5 planet sizes: Very small, small, medium, large, huge.

This idea would help keep the games preformance stable later on with the games stages

Automatic selection of planet size based on performance specs is a bit ambitious for what it’s worth…

For something so small it’s far more appealing to just allow the player to decide on what size they want to play with. Worst case scenario we just slap a “Recommended for weaker PCs” disclaimer on smaller worlds.

By the way, with simple ideas such as this I would like to recommend you just post them in our developer chatroom so as not to clutter our forums. the developer chatroom is a good place to discuss ideas and shape them out into a proper concept which then can be taken to the forums.

3 Likes

Also for far future concepts, it’s much better to discuss many of the topics on the community forums.

2 Likes