projectile

🚧 This article is a stub. You can help expand it by submitting content in pull requests or issues in this wiki's source repo.

Projectiles are special moving objects shot from weapons and thrown as grenades.

Movement #

Projectile movement is simulated during each game tick (smallest unit of simulated time). According to the projectile's velocity and gravity scale, its next position is calculated by the engine and a "trace" line between the two points is tested for collisions.

The trace collision test takes advantage of objects' bounding radii and the collision BSP structures found in model_collision_geometry and scenario_structure_bsp. If any collision is detected, it is handled accordingly (e.g. applying effects or playing sounds).

If no collision is detected, the projectile is moved to its next position at the end of the trace line. The process continues, tick by tick, until the projectile collides or reaches its maximum range and is removed.

A sufficiently high velocity projectile is essentially hitscan if it can cross a playable space within a single tick, with the game being simulated at 30 ticks per second. Otherwise, ballistic leading will be required to hit a moving target.

Structure and fields #

This tag inherits fields from object which are not shown here. See the parent's page for more information. The following information is unique to the projectile tag.

Field Type Comments
projectile flags bitfield(32)
Flag Mask Comments
oriented along velocity 0x1
ai must use ballistic aiming 0x2
detonation max time if attached 0x4
has super combining explosion 0x8
combine initial velocity with parent velocity 0x10
random attached detonation time 0x20
minimum unattached detonation time 0x40
detonation timer starts enum
Option Value Comments
immediately 0x0
after first bounce 0x1
when at rest 0x2
impact noise enum
Option Value Comments
silent 0x0
medium 0x1
loud 0x2
shout 0x3
quiet 0x4
projectile a in enum
Option Value Comments
none 0x0
range remaining 0x1
time remaining 0x2
tracer 0x3
projectile b in enum
Option Value Comments
none 0x0
range remaining 0x1
time remaining 0x2
tracer 0x3
projectile c in enum
Option Value Comments
none 0x0
range remaining 0x1
time remaining 0x2
tracer 0x3
projectile d in enum
Option Value Comments
none 0x0
range remaining 0x1
time remaining 0x2
tracer 0x3
ai perception radius f32 (world units)
collision radius f32 (world units)
arming time f32 (seconds)
danger radius f32 (world units)
timer f32 (seconds) (min & max)
minimum velocity f32 (world units per second)
maximum range f32 (world units)
air gravity scale f32
air damage range f32 (world units) (min & max)
water gravity scale f32
water damage range f32 (world units) (min & max)
initial velocity f32 (world units per second)
final velocity f32 (world units per second)
guided angular velocity Angle: f32 (degrees per second)
detonation noise enum
Option Value Comments
silent 0x0
medium 0x1
loud 0x2
shout 0x3
quiet 0x4
pad(2)
pad(12)
projectile material response Block?
Field Type Comments
flags bitfield(16)
Flag Mask Comments
cannot be overpenetrated 0x1
default response enum
Option Value Comments
disappear 0x0
detonate 0x1
reflect 0x2
overpenetrate 0x3
attach 0x4
pad(16)
potential response enum
Option Value Comments
disappear 0x0
detonate 0x1
reflect 0x2
overpenetrate 0x3
attach 0x4
potential flags bitfield(16)
Flag Mask Comments
only against units 0x1
potential skip fraction Fraction: f32
  • Maximum: 1
potential between f32 (min & max)
potential and f32 (world units per second) (min & max)
pad(16)
scale effects by enum
Option Value Comments
damage 0x0
angle 0x1
pad(2)
angular noise Angle: f32
velocity noise f32 (world units per second)
pad(24)
initial friction f32
maximum distance f32
parallel friction f32
perpendicular friction f32

This information was partially generated using Invader tag definitions.

Acknowledgements

Thanks to the following individuals for their research or contributions to this topic:

  • gbMichelle (Movement)
  • Kavawuvi (Invader tag definitions)
  • MosesOfEgypt (Tag structure research)