Thomas P.

Stellarator - A proof-of-concept solar system generator

Recommended Posts

What is it?
Stellarator is a software that can generate random solar systems for KSP / Kopernicus. It is not a mod for KSP itself, but a standalone application. The reason is, that every planet in KSP exists twice, once as a high res version that is shown at low distance, and a lower res version that is shown at higher distances. (Scaled Space). While the local space uses procedural generation to create the terrain and the colors, the Scaled Space relies on pregenerated maps. Because the generation for those maps is very slow, this is done outside of KSP. What you get is a folder with Kopernicus configs that you can copy into your GameData folder.

How does it work?
Stellarator creates the base solar system using a software called "Accrete", that simulates a dust cloud around a protostar, and formes planets until no dust is left. Accrete is originally written in C, but I ported it to C#/.NET to be used by Stellarator. The orbits and some of the other parameters from Accrete are used as a base to generate the planet. But since Accrete cant take care of everything, Stellarator has a database of prefabs for all the things a planet needs: Atmosphere curves, Names, Rings, Gas Giant textures and so on. This database is loaded at runtime and elements are selected randomly, or using special conditions, like radius of the planet.
The most important part is the PQS (the terrain of the planet): As mentioned above we use a database of prefabs to load parameters. The PQS prefabs are special. The definitions, who are stored in ConfigNodes, are loaded, and their values are evaluated by a library called "Dynamic Expresso", which allows for dynamic configs (you could do deformation = planet.radius * 5 for example). After that, the Configs are loaded by the same parser library that powers Kopernicus, and that got included in Stellarator. Since the parser relies on the PQS, and we obviously dont have the PQS available in a standalone app, I reimplemented most of KSPs PQSMods in a standalone library (libpqsmods.dll). That allows us to generate the ScaledSpace maps we mentioned above outside of KSP, but with the same style.

Current state
The generator code is getting pretty solid and useable, but the database is largely incomplete. There are almost no prefabs for PQS, rings and stars. The texture generator for gas planets, and the name generator are awesome though.
Pictures (might be ugly, because some of them were from earlier development phases): http://imgur.com/a/0T6FG

Why?
Because I wanted to show that it is possible to have randomized solar systems in KSP. And because it is fun.

How to use
Start the included .exe file, enter a seed, a folder name and choose if the names of the planets should be systematic (Sol-a, Sol-b etc.) or not (Mercury, Earth etc.). The system folder will be in a folder called "systems". Move it to gamedata, install Kopernicus and you should be good

! WARNING ! Do not rename the folder. The texture paths would change otherwise.
! WARNING ! Do not use this on existing savegames. Stellarator generates configs that delete the whole system and rebuild it from Scratch, using different names.

Legal Stuff
Because it is a proof of concept, I do not want someone to redistribute systems generated by the software, even if they properly credit the people who make Stellarator.
That means, that the whole program code of Stellarator is licensed under the Terms of the MIT License, except the namespaces ModLoader and Parser who are LGPL, but the database assets (that means configs and textures) are licensed as All Rights Reserved.

Stellarator is based on the following libraries:

Further credit goes to:

Download
https://github.com/Kopernicus/Stellarator/releases/tag/pre-0.1

Like my mods?
Please consider supporting me and my mods on Paypal! I would greatly appreaciate it, since I don't get much money anyways. :)
However note, that this doesn't grant you anything special, but it will help to keep my motivation up. Therefor it's just an extremly nice way to say "thanks". :)

 

Edited by Thomas P.

Share this post


Link to post
Share on other sites

Oh man the hours of my life I wasted playing with Accrete back in the day...

This sounds awesome. I'll be keeping an eye on it (oh for more spare time)

Share this post


Link to post
Share on other sites

Hey those are some pretty good gas giants if I do say so myself.

Share this post


Link to post
Share on other sites
On 10/31/2016 at 10:58 AM, Thomas P. said:

