Difference between revisions of "Tutorial:Making a planet"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (Added closing pre tag.)
m (Fixed categories)
 
(7 intermediate revisions by 4 users not shown)
Line 10: Line 10:
 
*An image editor
 
*An image editor
 
*Kopernicus 0.1
 
*Kopernicus 0.1
Many developers prefer text editors like Notepad++, a rather advanced program. Image editors usually are advanced, but even Paint would work. You can find Kopernicus [https://github.com/BryceSchroeder/Kopernicus here].
+
Many developers prefer text editors like Notepad++, a rather advanced program. Image editors usually are advanced, but even Paint would work. You can find Kopernicus [https://github.com/BryceSchroeder/Kopernicus here]. Updated forum information can be found [http://forum.kerbalspaceprogram.com/threads/114649 here].
  
 
===2. Setting up the basic file===
 
===2. Setting up the basic file===
Line 34: Line 34:
 
  radius = half of the diameter of the planet - used to define size of sphere with texture
 
  radius = half of the diameter of the planet - used to define size of sphere with texture
 
  geeASL = planet's gravity in Kerbin gravities
 
  geeASL = planet's gravity in Kerbin gravities
 +
rotationPeriod = day in seconds
 +
rotates = whether it rotates | true or false
 +
tidallyLocked = is one side of the planet locked towards it's parent | true or false
 +
initialRotation = distance in degrees from the rotation point of origin
 +
isHomeWorld = is the space centre on this planet | true or false
 +
timewarpAltitudeLevels = set the altitude for 1, 5, 10, 50, 100, 1,000, 10,000 and 100,000x timewarps | example for allowing every level at sea level: 0 0 0 0 0 0 0 0
 +
ScienceValues
 +
{
 +
  landedDataValue = multiplier for science points provided by surface samples or ground EVA reports
 +
  spashedDataValue = same as ^, but for oceans
 +
  flyingLowDataValue = same as ^, but for EVA and crew reports whilst flying below the flyingAltitudeThreshold
 +
  flyingHighDataValue = same as ^, but for flying above the flyingAltitudeThreshold but below the spaceAltitudeThreshold
 +
  inSpaceLowDataValue = same as ^, but for flying just above the spaceAltitudeThreshold
 +
  inSpaceHighDataValue = same as ^, but for flying high above the spaceAltitudeThreshold
 +
  recoverValue = multiplier for all science transmitted back
 +
  flyingAltitudeThreshold = < in metres from sea level
 +
  spaceAltitudeThreshold = < in metres from sea levels
 +
}
 
}
 
}
 
Orbit
 
Orbit
 
{
 
{
 +
referenceBody = body the planet is orbiting, Kerbol is Sun
 
  inclination = distance at ascending node from horizontal in degrees, relative to the parent's equator
 
  inclination = distance at ascending node from horizontal in degrees, relative to the parent's equator
  eccentricity = unknown, perhaps the ratio of pe:ap and vice versa after 0.5
+
  eccentricity = unknown, likely the eccentricity of an ellipse (as KSP uses conics for orbits)
 
  semiMajorAxis = average of pe and ap: pe + ap / 2 = this
 
  semiMajorAxis = average of pe and ap: pe + ap / 2 = this
  longitudeOfAscendingNode = unknown, perhaps distance from 12:00 in degrees relative to the parent | set to 0 for max safety
+
  longitudeOfAscendingNode = set to 0 to be safe; angle from reference plane to ascending node
  argumentOfPeriapsis = unknown, set to 0
+
  argumentOfPeriapsis = set to 0 to be safe; angle from ascending node to periapsis
  meanAnomalyAtEpoch = ^
+
  meanAnomalyAtEpoch = set to 0 to be safe; angular distance from pericenter which body would have if in a circular orbit with constant speed and same orbital period as actual object
  epoch = ^
+
  epoch = keep at 0; used to define specific epoch of the orbit
  referenceBody = body the planet is orbiting, Kerbol is Sun
+
color = use rgb, but change values to 1/255*value
 +
}
 +
</pre>
 +
 
 +
===4. Choosing what to do===
 +
Use the code bible below to help you find what you want to do.
 +
==Code bible==
 +
Contents:
 +
*Atmospheres
 +
**Adding an atmosphere
 +
**Adding an atmosphere effect NOT DONE
 +
 
 +
===Adding an atmosphere===
 +
Add into the <code>Body</code> module and edit as necessary:
 +
<pre>
 +
Atmosphere
 +
{
 +
  lightColor = tint of the light, in r,g,b format.
 +
enabled = true | you want one don't you?
 +
containsOxygen = true/false on oxygen in atmosphere
 +
altitude = height from sea level in metres
 +
PressureCurve
 +
{
 +
  key = use altitude pressure format | simple example of Kerbin:
 +
  key = 70000 0
 +
  key = 0 1
 +
}
 +
TemperatureCurve
 +
{
 +
  key = use altitude temperature-in-celcius forumat | simple example of Kerbin:
 +
  key = 70000 -270
 +
  key = 0 18
 +
}
 
}
 
}
 
