Skip to content

Modding

Nils Fürniß edited this page Jul 14, 2020 · 2 revisions

Introduction

You can find levels and rockets in the Data folder. You can add new levels and new rockets or change existing levels / rockets if you want to. If you want to add your own rocket or want us to add an interesting rocket you can make a request for it here

How rockets are defined

You can find all rockets in the Data/Rockets folder. The properties as well as the sprite are defined as json.

Property Type Explanation
Model String Field for the model name of the rocket, used in InfoScreen
Variant String Some models have different variants, also used in InfoScreen
Manufacturer String The name of the main manufacturer, will be displayed in InfoScreen Information
Names String[] A name list of previously flown rockets of this model / variant, when a rocket is created one is picked randomly
Height Float The height of the rocket in metres
Width Float The maximum diameter of the rocket in metres
Thrust Float The thrust of the rocket in newton
Weight Float The weight of the fully fueled rocket without payload in kg
FuelWeight Float The fuel weight of the rocket in kg, it will slowly be subtracted from the weight during flight according to thrust level
BurnTime Float The average burn time of the rocket until MECO
DragProperties DragProperties Used to calculate the approximate drag of the rocket
ThrustAreas ThrustArea[] Tells the program where to draw the rockets flames
Sprite RocketSpritePiece[] A List of different colored Polygons that are drawn all at once and look like the rocket

DragProperties:

Property Type Explanation
CdUp double Drag coefficient when the rocket flies straight up (0° angle), usually Cd of the fairing
CdSide double Drag coefficient of the rocket flying upwards sideways
AreaUp double The reference area if flying upwards
AreaSide double The reference area if flying sideways

ThrustArea

Property Type Explanation
Start PointF Start of the thrust area relative to the center of the rocket
Stop PointF End of the thrust area, hast to have same y coordinate as start and x must be > start x

RocketSpritePiece

Property Type Explanation
Points PointF[] Points relative to the geometric center of the rocket, defining a polygon
Brush SolidBrush A Solid Brush with the color as RGB

Easily create a rocket sprite

Creating a new rocket sprite used to be a very tedious task. That's why I wrote a simple program for it. You can find it here.

How to use:

You can find a small video tutorial here

  1. Find an image showing the desired rocket from the side
  2. Crop it so that only the rocket is visible. Example
  3. Input the maximum height and diameter
  4. Load the previously cropped rocket
  5. Every time you left click on the image a polygon point will be stored
  6. When you are finished with a polygon (it will be closed automatically) you can right click to select its color
  7. Press Output Shape data or Output mirrored shape data (then you only have to do one side, fairing f.e. are perfectly mirrored most of the time)
  8. The Polygon was now copied to your clipboard
  9. Open your custom rocket.json and paste the contents of your clipboard into the Sprite array
  10. Repeat 5-9 until you have created the whole rocket

How Levels are defined

Levels are really just a collection of rockets and planets. The rockets are placed at a coordinate and a momentum and the planets are just Circles with a color a position, a Mass and a Radius:

Level

Property Type Explanation
Rockets RocketDto[] List of rockets
Planets TerrainDto[] List of planets

RocketDto

Property Type Explanation
Location PointF The starting position of the rockets center
Force Force The intial force
Acceleration Acceleration The intial acceleration
Speed Speed The intial speed
Angle Angle The intial angle in degree and radian
ThrustPercentage float The initial thrust in % (0-1)
Type String Name of the rocket file without .json

TerrainDto

Property Type Explanation
Position PointF The position of the Planet
Radius Float The radius of the planet in km
Color Color The color the planet is filled with
Mass Float The mass of the planet (used to calculate its gravity)
Clone this wiki locally