Flight Parameter Setup on Ships, Engines, and Thrusters
Flight Parameter Setup
Engine Parameters
Engines define basic thrust parameters, as well as boost and travel drive thrust multipliers and settings.
<boost duration="7" thrust="8" acceleration="4" release="3" coast="1.25" />
<travel charge="1" thrust="14" attack="30" />
Boost parameters:
- Duration: Seconds of boost available at full boost capacity.
- Thrust: Multiplier of base thrust while boosting, which defines the maximum boost speed.
- Acceleration: Multiplier of base acceleration while boosting.
- Important: Ensure that the boost top speed can actually be reached within the duration (ideally taking ship modifications into account, too).
- Release: Seconds of reduced deceleration before the amplified braking kicks in (see "deceleration curves" further down).
- The time spent maintaining all or parts of the boost speed is called coasting.
- Coasting is cut short if players adjust throttle or brake manually.
- Coast: Multiplier of base deceleration while coasting out of boost in the release phase.
- In the example, the ship will finish boosting to then coast with 125% of its normal deceleration value for 3 seconds, before the 300-600% deceleration curve kicks in.
- Coasting should generally not reward short bursts of boost over longer activations (see further defaults balancing below to avoid exploits).
- Best practice: Keep release within 0-6s and aim for a coast factor of 1.1-1.3 to avoid deceleration kicking in too suddenly after coasting.
Travel drive settings are set up as follows:
- Charge: The time in seconds before travel drive kicks in.
- Thrust: Multiplier of base thrust while in travel drive mode, which defines the maximum travel drive speed.
- Attack: The time in seconds before reaching the maximum travel drive speed.
- Note that deceleration from travel drive is no longer defined here via the now deprecated Release parameter.
- Instead, reverse thrust and deceleration curves govern braking distances.
Deceleration is artificially increased under certain conditions, as defined by 2 curves on the engine:
<point position="1.01" value="1"/>
<point position="1.25" value="3"/>
<point position="1.75" value="7"/>
<point position="2.5" value="10"/>
</decelerationcurve>
<strafecurve>
<point position="1.01" value="1"/>
<point position="1.25" value="3"/>
<point position="1.75" value="8"/>
<point position="2.5" value="10"/>
</strafecurve>
- Decelerationcurve applies to the forward momentum, decreasing or increasing braking distances.
- Strafecurve applies to the lateral momentum, decreasing or increasing driftiness at higher speeds.
- Value is a multiplier of the base deceleration.
- Position is relative to regular top speed (0-1), boost top speed (1-2), and TD top speed (2-3).
- Where boost speed is higher than travel drive speed, those values are flipped.
- Where boost and travel drive speed are within 15% of each other, code enforces a 15% gap between positions 2 and 3.
- Where no travel drive is available, boost speed becomes position 3 and position 2 is set to the half-way mark between boost and regular speed.
Best practices:
- The faster an engine goes, the more Value needs to be applied to reach reasonable braking distances.
- Faction flavour also factors in here, with Teladi and Terrans generally braking better than Argon and Paranid.
- Combat engines may at time favour good braking between position 1 and 2, as this range is mostly used in dogfights.
- Travel engines may at time favour good braking between position 2 and 3, as this range is mostly used when approaching a dock.
Thruster Parameters
Thrusters define the thrust of strafe, pitch (up/down), yaw (left/right), and roll.
- YAW and PITCH are now generally equalized; if we want ships to have an imbalance here, we apply it to that ship's drag and inertia instead.
- As a rule of thumb, the ship's visual design and thruster placement should determine if it is faster to roll and pull up to turn left and right.
- Strafe thrust provides the anti-slide acceleration crucial in determining how much a ship drifts.
- As the generic thrusters need to work on all ships, the ship itself defines if it should feel heavy, sluggish, drifty, nimble, or like "on rails".
- Avoid strafe speeds and accelerations from overtaking forward speeds and accelerations by keeping generic thruster thrust of any given ship size below the weakest, corresponding engine option.
Ship Parameters
Acceleration modifiers can now be defined in the <physics> block of the ship macro:
<accfactors forward="1" reverse="1" horizontal="0.85" vertical="0.85" />
</physics>
Here, strafing acceleration was reduced by 15% to get the ship to drift more.
Note that it is better to modify mass if all acceleration factors should shift in the same direction.
The following boost activation parameters, defined on the ship, are mostly treated as constants. Therefore they are generally defined via the defaults.xml file.
- Threshold: How much percent of boost duration needs to remain for boost to be activated.
- Rechargedelay: Seconds that need to pass since release of boost before its capacity starts recharging again (used to prevent micro-boost exploit and used for balancing of racing ships).
- Minduration: Seconds that boost is active (and reduces capacity) even if the control input is pressed for a shorter period of time (used to prevent micro-boost exploit and used for balancing of racing ships)
All accelerations are now modified by a jerk system. This adds a curve to the acceleration change itself.
It is defined in the ship's <properties> block:
<forward accel="0.8" decel="0.8" ratio="4"/>
<forward_boost accel="0.8" ratio="3"/>
<forward_travel accel="0.5" decel="0.8" ratio="3"/>
<strafe value="1" ratio="1"/>
<angular value="1" ratio="1"/>
</jerk>
- ACCEL is the amount of smoothing to be applied when gaining speed, expressed from ~0.1 (super slow ramp up) to 1 (linear, no smoothing to acceleration).
- DECEL is treated the same way when reducing speed.
- Note that DECEL from TD is not used in X4 7.5.
- VALUE is the same as ACCEL and DECEL, but for those cases where we do not care about the direction of the thrust (i.e. you don't "unturn" left any differently than you accelerate to the right).
- RATIO shifts the point where the highest acceleration was reached and acceleration is expected to drop again towards max speed.
- A ratio of 1 is the mid-point toward max speed.
- The lower cap is around 0.25, which leads to a very fast ramp up in speed which slows dramatically as you reach the last m/s of your top speed (not used on content in X4 yet).
- The upper cap is around 4, which leads to a much slower ramp up that feels sluggish - as if the fuel takes a while to reach the engines.
Here's an example for a very "soapy", heavy freighter that reacts very reluctantly to control inputs:
<forward accel="0.3" decel="0.7" ratio="4"/>
<forward_boost accel="0.5" ratio="4"/>
<forward_travel accel="0.4" decel="0.8" ratio="3"/>
<strafe value="0.6" ratio="1"/>
<angular value="0.2" ratio="1"/>
</jerk>
Note that improved thrusters will not eliminate the general feel of this ship. Every rotation input (steering) slowly ramps in and out, making it harder to aim frontal guns at a target.
Zero player input feedback should be avoided, e.g. when a very low boost accel leads to no speed increase in the first second of boosting.
Depending on how sluggish a ship is in general, the accel values may therefore need to be harmonised with the weakest engine options.
Steering top speed is limited based on the current flight speed, defined by speed curves on the ship:
<point position="1.01" value="1"/>
<point position="1.6" value="0.8"/>
<point position="2" value="0.4"/>
<point position="2.3" value="0.15"/>
<point position="2.7" value="0.075"/>
</steeringcurve>
- VALUE is a multiplier of the steering speed.
- POSITION is relative to regular top speed (0-1), boost top speed (1-2), and travel drive top speed (2-3).
- The example above shows how steering is at 100% (multiplier value = 1) when going up to 101% of speed (that +1% helps against floating point imprecision)
- In this case, going 101% - 160% of regular speed decreases steering by 20% (multiplier value = 0.8).
- Entering travel drive speeds (anything beyond position 2), steering rapidly drops all the way down to 7.5% (X4's steering curve at max TD speed was about 10%).
Balancing of steering curves are done in broad strokes per faction. Paranid for example have fast travel drive speeds, but are not very manoeuvrable while at high speed. Terrans are generally the opposite (slow, but nimble).
Some ship types override this faction flavour, with interceptors, scouts, raiders, and light destroyers generally staying more nimble at high speeds.