OpenRA Projectile Types and Weapon Systems - guidebee/OpenRA GitHub Wiki

OpenRA Projectile Types and Weapon Systems

Projectile Types

1. Bullet

Description:
A standard projectile that travels from the attacker to the target along a straight or ballistic path.

Key Properties:

  • Speed: Determines how fast the projectile moves (e.g., 682, 853)
  • Image: Visual representation of the projectile (e.g., 120MM, 50CAL, BOMBLET)
  • Shadow: Whether the projectile casts a shadow (True/False)
  • TrailImage: Visual effect trailing behind (e.g., fb2, fb4, smokey)
  • LaunchAngle: Angle at which the projectile is fired (especially for artillery)
  • Inaccuracy: Random deviation from the target point
  • Blockable: Whether defenses can intercept the projectile
  • ContrailLength: Length of the contrail effect

Used By:

  • Cannons (^Cannon, 25mm, 90mm, 105mm, 120mm)
  • Artillery pieces (^Artillery, 155mm, 8Inch)
  • Flamethrowers (Flamer, FireballLauncher)
  • Explosive weapons (Napalm, Grenade, DepthCharge)

Example:

Projectile: Bullet
    Speed: 682
    Image: 120MM
    Shadow: True

2. Missile

Description:
A guided projectile with advanced movement characteristics, typically used for anti-air, anti-tank, or long-range weapons.

Key Properties:

  • Speed: Movement speed
  • Arm: Time/distance before the missile becomes active
  • HorizontalRateOfTurn: How quickly the missile can change direction
  • RangeLimit: Maximum distance the missile can travel
  • Inaccuracy: Random deviation from the target point
  • Image: Visual representation
  • TrailImage: Visual effect behind the missile
  • ContrailLength: Length of the contrail effect
  • CloseEnough: How close to the target is considered a hit
  • CruiseAltitude: Height at which the missile flies
  • BoundToTerrainType: Restricts missile to specific terrain (e.g., Water for torpedoes)

Used By:

  • Anti-ground missiles (^AntiGroundMissile, Dragon, Maverick)
  • Anti-air missiles (^AntiAirMissile, Nike, RedEye, HellfireAA)
  • Submarine weapons (TorpTube, ^SubMissileDefault)
  • Vehicle-mounted missiles (MammothTusk, Stinger)

Example:

Projectile: Missile
    Speed: 213
    Arm: 2
    Blockable: false
    ContrailLength: 10
    Inaccuracy: 128
    Image: DRAGON
    Shadow: True
    HorizontalRateOfTurn: 20
    RangeLimit: 6c0

3. InstantHit

Description:
An immediate-effect projectile with no travel time, typically used for high-velocity weapons or special abilities.

Key Properties:

  • Blockable: Whether it can be intercepted (rarely set for InstantHit)

Used By:

  • Anti-aircraft guns (^AACannon, ZSU-23, FLAK-23-AA)
  • Machine guns (^HeavyMG, ^LightMG, ChainGun, Vulcan)
  • Sniper rifles (^SnipeWeapon, SilencedPPK, Colt45)
  • Special weapons (BarrelCluster, DogJaw)

Example:

Projectile: InstantHit
    Blockable: true

4. TeslaZap

Description:
A specialized electrical attack projectile, visualized as an electrical discharge or beam.

Key Properties:

  • No specific properties defined in these examples - appears to be a specialized type

Used By:

  • Tesla-based weapons (^TeslaWeapon, TeslaZap, PortaTesla, TTankZap)

Example:

Projectile: TeslaZap

5. GravityBomb

Description:
A projectile that falls from above, affected by gravity, typically used for air-dropped weapons.

Key Properties:

  • Image: Visual representation
  • OpenSequence: Animation to play (e.g., parachute opening)
  • Velocity: Initial movement vector (x, y, z)
  • Acceleration: How the velocity changes over time
  • Shadow: Whether it casts a shadow

Used By:

  • Paratrooper bombs (ParaBomb)

Example:

Projectile: GravityBomb
    Image: PARABOMB
    OpenSequence: open
    Velocity: 0, 0, -50
    Acceleration: 0, 0, 0
    Shadow: False

Weapon Types and Categories