Pictures (might be ugly

What do you mean? Those planets are beautiful! Craters look like algae though...

Share this post


Link to post
Share on other sites

This could be the first step towards the creation of an entire procedural galaxy! Okay, maybe not an entire galaxy but still, this has a lot of potential. Definitively following it.

Edited by Elowiny

Share this post


Link to post
Share on other sites

 

On 10/31/2016 at 7:58 AM, Thomas P. said:

Pictures (might be ugly, because some of them were from earlier development phases

 

That purple planet looks good enough to eat .....this has a ton of potential, wait till some of the modders get a hold of this (hint hint  Galileo , Sigma88 )  the possibilities would be endless.  Great work. 

Share this post


Link to post
Share on other sites
8 minutes ago, mechanicH said:

 

 

That purple planet looks good enough to eat .....this has a ton of potential, wait till some of the modders get a hold of this (hint hint  Galileo , Sigma88 )  the possibilities would be endless.  Great work. 

I'm already involved, I made the system to generate names for planets and stars, with some help from thomas that translated my idea to code and gregrox who added a lot of prefixes suffixes etc

there is still a long way before this is done, but for sure it's an interesting project

Share this post


Link to post
Share on other sites
19 minutes ago, blackrack said:

Man, we need to get rid of this scaledSpace/PQS dichotomy.

Yeah man, we need, like, six space scales! Screw the false dichotomy!

 

  • PQS/Localspace, or 1:1 scale. This is a procedurally generated scale which governs meter scale terrain differences and procedural noise, along with maps and such.
  • CQS/Continentspace, or 1:60 scale. This procedurally generated scale, appearing about 50 km up, governs scales on decameters and hectameters. This uses heightmaps and some procedural noise, but is smoother and stabler on large scales.
  • OQS/Spacespace, or 1:600 scale. This is a procedually generated scale which works from 120km up, and deals in heightmaps and textures. Note that the heightmap must be generated from the PQS or CQS procedural terrain in order for it to match.
  • SS/Scaledspace, or 1:600000 scale. This uses maps generated maps for normals and color, as well as a mesh for the shape.
  • KS/Kerbolspace, or 1:100000000 scale. This uses simple colored spheres to represent planets from a distance.
  • GS/Galactispace, or 1:13599840256 scale. This uses abstract points or flares, and allows for the representation of stars in a galaxy.

As you can see this system is far more needlessly complicated easy to understand, and the use of entirely different systems for each scale region will only serve to get in the way improve the quality of planet packs. 

 

(Or, you know, just one space for them all, which I imagine is what blackrack meant?)

Edited by GregroxMun

Share this post


Link to post
Share on other sites
3 minutes ago, GregroxMun said:

(Or, you know, just one space for them all, which I imagine is what blackrack meant?)

I have no idea what just happened, just one space, yes.

Share this post


Link to post
Share on other sites
Just now, blackrack said:

I have no idea what just happened

It was a sort of a gag, you see. Getting rid of the dichotomy could perfectly well refer to making only one option or, as is generally the normal usage of the word, add several more. (i.e, false dichotomy)

Share this post


Link to post
Share on other sites

One ScaledSpace to rule them all!

(Oh yes, and great job on using a valid CIL image so I can run it with Mono)

Edited by Osmium

Share this post


Link to post
Share on other sites
Just now, cy4n said:

One ScaledSpace to rule them all!

Actually ideally it would be one Localspace to rule them all.

Share this post


Link to post
Share on other sites
Just now, GregroxMun said:

Actually ideally it would be one Localspace to rule them all.

No, because then you would have to keep the horrific PQS active all the time.

Share this post


Link to post
Share on other sites
Just now, Thomas P. said:

No, because then you would have to keep the horrific PQS active all the time.

Well then how would you get any reasonable detail on planets?

Share this post


Link to post
Share on other sites

I have been testing - some finds:

Gas giants only spawn with one small moon.

Normal maps are broken.

There are occasionally spiky ball moons.

All large planets/moons are gray

Edited by _Augustus_

Share this post


Link to post
Share on other sites
7 hours ago, _Augustus_ said:

All large planets/moons are gray

From the OP:

Quote

There are almost no prefabs for PQS, rings and stars.

For the rest: I am working on the moons and normalmaps

Share this post


Link to post
Share on other sites
9 hours ago, Thomas P. said:

From the OP:

For the rest: I am working on the moons and normalmaps

How would one add prefabs? I've been trying to but it just crashes Stellarator.

Edited by _Augustus_

Share this post


Link to post
Share on other sites
13 minutes ago, Thomas P. said:

 

13 minutes ago, Thomas P. said:

You would need make a pull request that adds files simlar to the existing ones to this directory: https://github.com/Kopernicus/Stellarator/tree/master/PlanetData/pqs

Here is what I tried:

STELLARATOR
{
    Iceball
    {
        minRadius = 300000
        maxRadius = 500000
        Mods
        {
				VertexVoronoi
				{
					deformation = 300
					displacement = 0.005
					enableDistance = True
					frequency = 12
					seed = Random.Next()
					order = 23
					enabled = True
					name = VornoiCells
					index = 0
				}
				VertexHeightNoise
				{
					deformity = 2000
					frequency = 4
					octaves = 8
					persistence = 0.5
					seed = Random.Next()
					noiseType = RiggedMultifractal
					mode = Low
					lacunarity = 2
					order = 110
					enabled = True
					name = _Height
					index = 0
				}
				VertexVoronoi
				{
					deformation = 250
					displacement = 0.005
					enableDistance = True
					frequency = 17
					seed = Random.Next()
					order = 23
					enabled = True
					name = _HeightNoise
					index = 0
				}
				VertexHeightMap
				{
					enabled = True
					deformity = 2500
				}
				VertexHeightNoise
				{
					enabled = False
				}
				VertexHeightMap
				{
					enabled = True
					deformity = -2000
					offset = 2000
				}
				VertexSimplexHeightAbsolute
				{
					deformity = 1000
				}
				VertexHeightNoise
				{
					deformity = -3000
					seed = 2325
					frequency = 10
					lacunarity = 32
					persistance = 0.9
					octaves = 8
					order = 11
				}
				HeightColorMap
				{
					LandClasses
					{
						Class
						{
							name = Ice
							color = 0.4245619,0.2865169,0.1460674,1
						}
						Class
						{
							name = Snow
							color = 0.5786517,0.741573,0.7921349,1
							altitudeStart = 0.6
							altitudeEnd = 2
						}
						Class
						{
							name = Snow
							color = 1,0.9719101,0.9438202,1
							altitudeStart = 1
							altitudeEnd = 2
						}
					}
				}
				VertexHeightNoise
				{
					deformity = 3455
					seed = Random.Next()
					frequency = 2
					lacunarity = 1
					persistance = 0.21
					order = 110
				}
				VoronoiCraters
				{
					deformation = 1000
					voronoiSeed = Random.Next()
					voronoiDisplacement = 1
					voronoiFrequency = 1
					simplexSeed = 123123
					simplexOctaves = 2
					simplexPersistence = 0.1
					simplexFrequency = 10
					jitter = 0.5
					jitterHeight = 0.1
					rFactor = 0.5
					rOffset = 1
					colorOpacity = 1
					order = 100
				}
				VoronoiCraters
				{
					deformation = 2000
					voronoiSeed = Random.Next()
					voronoiDisplacement = 0.1
					voronoiFrequency = 5
					simplexSeed = 123123
					simplexOctaves = 2
					simplexPersistence = 0.5
					simplexFrequency = 20
					jitter = 0.5
					jitterHeight = 0.1
					rFactor = 0.5
					rOffset = 1
					colorOpacity = 1
					order = 100
				}
        }
    }
}

It causes crashes. I borrowed it from GregroxMun's revamped Vall, and I have since fixed the indents, it still causes crashes.

UPDATE: Now Stellarator just ignores it.

Edited by _Augustus_

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.