Disclaimer
The below methods are acquired by self-studying (with a bit of consulting) and personal testing. That being said, I will not be held responsible in case your game will stop working, save files corrupted or you get a compromised gameplay of any sort (although these changes are not hard-coded and pretty safe, better advice first). Therefore, do it AT YOUR OWN RISK.
Pro-tip: always make backups BEFORE attempting any changes suggested by this guide. Not everyone has enough bandwidth to re-download the game from scratch because of some wrongdoing while modding.NOTE: this guide can be used to create a separate mod under the new modding system (much easier to handle and safe to make changes with, totally independent from the game directories and can be loaded and removed safely. I suggest people eager to mod to use this method as it minimizes the risk of corrupting the game by accident and/or making it unstable due to incorrect modding.)
I also reccommend to take a look at Artyom Zuev's modding system guide, freely available at the following link, which explains some fundamentals about the modding system and how to mod with it:
https://wiki.braceyourselfgames.com/en/PhantomBrigade/Modding/ModSystem
The guide is specifically created to illustrate in detail how to customize a missile launcher's guidance system, opening a huge modding potential when it comes to create a unique missile launcher. This mod can be also useful for those eager to know how the guidance system works.
Configuration files are actually exposed as .yaml
files. You can use any advanced notepad such as Notepad++ or Sublime Text for modding files of this extension. It is strongly adviced either one of these because YAML files have indents inside their code, which may not be saved correctly in case you just use Windows' Notepad, preventing the game to correctly load your mod due to incorrect syntax and/or wrong line indentation.
The concerned files are located inside DataDecomposed
's folder, Equipment
. The default path is …\PhantomBrigade\Configs\DataDecomposed\Equipment\Subsystems
. Missile Launchers can be easily identified with wpn_main_ml
format in configuration files.
Before diving into guidance data, we need to get a proper understanding of some basic concepts as it is difficult to customize this kind of values throught configuration files, especially without having proper knowledge of the effective changes which, in this case, requires a lot of testing.
Unlike ballistic projectiles, each missile laucher and any other weapon that needs to create unconventional trajectory have its own guidance system. Some are flying fast with a lack of targeting system, some are even slow but accurate and so on. The way missile launchers store their own guidance data is a huge modding opportunity to create particular weapons, including Missile Launchers.
In order to make the guide as simple as possible, we're going to explain some key values (not so easy to grasp for the less tech-savvy modders) that can be accessible and easy to understand especially for beginners.
Before going to the input type, the most simplest form of modding is the guidanceData
section. Under this section, the following variables can be customized:
rigidbodyMass
→ Missile's mass (weight). Ideal value to have best physics stability is 1
, but can be further reduced if dealing with problematic cases of inertia.rigidbodyDrag
→ Mechanical force of the missile when aligned to velocity vector. The maximum speed of a missile in this case depends on a combination of drag and acceleration force, so take these options in consideration when tweaking the the missile body drag.rigidbodyDriftDrag
→ Similar to what rigidBodyDrag
do. Only notable difference is we might need to tweak the mechanical force of the missile when aligned perpendicularly to velocity vector.rigidbodyAngularDrag
→ Drag force to slow down missile's angular velocity. A higher value means higher drag, preventing the missile to rotate too fast. A very low value may cause less drag force and a faster rotation (may be unstable). This property is particularly useful if the missile is struggling to stop turns they started.rigidbodyLift
→ The speed which the misaligned velocity of the rigidbody (the Missile/projectile in this case) is converted to aligned velocity.inputTargetPointLateralMode
→ Lateral offset mode of the missile (possible values are Interleaved
, Left
and Right
). Default value is set to Interleaved
.driverSteeringForce
→ The missile's force that performs the horizontal rotation (yaw). A higher value means the steering force will be more reactive while performing horizontal turns.driverPitchForce
→ The missile's force that performs the vertical rotation (pitch). A higher value means the steering force will be more reactive while performing vertical turns.driverAccelerationForce
→ The acceleration force used to push the missile forward (engine Thrust). the higher the value, the higher the force will be applied to missile to be pushed forward.driverAccelerationMin
→ The minimum threshold for the driverAccelerationForce
value which is linked between each other. Setting it above 0
prevents missiles from turning on the spot.inputProgressFromTarget
→ The flight program of the missile from the target. if set to true
, the program progress is derived from the distance between the user and the target. if set to false
, then the program progress is directly derived from how much time the missile can live, directly affected by the wpn_proj_lifetime
stat variable of the weapon.inputTargetHeightScale
→ The maximum scale which the missile can reach the maximum altitude, the peak of the trajectory relative to firing point.inputTargetOffsetPower
→ Offset radius for clustering output and eventually shifting points towards the center. A power value of 0.5
will shift the offset points away from the target, while a higher radius value (for example, Power of 2
) will shift most points towards the center. a power value of 1
permits a perfect balance in terms of uniform offset distribution.Unlike Firearms, which uses bullets, missile launchers have guidance data with the main inputs needed for the whole system to create the proper guidance data. The following (6 in total) we are focusing into are:
inputTargetHeight
→ Missile's capability to reach a set altitude, which is possible to travel at its desired height during the flight. Mainly affected from inputTargetBlend
variable. Technically speaking, this field determines whether target height equals start height (0
) or start + ceiling height (1
). Useful for making the missile vary the vertical component of its trajectory without the use of InputTargetBlend
.inputTargetLateral
→ Opposite of the above mentioned inputTargetHeight
, with the main difference being that this input mainly affects the Horizontal component of its trajectory, being affected by inputTargetBlend
as well.inputTargetBlend
→ Missile's turning ability that can be with either pointing at the target altitude or directly at the target position (ignoring the target altitude). A value of 0
means the missile orients itself to reach the target altitude for a moment in time. Setting it to 1
, the missile will then reach the target position instead.inputTargetUpdate
→ Affects the missile ability to remember the last known position of the target. Linked to inputTargetBlend
variable, it controls whether the missile receives target position updates. (values between 0 - 0.5
= missile will cease to receive updates about target position, while a value above 0.5
will let the missile get target position updates).inputTargetOffset
→ Whether the projectile tracks exact position of target unit or a point randomly offset by it (by separately defined radius and distribution). The exact amount is multiplied by wpn_scatter_radius
and raised to power of inputTargetOffsetPower
. This field is particularly reccommended for making less precise missiles by applying some offset away from the target.inputSteering
→ Missile's steering (rotation) property, which is possible to apply full steering force (value = 1
) or not steering at all (value = 0
). Missile steering force is mainly affected by driverSteeringForce
for horizontal turns and driverPitchForce
for vertical turns, as explained in the previous section. Use case of this property is to make missiles' trajectory/course correction over their lifetime (i.e.: missile that can precisly guide for their whole lifetime and then accelerate without guidance in the end of the course).inputThrottle
→ Missile's speed. Setting the value to 0
, the missile will not accelerate. On the other hand, changing to 1
will accelerate at maximum force, affected by the value set in driverAccelerationForce
.inputThrottleDotPower
→ Power applied (to dot product) of facing direction against the target direction used as throttle multiplier. If the value is set to 1
, the missile will throttle proportional to alignment, while setting the value at 16
will let the missile throttling to fire only on nigh perfect alignment and so on.directionCheck
→ Special property that makes the missile lose steering ability when and if the target goes out of certain dot product cone while within a certain distance. To quote one handy use case is when producing cinematic misses, where missile will not turn sideways when nearly missing the target and will jousts past target before regaining ability to correct guidance course instead.velocityCompensation
→ Missile's ability which determines how well the missile guidance predicts the future position of a unit.Some general key points when editing each input:
constant
data block makes the system use a fixed value provided by the user (function name: !DataBlockGuidanceInputConstant
). Example of sub-field: value
.!DataBlockGuidanceInputLinear
). Example of sub-fields: valueFrom:
, valueTo:
and timeRange:(x:, y:)
.curve
data block is similar to how InputTargetHeight
and InputTargetBlend
we used before - granting full control from the user (function name: !DataBlockGuidanceInputCurve
). Example: (See the curve format section explained below).The most difficult aspect of guidance modding, but also one of the most interesting.
Missiles alone can only go straight by relying on basic datas like throttle, mass and other properties. Therefore, they need to be properly instructed by setting up a curve format. It is basically a set of set coordinates and control points where the missile will then ‘read’ and follow based on these informations. It is the main core of the whole guidance data, which can be modified to give a unique property of their trajectory and can be customized in every way.
Some basic introductions and advice about the curve format to take in consideration:
modePostWrap
and modePreWrap
, best to keep them at ClampForever.
keys
→ Control points of the curve. Each key is a curve point that has the following fields:tv_tg:
→ Acronym of time
, value
, tangent (in)
and tangent (out)
. The most important values here are two: time,value
;x:
→ X-Axis of the curve.y:
→ Y-Axis of the curve.z:
→ Z-Axis of the curve.w:
→ Weight. Unless there's a need to make complex curves we don't need to worry about it.m:
→ Mode. Unless there's a need to make complex curves, this one is not much important;Inside each control point of the curve we can create new list element of tv_tg
under keys:
variable, composed by its coordinates ( x:
, y:
and z:
), weight (w:
) and mode (m:
). Each key can be placed between input types (listed in the previous section) according to modding goals and the changes we want to achieve. Can be either customized, replaced or left empty, giving the user more freedom during the modding process.
While this guide is mostly suited for advanced modding, it may misses a lot of important aspects that are missing from this guide. Especially, the present has been created to show, as explained in the beginning, to introduce modders about the complex mechanism of the guidance system AND to open another modding option at our disposal.
Notice that Missile Launchers aren't actually the only weapons in the game that uses guidance data to create a target system. Notable examples of such weapons with guidance are Plasma Repeater/Launchers and Fire repeaters to make non-solid rounds guided, to demonstrate that is not a component solely created for Missile Launchers, but also for other guided weapons.
Feel free to play with these values as explained. You can even create non-guided rockets, vertical missile launchers or even swarming and zig-zag missiles! options are infinite!
In case you feel upset or something's not clear here, you can reach me on Discord at @MiketanJP
on the official BYG Discord or directly message at #phantom-modding
channel. I am also open for feedbacks in order to further improve this guide!
Hope it helps and see you there!