1. Ballistic Weapons

  • Cannons (^Cannon, 25mm, 90mm, 105mm, 120mm, TurretGun)

    • Medium-range, high-damage weapons
    • Use Bullet projectiles with medium to high speed
    • Effective against vehicles and structures
  • Artillery (^Artillery, 155mm, 8Inch, 2Inch)

    • Long-range, high-damage, area-effect weapons
    • Use Bullet projectiles with arcing trajectories (LaunchAngle: 62)
    • High inaccuracy but large damage radius
  • Small Arms (^HeavyMG, ^LightMG, ChainGun, Pistol, M1Carbine, M60mg)

    • Short to medium range weapons
    • Use InstantHit projectiles
    • Effective against infantry, light vehicles
  • Sniper Weapons (^SnipeWeapon, SilencedPPK, Colt45)

    • Medium-range, high-damage, precision weapons
    • Use InstantHit projectiles
    • Extremely effective against infantry

2. Missile Weapons

  • Anti-Ground Missiles (^AntiGroundMissile, Dragon, Maverick, APTusk)

    • Medium to long range
    • Effective against vehicles and structures
    • Use guided Missile projectiles with medium turn rate
  • Anti-Air Missiles (^AntiAirMissile, Nike, RedEye, HellfireAA, StingerAA)

    • Medium to long range
    • Specialized against aircraft
    • Use fast Missile projectiles with high turn rates
  • Naval Missiles (TorpTube, ^SubMissileDefault, SubMissile)

    • Long-range underwater weapons
    • Use specialized Missile or Bullet projectiles
    • Bound to water terrain

3. Special Weapons

  • Tesla Weapons (^TeslaWeapon, TeslaZap, PortaTesla, TTankZap)

    • Medium-range electrical weapons
    • Use TeslaZap projectiles
    • High damage against most targets
  • Fire Weapons (^FireWeapon, Flamer, FireballLauncher, Napalm)

    • Short to medium range
    • Use Bullet projectiles with special visual effects
    • Leave scorch marks and cause fire damage
  • Superweapons (Atomic, MiniNuke, CrateNuke)

    • Extremely high damage over large areas
    • Multiple damage phases with increasing radius
    • Visual and game effects (screen shake, flash)
  • Support Weapons (Heal, Repair, Demolish, MADTankThump)

    • Specialized utility weapons
    • Can heal units, repair structures, or create unique effects

4. Anti-Personnel Weapons

  • Dog Attacks (DogJaw)

    • Melee-range instant kill against infantry
    • Uses InstantHit projectile
  • Explosives (BarrelExplode, ATMine, APMine)

    • Area damage weapons
    • Often triggered by proximity or manual detonation

Key Mechanics

Damage System

  • SpreadDamage: Most common warhead type
    • Spread: Area of effect radius
    • Damage: Base damage amount
    • Versus: Damage multipliers against different armor types
    • Falloff: How damage decreases with distance from impact
    • ValidTargets/InvalidTargets: What can be damaged

Special Effects

  • CreateEffect: Visual and sound effects

    • Explosions: Visual effect to display
    • ImpactSounds: Sound to play on impact
  • LeaveSmudge: Terrain decoration

    • SmudgeType: Type of mark left (Crater, Scorch)
    • Size: Size of the smudge

Advanced Mechanics

  • FireCluster: Creates secondary explosions
  • DestroyResource: Removes resources from the map
  • CreateResource: Adds resources to the map
  • ShakeScreen: Visual effect that shakes the player's view
  • FlashEffect: Creates a flash effect (e.g., nuclear)

Let me research other projectile types available in the OpenRA codebase beyond Bullet and Missile projectiles. Let me search more specifically in the Projectiles namespace: Great! Now I can see several additional projectile types in the codebase. Let's examine them one by one, starting with LaserZap.cs: Let's continue examining the other projectile types: Let's also check a few of the more specialized projectiles: Based on my research of the OpenRA codebase, I can now provide you with a comprehensive overview of all the projectile types available in OpenRA, beyond the Bullet and Missile projectiles we discussed earlier.

Projectile Types in OpenRA

In addition to the Bullet and Missile projectiles you asked about previously, OpenRA implements several other specialized projectile types to create diverse weapon effects in the game:

1. InstantHit

Purpose: Creates an immediate hit with no visible projectile

Key Features:

  • Instant, invisible projectile that applies damage immediately
  • Primarily used for weapons that should have no travel time (like laser rifles)
  • Can have inaccuracy applied to simulate weapon spread
  • Blockable by units with appropriate blocking traits
  • The simplest projectile implementation in terms of visual effects

Usage Example: Infantry rifles, sniper weapons, or any weapon that should hit instantly

2. LaserZap

Purpose: Creates beam-like laser weapons

Key Features:

  • Creates a straight-line beam effect between source and target
  • Configurable width, color, and duration
  • Can optionally track moving targets
  • Supports secondary "glow" beams for visual effect
  • Can be blocked by obstacles
  • Damage can be applied over multiple ticks

