Tutorial:Making Planets

From Kerbal Space Program Wiki
Revision as of 08:38, 12 April 2018 by ArnePeirs (talk | contribs)
Jump to: navigation, search


Creating Your Own Planets

This tutorial is made for people who are getting bored with landing and collecting science on the stock planets, but if you could land on your own planets, that could be very interesting!

Specifications

  • Length: 15-20 minutes
  • Difficulty: Easy - Somewhat Intermediate
  • For Version: 1.0.4+

Requirements

  • Ksp (Duh)
  • Kopernicus 0.3.3
  • KittopiaTech 0.2
  • A text editor (Notepad, Notepad++,Sublime Text, etc.)
  • A place to get textures (This can be SpaceEngine)
  • A photo editor (Photoshop, GIMP, Paint.net, etc.)
  • An online normal map creator, like the one here (optional)

Rocky Planets

Steps

1. Getting Textures

(I will use SpaceEngine in this example) In order to get textures, open up SpaceEngine, find the planet you want to use, and click on export planet in the editor menu.

This is how to export a planet from Space Engine

Make sure you uncheck the clouds and surface settings, and check the color map. All you need is color map, normal map, and height map. If you don't have SpaceEngine and you have a color and height map, use the online normal map. Just drag and drop the color and height map, and it will create your normal map. Save the files from SpaceEngine as .dds files, but if you have a .png file, open it up in your texture editor, and save another copy as .dds. Make sure you save all files as YourPlanetName. You should now have three files - YourPlanetName _Color.dds, YourPlanetName _Normal.dds, and YourPlanetName _Height.dds.


2. Creating The Config Files

Open up your text editor and copy this code into it.

CODE:

@Kopernicus 
{
    Body
    {
        name =  //This will be the name of your planet.
        flightGlobalsIndex = 500 //You can make this any number, just not too big.
        Template
        {
            name =  //This is the template for your planet. Put Tylo for rocky planets, Laythe for ocean planets, Jool for gas giants, or Sun for stars.
        }
        Properties
        {
            radius =  //The distance in meters from the surface to the planet's center.
            geeASL =  //The planet's gravity. (Kerbin = 1)
            mass =  //The planet's mass. Not that important.
            tidallyLocked = true/false //Determines if the planet is tidally locked.
            rotationPeriod =  //Duration in seconds for the planet to complete a single rotation. 
            description =  //The description of the planet. (Shows up in planet's Info panel)
            ScienceValues //The values for conducting experiments at the planet.
            {
                landedDataValue = 
                splashedDataValue = 
                flyingLowDataValue = 
                flyingHighDataValue = 
                inSpaceLowDataValue = 
                inSpaceHighDataValue = 
                recoveryValue = 
            }
        }
        Orbit
        {
            referenceBody =  //The celestial body the planet orbits.
            inclination =  //Value in degrees for how far above the orbital plane the planet's orbit goes. (Use >90-<270 for retrograde orbit)
            eccentricity =  //Value from 0-1 for how much an ellipse the planet's orbit is. (1 is a parabolic escape trajectory, 0 is circular, in between is elliptical, >1 is hyperbolic, infinite makes the planet fall straight into the Sun)
            semiMajorAxis =  //This is the distance in meters your planet is away from the reference body.
            longitudeOfAscendingNode =  //The rotation of the orbit from the Ascending Node
            argumentOfPeriapsis = 0 //The angle between the Ascending node and Periapsis, changing this essentially changes the orbits rotation about the axis perpendicular to its plane.
            epoch = 0 //The reference time elapsed for meanAnomalyAtEpoch since Universal Time = 0. This is typically 0, unless this is the orbit of a ship or forcibly relocated asteroid.
            meanAnomalyAtEpoch =  //Changes the starting position of the body in its defined orbit. It is the time elapsed since the last periapsis, measured in seconds (in intervals of the orbital period, which is calculated by 2*Pi*sqrt(semiMajorAxis^3/G/mass of referenceBody))
            color = R,G,B,1 //The RGBA color code of your planet's orbit in the orbit map and tracking station. Divide each value by 255. The 4th value is Alpha, or the opacity of the color. Keep it at 1.
        }
        ScaledVersion
        {
            Material
            {    
                texture =  //This will be Kopernicus/Config/YourPlanetName/YourPlanetName_Color. Do NOT put .dds.
                normals =  //This will be Kopernicus/Config/YourPlanetName/YourPlanetName_Normal. Do NOT put .dds.
         }
      }
   }
}

When you have filled this out, save it as YourPlanetName.cfg. Go inside your Kopernicus folder, go into the Config folder, and you should see a config file that says System. Do not open that file under any circumstances. Inside the Config folder, make a new folder that says YourPlanetName. Move YourPlanetName.cfg, and your three texture files inside.

3. Setting Up KittopiaTech

(NOTE: The link included in the description does not include a SaveLoad folder.) (This is only if you have a rocky or ocean planet.)Go inside your KittopiaTech Folder, and then into the SaveLoad folder, and make a new file in your text editor. Copy this code into it. CODE:

