1.2.2 Bullet Configuration - PapaJoesSoup/BDArmory GitHub Wiki
Bullet Configuration
- Currently defined in BD_Bullets.cfg
- Modders can maintain their own configurations as long as names do not collide there should be no issue. Also remember to define a resource for your custom ammunition
| Bullet Config | ||
|---|---|---|
| caliber | caliber of barrel in mm | |
| bulletVelocity | Muzzle velocity in m/s | |
| bulletMass | mass in KG | |
| explosive | True/False | Explosive bullets explode on impact or shortly after penetration |
| tntMass | Mass of TNT in KG | explosive property |
| blastPower | force | Deprecated, use tntMass |
| blastHeat | damage | Deprecated, use tntMass |
| blastRadius | radius of damage | Deprecated, use tntMass |
| apBulletDmg | for additional penetration | To Be Implemented |
| bulletDragTypeName | Drag Type None, AnalyticEstimate, NumericalIntegration | Has No Effect on Trajectory, only Impact Velocity |
Ballistic Damage Formulas
We are scaling the output for the kinetic calculation being Joules, thus the 1e-4 multiplier at the end
Note that bulletDmgMult is a per part option in ModuleWeapon for per weapon balancing as an option
double damage = ((0.5f * (mass * Math.Pow(impactVelocity, 2)))
* (DMG_MULTIPLIER / 100) * bulletDmgMult
* 1e-4f);
Example Bullet Config
BULLET
{
name = 30x173HEBullet
caliber = 30
bulletVelocity = 1180
bulletMass = 0.3880
//HE Bullet Values
explosive = True
tntMass = 0.3104
blastPower = 2 //deprecated, use tntMass, left in for legacy support
blastHeat = 3.7 //deprecated, use tntMass, left in for legacy support
blastRadius = 2.5 //deprecated, use tntMass, left in for legacy support
apBulletMod = 3 //not yet implemented
bulletDragTypeName = AnalyticEstimate
}
Ballistic Coefficient
BC is now calculated in code based on mass / caliber of bullet using the following
//A = π x (Ø / 2)^2
bulletDragArea = Mathf.PI * Mathf.Pow(caliber / 2f, 2f);
//Bc = m/Cd * A
bulletBallisticCoefficient = bulletMass / ((bulletDragArea / 1000000f) * 0.295f); // mm^2 to m^2
Notes
- AP bullets to be implemented