Usage Example: Laser weapons like the Obelisk of Light in C&C

3. Railgun

Purpose: Creates electric/energy beams with helix effects

Key Features:

  • Combines a central beam with a spiral helix effect around it
  • Highly customizable visual parameters for both beam and helix
  • Can damage all units along its path
  • Helix can pulse, fade, and spin over time
  • More visually complex than LaserZap

Usage Example: Advanced energy weapons, railguns, Tesla weapons

4. AreaBeam

Purpose: Creates a beam that affects an area

Key Features:

  • Beam that travels in a straight line, affecting an area along its path
  • Configurable speed, width, and duration
  • Damage can fall off with distance from the beam
  • Can apply damage at intervals while active
  • Supports different beam shapes (cylindrical or flat)

Usage Example: Flamethrowers, lightning weapons, or any weapon that affects an area along a line

5. GravityBomb

Purpose: Creates a falling projectile affected by gravity

Key Features:

  • Projectile with customizable acceleration vector (typically gravity)
  • Visually shows a bomb or similar object falling
  • Can have a shadow effect
  • Supports animation sequences during falling
  • Velocity and acceleration can be controlled in 3D space

Usage Example: Bombs dropped from aircraft, mortars, or artillery shells

6. NukeLaunch

Purpose: Creates a nuclear missile launch and impact effect

Key Features:

  • Specialized projectile for dramatic nuclear weapons
  • Two-phase flight path: ascent and descent
  • Configurable detonation altitude
  • Trail effects while in flight
  • Special launch and impact sequences

Usage Example: Nuclear missile superweapons

7. TeslaZap (C&C-specific)

Purpose: Creates electricity-like effects

Key Features:

  • Instant-hit projectile with lightning visual effects
  • Configurable "bright" and "dim" parts of the electrical effect
  • Can track targets as they move
  • Damage applied during a configurable portion of its visual duration
  • Creates a jagged electrical discharge visual

Usage Example: Tesla coil weapons in Red Alert

8. IonCannon (C&C-specific)

Purpose: Simulates an orbital ion cannon strike

Key Features:

  • Special effect for the Ion Cannon superweapon
  • Animated beam effect from above
  • Configurable impact delay
  • No physical projectile movement, just the visual and impact effects

Usage Example: GDI Ion Cannon superweapon in C&C

9. DropPodImpact (C&C-specific)

Purpose: Simulates infantry drop pods impacting

Key Features:

  • Special effect for reinforcement drop pods
  • Animation sequence at impact point
  • Configurable impact delay

Usage Example: Special infantry delivery methods in Tiberian Sun

Comparison of Projectile Types

Projectile Type Travel Time Visibility Tracking Specialization
Bullet Yes Visible sprite No Basic projectile with optional arc
Missile Yes Visible sprite Yes Tracking with complex flight path
InstantHit No Invisible No Immediate damage application
LaserZap No Visible beam Optional Energy beam effects
Railgun No Visible beam + helix No Complex energy weapon visuals
AreaBeam Yes Visible beam Optional Area damage along a line
GravityBomb Yes Visible sprite No Falling projectiles with physics
NukeLaunch Yes Visible sprite No Nuclear weapon effects
TeslaZap No Visible electricity Optional Electric arc effects
IonCannon No Visible beam No Orbital strike effects
DropPodImpact No Visible effect No Drop pod landing effects

Implementation Details

All projectile types implement the IProjectile interface, which requires:

  • A Tick method to update the projectile state each game tick
  • A Render method to draw the projectile on screen

However, they have very different internal implementations depending on their behavior:

  1. Movement-based projectiles (Bullet, Missile, GravityBomb):

    • Track position, velocity, and sometimes acceleration
    • Follow physical movement paths
    • May have complex flight behavior
  2. Beam-based projectiles (LaserZap, Railgun, AreaBeam):

    • Connect source and target with a visible effect
    • Often use specialized renderable classes
    • May apply damage along their path
  3. Effect-based projectiles (InstantHit, TeslaZap, IonCannon, DropPodImpact):

    • Focus on visual and sound effects
    • Apply damage immediately or after a short delay
    • Often no physical movement simulation

Each projectile type can be configured through its corresponding IProjectileInfo implementation, which defines parameters like speed, appearance, damage behavior, and special effects.

This diverse set of projectile types allows OpenRA to recreate the wide range of weapon effects found in classic Command & Conquer games, from simple bullets to complex superweapons, each with their own distinct visual and gameplay characteristics.

⚠️ **GitHub.com Fallback** ⚠️