PlanetYourPlanetName  //In YourPlanetName, put the name of your planet.
{
    AdditionalData  //Leave all of this false
    {
        Stock = False
        AddAtmoFx = False
        AddOceanFx = False
        OceanLoadTextures = False
        UnlitOcean = False
        ModScaledAtmoShader = False
        AddRings = False
        AddParticles = False
        DisableOrbitRenderer = False
    }
    PQS
    {
        PQSMod_HeightColorMap  //Leave this false
        {
            modEnabled = False
        }
        PQSCity  //Leave this false
        {
            modEnabled = False
        }
        PQSMod_VertexHeightMap
        {
            heightMap = GameData/Kopernicus/Config/  //Make this the location of your height map. Make sure you put GameData at the beginning, and to leave .dds on there.
            heightMapDeformity = 2500  //Basically determines the height of your mountains
            heightMapOffset = 0  //If your planet has oceans, set this to a negative number
            scaleDeformityByRadius = False
        }
        PQSMod_VertexColorMap
        {
            modEnabled = true
            vertexColorMap = GameData/Kopernicus/Config/  //Same as above, but make this the location of your color map.
        }
        PQSMod_VertexSimplexHeight  //Dont change any of this, except for the deformity
        {
            seed = 95374         
            deformity = 300 
            octaves = 8         
            persistence = 0.5  
            frequency = 12
        }
        PQSMod_VertexSimplexHeightAbsolute  //Same as above
        { 
            seed = 637926             
            deformity = 100  
            octaves = 3               
            persistence = 0.5
            frequency = 0.8
        }
        PQSMod_VertexSimplexHeightMap  //Leave this false
        {
            modEnabled = False
        }
        PQSMod_VertexHeightNoiseVertHeight  //Leave this false
        {
            modEnabled = False
        }
    }
}

Save this config file as YourPlanetName.cfg in your SaveLoad folder. Now, put the Kopernicus and KittopiaTech folders inside GameData in your KSP directory.

Final Note

The only reason you need this last config file is so your planet can have a custom height. If you didnt have this, your planet would almost look like Tylo on a different scale. If you get a glitch where only one side of the planet is lit up, change the opacity of your normal map to 50%.

Ocean Planets

Steps

1. Get your textures.

2. DO THE SAME THING THAT YOU DID ABOVE!!!

3. Under the template section of your Kopernicus config, change it from Tylo to Laythe.

4. In the KittopiaTech config, under the PQS_VertexHeightMap section, change the heightMapOffset from 0 to a negative number, such as -1000.

5. In your height map, paint all of the areas where you want your water to be pitch black, so the RGB amount reads 0,0,0

Final Note

You still need both config files for an ocean planet. Be careful with the heightMapOffset, if you make it too low, like -5000, it will flood your planet.

Gas Giants

Steps

1. Get Your Textures

This will be the same as above, except you only need a color texture.

2. Make Your Planet Folder

Do the same thing as above where you make the folder that will hold your planet.

3. Set up config

Make a new text file and copy this into it. CODE:

@Kopernicus 
{
    Body
    {
        name = 
        flightGlobalsIndex = //Change this to any number, just not too big.    
        Template
        {
            name = Jool   //Jool is the main template for a gas giant.               
        }
        Properties
        {
            radius =  //Distance in meters from the surface to the core.                                  
            geeASL =      //Amount of gravity your planet has. Kerbin is 1.                                 
            mass =  //The mass is not important.                       
            description =  //The description of your planet.
            ScienceValues //The amount of science you will get around your planet.                                    
            {
                landedDataValue = 100
                splashedDataValue = 0
                flyingLowDataValue = 0
                flyingHighDataValue = 0
                inSpaceLowDataValue = 40
                inSpaceHighDataValue = 30
                recoveryValue = 5
            }
        }
        Orbit
        { 
            referenceBody = Sun   //Body where your planet will orbit. Do NOT change to Kerbol, it is the Sun in game.  
            inclination =   //Self-explanatory           
            eccentricity =  //Self-explanatory          
            semiMajorAxis =  //Distance from the parent body in meters.
            longitudeOfAscendingNode = 0 //Leave the next four as zero.
            argumentOfPeriapsis = 0
            meanAnomalyAtEpoch = 0
            epoch = 0
            color = RGB value of your orbit. Divide each number by 255, and put a fourth 1 so you can see it. Ex: 0, 0, 0, 1 is black.
        }
        ScaledVersion
        {
            Material
            {    
                texture = Kopernicus/Config/  //Make this the location of your YourPlanetName_Color. Do NOT include .dds.
            }
        }
    }
}

Save this file as YourPlanetName.cfg, and move it into your planet's folder, along with the texture. Move the Kopernicus folder into your GameData and you are done!

Final Note

Making a gas giant is the one of the easiest planets you can make. You only need one texture file, and you do not need a separate KittopiaTech config.

Finishing Word

With this tutorial, anyone should be able to create their own planets, to land on and collect science from. With a little more expirience, it is possible to actually make your planets into a mod.

Important Note

If anyone could tell me if it is possible to make other stars with Kopernicus, that would be greatly appreciated.