</pre>
 
</pre>
 +
 
==Done!==
 
==Done!==
 
At the moment, coding in Kopernicus is not completed, due to the enormity of the subject. It will be done soon.
 
At the moment, coding in Kopernicus is not completed, due to the enormity of the subject. It will be done soon.
 +
 +
[[Category:Tutorials|Making a planet]]
 +
[[Category:Modding Tutorials|Making a planet]]

Latest revision as of 19:18, 2 May 2019

It was never very easy to create planets in KSP - it often required decompiling, which is against the EULA. After a long time looking, a mod called Kopernicus was released and found, making it easy to make planets.

Specifications

  • Length: 15-30 minutes
  • Difficulty: Medium
  • For version: 1.0.x

Steps

1. Obtaining the prequisites

You will need:

  • A text editor
  • An image editor
  • Kopernicus 0.1

Many developers prefer text editors like Notepad++, a rather advanced program. Image editors usually are advanced, but even Paint would work. You can find Kopernicus here. Updated forum information can be found here.

2. Setting up the basic file

Create a file, and name it: PLANET.cfg Change PLANET to your planet or moon's name. Inside the file, write this in:

@Kopernicus:AFTER[Kopernicus]
{
 Body
 {
 }
}

This declares that the file is a Kopernicus configuration file and a celestial body.

3. Adding the essential modules

Kopernicus configs are broken up into different segments described as in this tutorial as modules. An @ symbol before a module overrides the existing module - allowing for Kerbin to turn orange or something. It is unknown whether children of modules are affected by the parent's overriding. The 2 required modules are Properties and Orbit. They require several parameters, listed here:

Properties
{
 description = in game description
 radius = half of the diameter of the planet - used to define size of sphere with texture
 geeASL = planet's gravity in Kerbin gravities
 rotationPeriod = day in seconds
 rotates = whether it rotates | true or false
 tidallyLocked = is one side of the planet locked towards it's parent | true or false
 initialRotation = distance in degrees from the rotation point of origin
 isHomeWorld = is the space centre on this planet | true or false
 timewarpAltitudeLevels = set the altitude for 1, 5, 10, 50, 100, 1,000, 10,000 and 100,000x timewarps | example for allowing every level at sea level: 0 0 0 0 0 0 0 0
 ScienceValues
 {
  landedDataValue = multiplier for science points provided by surface samples or ground EVA reports
  spashedDataValue = same as ^, but for oceans
  flyingLowDataValue = same as ^, but for EVA and crew reports whilst flying below the flyingAltitudeThreshold
  flyingHighDataValue = same as ^, but for flying above the flyingAltitudeThreshold but below the spaceAltitudeThreshold
  inSpaceLowDataValue = same as ^, but for flying just above the spaceAltitudeThreshold
  inSpaceHighDataValue = same as ^, but for flying high above the spaceAltitudeThreshold 
  recoverValue = multiplier for all science transmitted back 
  flyingAltitudeThreshold = < in metres from sea level
  spaceAltitudeThreshold = < in metres from sea levels
 }
}
Orbit
{
 referenceBody = body the planet is orbiting, Kerbol is Sun
 inclination = distance at ascending node from horizontal in degrees, relative to the parent's equator
 eccentricity = unknown, likely the eccentricity of an ellipse (as KSP uses conics for orbits)
 semiMajorAxis = average of pe and ap: pe + ap / 2 = this
 longitudeOfAscendingNode = set to 0 to be safe; angle from reference plane to ascending node
 argumentOfPeriapsis = set to 0 to be safe; angle from ascending node to periapsis
 meanAnomalyAtEpoch = set to 0 to be safe; angular distance from pericenter which body would have if in a circular orbit with constant speed and same orbital period as actual object
 epoch = keep at 0; used to define specific epoch of the orbit
 color = use rgb, but change values to 1/255*value
}

4. Choosing what to do

Use the code bible below to help you find what you want to do.

Code bible

Contents:

  • Atmospheres
    • Adding an atmosphere
    • Adding an atmosphere effect NOT DONE

Adding an atmosphere

Add into the Body module and edit as necessary:

Atmosphere
{
 lightColor = tint of the light, in r,g,b format.
 enabled = true | you want one don't you?
 containsOxygen = true/false on oxygen in atmosphere
 altitude = height from sea level in metres
 PressureCurve
 {
  key = use altitude pressure format | simple example of Kerbin:
  key = 70000 0
  key = 0 1
 }
 TemperatureCurve
 {
  key = use altitude temperature-in-celcius forumat | simple example of Kerbin:
  key = 70000 -270
  key = 0 18
 }
}

Done!

At the moment, coding in Kopernicus is not completed, due to the enormity of the subject. It will be done soon.