The last step in our engine creation adventure is to build out the config, which is a special kind of text file that defines the stats and behaviour of this part. It’s customary to simply copy the config over from another similar part, so I won’t go over everything. Nonetheless, I’ll mention some important key modules that will be useful for engines.
Everything below unless otherwise stated will be inside the main PART
module.
Inside the main module, you’ll want to define your part model here. Set model
to whatever your .mu file is named; you don’t need to include the extension.
MODEL {
// My model is called MESwallow.mu
model = Swallow/Parts/Engine/MESwallow
position = 0, 0, 0
rotation = 0, 0, 0
scale = 1, 1, 1
}
Most configs you might find will define their nodes using a coordinate system. Since we created the node_stack_top and node_stack_bottom empties in Blender, though, we can simply ask KSP to create nodes at those locations:
NODE
{
name = top
transform = node_stack_top
size = 1
method = FIXED_JOINT
crossfeed = True
rigid = False
}
NODE {
name = bottom
transform = node_stack_bottom
size = 1
method = FIXED_JOINT
crossfeed = True
rigid = False
}
The only real value you’d probably want to adjust is size
: use 0 if your part is radial size 0.625m/tiny, 1 for 1.25m/small, 1.5 for 1.875m/medium, 2 for 2.5m/large, and so forth. If nothing is specified (or if you specify an erroneous size), it’ll default to 1.
For any engine, the ModuleEnginesFX module defines how the engine actually performs as a propulsive device, including fuel consumption and efficiency.
For the PROPELLANT
modules, you’ll need to define the fuel-oxidiser mixture ratio, which you can reference with the table below. Note that despite first impressions, “ratio” is not literally the ratio of fuel/oxidiser, but the rate of resources consumed. A fuel ratio of 3.0 will actually drain fuel 10x faster than if it were set to 0.3.
Engine configuration | Fuel | Fuel ratio | Oxidizer ratio |
---|---|---|---|
Stock LFO/kerolox | LiquidFuel |
0.9 | 1.1 |
CryoEngines methalox | LqdMethane |
3.0 | 1.0 |
CryoEngines hydrolox | LqdHydrogen |
1.5 | 0.1 |
The atmosphereCurve
defines the engine’s ISP at various atmospheric pressures. Each key
consists of two numbers: the first being a pressure in Kerbin sea-level atmospheres, and the second being the engine ISP. For example, the following atmosphereCurve
defines a vacuum-optimised engine that is very efficient in the vacuum of space (0 atmospheres) but otherwise performs poorly at sea level (1 atmospheres):
atmosphereCurve
{
key = 0 350
key = 1 90
key = 4 10
key = 12 0.1
}
Remember our gimbal empty in our Blender file? In our config we’ll use ModuleGimbal
to define the thrust vectoring ability of our engine. Gimbal bones also function identically.
MODULE {
name = ModuleGimbal
gimbalTransformName = gimbal
// gimbalRange is in degrees
gimbalRange = 2.5
gimbalResponseSpeed = 30
useGimbalResponseSpeed = true
}