Description of the weaponry system in FI

The weapons interaction is divided into three areas:

  1. Launcher - the object that sits in the players' hands.
  2. Projectile - objects that come out of launchers and assist in delivering damage from launcher to a victim.
  3. Damage - object attached to a projectile that changes health, armor, and powerup/down

This division allows different projectiles to come out of launchers (i.e. alternate firing modes), and recycling of damage types for projectiles (e.g. freeze effect for an ice gun or a freeze mine).

Launcher

A launcher has these properties:

  1. base model: the model (geometry) to draw in the players' hands.
  2. attribute: extra attributes endowed on the player (e.g. no-knockback for megachaingun).
  3. abilities: extra commands endowed upon the player (e.g. "detpipes" command for pipebombs).
  4. view: extra vision capabilities endowed upon the player (e.g. viewing a player's health value for the medical dartgun).
  5. firing modes: description of each firing mode.

Launcher may have multiple firing modes. Firing modes have these properties:

  1. Spinup time: this is the amount of time the launcher must sit through after a button is pressed before it will fire (as would be the case for a megachaingun).
  2. Recoil time: the time spent after a projectile is fired that the launcher cannot be switched or re-fire.
  3. Reload time: the minimal amount of time that must be spent after the last firing before the launcher can fire again.
  4. Charge time: if the launcher is a charging weapon (e.g. Q2WF sniper rifle), the maximum time value that can be registered (i.e. charge value gets capped).
  5. Associated projectile: the projectile this launcher will fire for the firing mode.

The separation of recoil and reload time was a result of studying the WFA railgun. The WFA railgun has two firing mode, the regular railgun firing, and a secondary fire where the firing rate is doubled but damage is halved (twice as fast but half the damage). My rationalization on separating goes something like this:

The strength of a rail slug should depend on how much time the gun spent charging up its accelerator. On this reasoning, a full-strength rail slug should require a full 1500ms of recharge time before being able to fire, and a half-strength rail slug should require only 750ms of recharge time. However, in WFA, primary fire will always induce a 1500ms recoil time, and secondary fire will always induce a 750ms recoil time. This means that pressing secondary-fire then primary-fire will deliver a half-strength then a full-strength rail slugs within 750ms, i.e. the full-strength rail slug was delivered though the railgun only spent 750ms recharging. This is inconsistent with the above expectations on railgun accelerator recharging. The sequence of primary-fire then secondary-fire is also similarly inconsistent, where a half-strength rail slug will fire only after the accelerator sits idle for 1500ms.
With the separation of recoil (after-fire time) and reload (time since last firing), the primary and secondary firing of such a railgun can be made more consistent with the theory on the railgun accelerator. That is, the primary fire can be forced to wait at least 1500ms since the last firing, and secondary fire can fire again 750ms after the last firing, regardless of the previous firing mode.

Projectiles

Projectiles are divided into four main categories.

  1. Ballistic - like rockets and grenades, these are models that visibily fly through the air.
  2. Hitscan - like bullets and rail slugs, these are instant-hit projectiles. Hitscans are special-cased in the Q3 game due to their instant-hit property (e.g. not bothering spawning a "bullet" model since it can't last long enough to be seen).
  3. Beam - like lightning gun, these are similar to hitscans but have limited range and leave a very visible streak in the air.
  4. Contact - like gauntlet, these have very short range, can continually fire, and does not not do a "recoil" animation unless something has actually been hit (compare this to the hitscan railgun, which will recoil whether you actually hit something or not).

Properties of projectiles:

  1. Name: allows this to be referenced by name instead of offset value.
  2. Trajectory type: linear (rocket), ballistic (grenade), stationary (mines).
  3. Speed: muzzle speed of projectile. The special value -1 indicates a hitscan.
  4. Range: for hitscans, the maximum distance covered (in Q3 units -- the average player height is about 64). For non-hitscans, time (in ms) spent before exploding on its own.
  5. Cost: what ammo types and how much of each to reduce each time this projectile is fired from a player's launcher.
  6. Pellets: number of instances of an object, as for shotgun or cluster grenades.
  7. dirtype: relative direction to set as aiming direction. Values include the direction the launcher was facing (the usual), opposite the launcher's direction, straight up (cluster grenade), straight down, the surface normal (Claymore mine), towards an automatically-selected direction (as in turret grenade).
  8. Spread: amount of random offset from aiming direction. This is used by shotgun-type weapons and cluster grenades.
  9. Impact Damage: damage type delivered is a direct hit is scored.
  10. Splash Damage: damage type delivered for a splash hit.
  11. Base model: the model type to use for the projectile. For hitscans and beams, this field determines the trail image to use (e.g. bullet tracers, rail trail, lightning beam).
  12. Bounce: Amount of bounce off surfaces. Values in excess of 1.0 will cause projectiles to accelerate. Values between 0 and 1.0 will produce normally-expected bounce behavior. Value of 0 will cause detonation on impact with a surface. Values less than 0 will cause the projectil to stick to the surface.
  13. death_proj: projectile object to spawn when the current projectile is destroyed (as with a cluster grenade).
  14. health: allows for a projectile to be destroyable by other projectiles.
  15. transit: projectile object too spawn when the current projectile expires. This is for multi-staged grenades, such as turret grenades and gravitron grenades.
  16. spam: A spam object. (TODO: describe this more) Related to turret grenades firing only 4 times, gravitron grenade's pull, alarms.

Damages

Properties:

  1. Name - four-lettered name to allow referencing this damage by name.
  2. Damage radius - 0 for impact-only, non-zero for splash damage only.
  3. Damage value - amount of damage inflicted.
  4. Knockback - amount of knockback delivered. For example, the megachaingun may have an inordinately large knockback while retaining light damage.
  5. Effects - special effects delivered, such as ignoring armor protection, setting someone on fire, generating a sound (alarm), or a property value based on a function (charged weapon damage).
  6. Hit event - induces effects on client side (blood splash, rocket explosion, hit honks)
  7. Miss event - induces effects on client side (bullet ricochet, rocket explosion, rail trail into nowhere)

The damage name is 4 8-bit characters coerced into a 32-bit integer. This lets the name be used as the MoD (Means of Death) value directly. It also leads to generic obituaries on unmodded clients ("Joe was killed by Jane").

Spam

This object describes a very simple finite-state machine used for repetition of an activity. This object was originally used for creating a slow-moving rocket that dropped grenades every 0.1s, a very spammy weapon. Spam properties are checked periodically (i.e. polled).

Properties:

  1. dirtype: relative aiming direction - direction when fired from launcher, straight up, straight down, surface normal, automatically-selected direction (as with turret grenade).
  2. period: time (in ms) between spam polls.
  3. target: target type to aim at for automatic aiming direction.
  4. dist: search radius (in Q3 units).
  5. angle: maximum angle (in degrees) from search direction for obtaining targets.
  6. omega: the speed at which the projectile will rotate towards the target before firing (degrees per spam poll). Small values are fitting for homing rockets.
  7. delay: time spent before firing after acquiring a target (e.g. turret grenade).
  8. reload: time spent after firing before another spam poll.
  9. shots: maximum number of (sub)projectiles that can be (re)fired.
  10. projectile: the (sub)projectile to fire at the target.

--PhaethonH