Skip to content

Ammo Properties

BDCarrillo edited this page Dec 27, 2021 · 25 revisions

Ammo Properties


Base Config Section

private AmmoDef ExampleAmmoClassID => new AmmoDef // Ammo Class ID
        {
            AmmoMagazine = "MagazineID",// Energy, for Energy-Based weapons
            AmmoRound = "AmmoName",
            HybridRound = false, //AmmoMagazine based weapon with energy cost
            EnergyCost = 0.5f, //(((EnergyCost * DefaultDamage) * ShotsPerSecond) * BarrelsPerShot) * ShotsPerBarrel
            BaseDamage = 5000f,
            Mass = 220f, // in kilograms
            Health = 2, // 0 = disabled, otherwise how much damage it can take from other trajectiles before dying.
            BackKickForce = 60f,
            HardPointUsable = true, // set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.

The Basic Header, for an Ammo

AmmoMagazine = "MagazineID",// Energy, for Energy-Based weapons This is your AmmoMagazine SBC SubtypeID, allowing it to consume ammo mags'. To make a weapon an energy weapon (pure energy, no magazine consumption), set this ID to "Energy".

You do not need to make an Magazine named "Energy", "Energy" is an AmmoMagazine Entry in WeaponCore itself. Do not override it.

AmmoRound = "AmmoName",

This is the unique identifier for each ammo type, and is displayed in the terminal as the name of the ammo. Use this to specify ammos in Shrapnel and Pattern defs, and for server config ammo modifiers.

HybridRound = false, //AmmoMagazine based weapon with energy cost

This Line enables, or disables, the Energy Cost, when an Non-"Energy" Magazine ID is given.

BaseDamage = 5000f,

This is your Basic Damage pool, this is consumed on contact with a target, removing that target's HP from this Damage Pool.

This is how Penetration works; The Projectile keeps traveling through blocks, until BaseDamage is depleted, with each block destroyed removing said Block's HP pool from the Damage Pool.

This value is identical, to the Keen GridDamage Value, and operates in 100's: Each Steel plate in a block is worth 100 HP, as a baseline.

Health = 2, // 0 = disabled, otherwise how much damage it can take from other trajectiles before dying.

Health, is the Projectile's HP pool, when facing Anti-Missile Weapons, and has no relation outside of EWAR & AMS; These AMS Values, are independent of BaseDamage, Please keep your Projectile Health Low, Values for AMS & HP are in 1-3 Ranges for most projectiles.

Projectiles with Health are valid targets, for AMS weapons; Projectiles with a Health of 0, are not targetable.

Mass = 220f, // in kilograms
BackKickForce = 60f,

Mass, is the force applied onto the target hit by the Projectile, while BackickForce is the force applied onto the shooter.


Shape Section

 Shape = new ShapeDef //defines the collision shape of projectile, defaults line and visual Line Length if set to 0
            {
                Shape = LineShape,
                Diameter = 1,
            },
            ObjectsHit = new ObjectsHitDef
            {
                MaxObjectsHit = 0, // 0 = disabled
                CountBlocks = false, // counts gridBlocks and not just entities hit
            },

Shape, is your Projectile's non-visual shape, used for Hit Detection.

  • LineShape is a line
  • SphereShape is a sphere

ObjectsHit, is an Old & alternate method of handling Penetration weapons, and can be used to hard-lock the max number of blocks (Or grids) penetrated by a projectile.


Shrapnel/Fragment Section

Fragments, or shrapnel, are spawned upon the death of the current projectile. There are many options to control the quantity and distribution of fragments, detailed at the Ammo - Fragment Properties page.


Damage Scales Section

  DamageScales = new DamageScaleDef
            {
                MaxIntegrity = 0f, // 0 = disabled, 1000 = any blocks with currently integrity above 1000 will be immune to damage.
                DamageVoxels = false, // true = voxels are vulnerable to this weapon
                SelfDamage = false, // true = allow self damage.
				HealthHitModifier = 15, // defaults to a value of 1, this setting modifies how much Health is subtracted from a projectile per hit (1 = per hit).

				 FallOff = new FallOffDef
                {
                    Distance = 5000f, // Distance at which max damage begins falling off.
                    MinMultipler = 1f, // value from 0.0f to 1f where 0.1f is equal to a min damage of 10% of max damage.
                },
				
                // modifier values: -1 = disabled (higher performance), 0 = no damage, 0.01 = 1% damage, 2 = 200% damage.
                Characters = -1f,
                Grids = new GridSizeDef
                {
                    Large = 0.5f,
                    Small = -1f,
                },
                Armor = new ArmorDef
                {
                    Armor = -1f,
                    Light = 0.5f,
                    Heavy = 0.1f,
                    NonArmor = 0.1f,
                },
                Shields = new ShieldDef
                {
                    Modifier = -1f,
                    Type = Kinetic,
				
                                    },

This is the Damage Scales & Damage Modifier Section, this handles damage multiplication.

MaxIntegrity = 0f, // 0 = disabled, 1000 = any blocks with currently integrity above 1000 will be immune to damage.
                DamageVoxels = false, // true = voxels are vulnerable to this weapon
                SelfDamage = false, // true = allow self damage.
				HealthHitModifier = 1, // defaults to a value of 1, this setting modifies how much Health is subtracted from a projectile per hit (1 = per hit).

MaxIntegrity, means the HP of the targeted block, if above the given value, will be immune to this Projectile: Block HP is measured in Hundreds.

DamageVoxels, controls if the Projectile will delete voxels on contact.

Self-Damage, allows the weapon to damage the parent grid.

HealthHitModifier, is the AMS Value, for the Projectile: On contact with a Projectile that has Health, this value is removed from that HP.

Projectile HP ranges typically in low numbers, such as 1-3, HealthHitModifier follows this trend: Please keep these values Low.

Beam Weapons, apply their AMS Value per tick: a Value of 1 on a Beam, is 60xValue per Second.

 FallOff = new FallOffDef
                {
                    Distance = 5000f, // Distance at which max damage begins falling off.
                    MinMultipler = 1f, // value from 0.0f to 1f where 0.1f is equal to a min damage of 10% of max damage.
                },

Fall-off Range is measured in Meters, away from the Projectile's Origin (Typically your Weapon), and is the start point for Fall-Off to begin.

MinMultiplier, is the lowest % that your Projectile's death can reach, at the furthest range.


 Characters = -1f,
                Grids = new GridSizeDef
                {
                    Large = 0.5f,
                    Small = -1f,
                },
                Armor = new ArmorDef
                {
                    Armor = -1f,
                    Light = 0.5f,
                    Heavy = 0.1f,
                    NonArmor = 0.1f,
                },

These are the most common Damage Modifiers: -1, is default unchanged, 1 is 1x, 2x is double damage, 0.5f is 50% damage reduction.

Characters, are Player & NPC Character objects.

Large & Small Grid, damage is modified by these values.

  • Armor, is basic armor blocks.
  • Light is the Light type of Armor blocks
  • Heavy, is the Heavy Armor type; Keep in mind, Cube Heavy Armor has a natural 50% Damage resistance by default, before this modifier is applied.

Non-Armor, is any block (such as Turrets, Engines, Cockpits), that is not an Armor-Block.

    Shields = new ShieldDef
                {
                    Modifier = -1f,
                    Type = Kinetic,
				

Shields, is a special modifier.

It allows either Energy or Kinetic for Type, which can be modulated by the Ship. The addition of BypassModifier = 0.5f to this section, allows the projectile to bypass shields with a damage reduction indicated by the value.

  • 0.5f is 50%
  • 0.75f is 25% damage reduction
  • 1.0f is 0% damage reduction

Damage reduced in this fashion, is dealt to the Shield as Energy Type Damage.


Area Of Effect Section

These effects can apply damage to a range of blocks based upon custom settings. They can be thought of as blast, explosive, splash, etc. Consult Ammo - AOE Properties for specifics.

There is an additional group of effects, collectively called EWAR, that can be utilized as well. They go above and beyond basic damage, with unique alterations to block or grid behavior. Full details can be found on the Ammo - Electronic Warfare System (EWAR) page.


Beam Section

     Beams = new BeamDef
            {
                Enable = false,
                VirtualBeams = false, // Only one hot beam, but with the effectiveness of the virtual beams combined (better performace)
                ConvergeBeams = false, // When using virtual beams this option visually converges the beams to the location of the real beam.
                RotateRealBeam = false, // The real (hot beam) is rotated between all virtual beams, instead of centered between them.
                OneParticle = false, // Only spawn one particle hit per beam weapon.
            },

Enable, converts this weapon to a Beam; This means projectile's desired speed is ignored, and the Projectile expects a weapon RPM of 3600.

Beams can curve', track, use shrapnel, or the like, however they are hitscan, unless the TravelTime Line is added in the Trajectory Section. MaxTrajectoryTime = 600, , This line is in ticks (60 Ticks per Second)

Virtual Beams, if enabled, means only 1 beam actively deals damage , triggers shrapnel, or damages voxel, but takes all beams of this type, fired by the Weapon, and merges their damage stats.

Converge, visually merges the beam effects, into the "Hot" Beam.

OneParticle, reduces particle generation to 1 particle per target hit: This is suggested.

Beams, require a Tracer & Trail, to function Properly.


Trajectory Section

Trajectory = new TrajectoryDef
            {
                Guidance = None, //ammo guidance type, options are None, Smart, Remote(not used yet), TravelTo(if tracking travels to target Position, if none tracking travels to max trajectory, good for flak), DetectFixed(mines), DetectSmart(mines), DetectTravelTo(mines)
                TargetLossDegree = 80f,
                TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
                MaxLifeTime = 1500, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
                AccelPerSec = 0,
                DesiredSpeed = 1250,
                MaxTrajectory = 7000f,
				MaxTrajectoryTime = 600,
                FieldTime = 0, // 0 is disabled, a value causes the projectile to come to rest, spawn a field and remain for a time (Measured in game ticks, 60 = 1 second)
                GravityMultiplier = 0f, // Gravity influences the trajectory of the projectile.
                SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed
                RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory

Visit the Ammo - Guidance System (Homing, Mines, Self-Guided) for details on the options for the Guidance Line.

MaxLifeTime = 1500, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)., is the Max life spawn, in ticks, for the projectile, this is typically used to ensure the death of a projectile, should it fail to hit either a target or MaxTrajectory Distance.

AccelPerSec = 0,, is in Meters, and the Acceleration per second of the Projectile, this is used by SMART type weapons, and can be disabled by leaving it at 0: Which lets the projectile spawn at DesiredSpeed directly.

DesiredSpeed = 1250, is in Meters, and is the projectile's intended velocity before randomizers (which are optional)

MaxTrajectory = 7000f, is in Meters, and is the max range or distance, the Projectile can travel.

GravityMultiplier = 0f, // Gravity influences the trajectory of the projectile. is the influence of Planetary Gravity (Not Artificial), on the projectile, this line can not be used with the SMART system, unless using Shrapnel.

  SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed
                RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory

These are Randomizers, with min & max value ranges, that adjust these values, per projectile fired.


Graphics Section

 AmmoGraphics = new GraphicDef
            {
                ModelName = "",
                VisualProbability = 1f,
                ShieldHitDraw = true,
                Particles = new AmmoParticleDef
                {
                    Ammo = new ParticleDef
                    {
                        Name = "", //ShipWelderArc
                        Color = Color(red: 255, green: 255, blue: 255, alpha: 32),
                        Offset = Vector(x: 0, y: 0, z: 0),
                        Extras = new ParticleOptionDef
                        {
                            Loop = true,
                            Restart = false,
                            MaxDistance = 5000,
                            MaxDuration = 1,
                            Scale = 1,
                        },
                    },

Model if left blank, disables spawning a mesh-based object: ModelName = "\\Models\\Ammo\\MissileModel", , is an example of a valid model path for this.

VisualProbility is in %, of how often your Model is visible per projectile.

This next section, handles a Particle SBC SubtypeID, and spawns it on your projectile.

   Hit = new ParticleDef
                    {
                        Name = "ParticleSubtypeID",
                        ApplyToShield = true,
                        ShrinkByDistance = true,
                        Color = Color(red: 255, green: 45, blue: 45, alpha: 32),
                        Offset = Vector(x: 0, y: 0, z: 0),
                        Extras = new ParticleOptionDef
                        {
                            Loop = true,
                            Restart = false,
                            MaxDistance = 5000,
                            MaxDuration = 1,
                            Scale = 1f,
                            HitPlayChance = 1f,
                        },
                    },

This is an Particle SBC subtypeID Slot, for your wanted Particle when the projectile hits a target.

ApplytoShield, controls if the Projectile still generates this particle if it hits a shield.


Tracer Section

Lines = new LineDef // Tracer Configuration Area
                {
                    ColorVariance = Random(start: 0.75f, end: 2f), // multiply the color by random values within range.
                    WidthVariance = Random(start: 0f, end: 0f), // adds random value to default width (negatives shrinks width)
                    Tracer = new TracerBaseDef
                    {
                        Enable = true, // If Tracer will be used.
                        Length = 5f, // Line Length \ Distance
                        Width = 0.1f, // Line Thickness. 
                        Color = Color(red: 3, green: 2, blue: 1f, alpha: 1),
                        VisualFadeStart = 0, // Number of ticks the weapon has been firing before projectiles begin to fade their color
                        VisualFadeEnd = 0, // How many ticks after fade began before it will be invisible.
                        Textures = new[] {// WeaponLaser, ProjectileTrailLine, WarpBubble, etc..
                            "WeaponLaser",
                        },
                        TextureMode = Normal, // Normal, Cycle, Chaos, Wave
                        Segmentation = new SegmentDef
                        {
                            Enable = false, // If true Tracer TextureMode is ignored
                            Textures = new[] {
                                "",
                            },
                            SegmentLength = 0f, // Uses the values below.
                            SegmentGap = 0f, // Uses Tracer textures and values
                            Speed = 1f, // meters per second
                            Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
                            WidthMultiplier = 1f,
                            Reverse = false,
                            UseLineVariance = true,
                            WidthVariance = Random(start: 0f, end: 0f),
                            ColorVariance = Random(start: 0f, end: 0f)
                        }
                    },
                    Trail = new TrailDef
                    {
                        Enable = false, // If Trail is spawned.
                        Textures = new[] {
                            "",
                        },
                        TextureMode = Normal,
                        DecayTime = 128, //  Time in Ticks, (60 per second), that the trail exists. 120 means 2 seconds before each trail section despawns.
                        Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
                        Back = false,
                        CustomWidth = 0,
                        UseWidthVariance = false, 
                        UseColorFade = true,
                    },
                    OffsetEffect = new OffsetEffectDef
                    {
                        MaxOffset = 0,// 0 offset value disables this effect
                        MinLength = 0.2f,
                        MaxLength = 3,
                    },
                },

The Tracer Section in Full.

 Tracer = new TracerBaseDef
                    {
                        Enable = true, // If Tracer will be used.
                        Length = 5f, // Line Length \ Distance
                        Width = 0.1f, // Line Thickness. 
                        Color = Color(red: 3, green: 2, blue: 1f, alpha: 1),

Basic Tracer section

  • Length is the Length of the Tracer element itself, width is the actual width of the line
  • Color is RGBA, with emissive support; Numbers in the 100-255 range have extensive bloom
  Textures = new[] {// WeaponLaser, ProjectileTrailLine, WarpBubble, etc..
                            "WeaponLaser",
                        },
                        TextureMode = Normal, // Normal, Cycle, Chaos, Wave
                        Segmentation = new SegmentDef
                        {
                            Enable = false, // If true Tracer TextureMode is ignored
                            Textures = new[] {
                                "",
                            },
                            SegmentLength = 0f, // Uses the values below.
                            SegmentGap = 0f, // Uses Tracer textures and values
                            Speed = 1f, // meters per second
                            Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
                            WidthMultiplier = 1f,
                            Reverse = false,
                            UseLineVariance = true,
                            WidthVariance = Random(start: 0f, end: 0f),
                            ColorVariance = Random(start: 0f, end: 0f)
                        }
                    },

Animated Tracer section.

Textures area, refers to SubtypeIDs from an TransparentMaterials SBC, and specific texture method; DDS BC3 or DDS BC7, with a custom series of tracer textures' aligned & split into strips.

 Trail = new TrailDef
                    {
                        Enable = false, // If Trail is spawned.
                        Textures = new[] {
                            "",
                        },
                        TextureMode = Normal,
                        DecayTime = 1, //  Time in Ticks, (60 per second), that the trail exists. 120 means 2 seconds before each trail section despawns.
                        Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
                        Back = false,
                        CustomWidth = 0,
                        UseWidthVariance = false, 
                        UseColorFade = true,
                    },
                    OffsetEffect = new OffsetEffectDef
                    {
                        MaxOffset = 0,// 0 offset value disables this effect
                        MinLength = 0.2f,
                        MaxLength = 3,
                    },

This is spawned, when enabled , behind your Tracer on the projectile.

Decay, is the lifespan in seconds, of your Trail behind the projectile; Longer decay times is more expensive.


Audio Section

AmmoAudio = new AmmoAudioDef // Audio, references SubtypeIDs from Audio SBC.
            {
                TravelSound = "",
                HitSound = "",
                ShieldHitSound = "",
                PlayerHitSound = "",
                VoxelHitSound = "",
                FloatingHitSound = "",
                HitPlayChance = 0.5f,
                HitPlayShield = true,

These are expecting Audio SBC SubtypeIDs, and are played relative to the projectile.


Clone this wiki locally