Gravity

From ZDoom Wiki
Jump to: navigation, search

The gravity in ZDoom works as normal in the Doom engine: it corresponds to a value which is added to a thing's vertical velocity linearly each tic. During the first tic of free fall, that value is added twice.

However, ZDoom offers multiple ways in which the gravity value is affected, instead of being a constant as in vanilla Doom. An actor's gravity factor is the product of the following factors:

  1. The level's overall gravity, as defined in MAPINFO with the gravity map property. Note that this value is set on a scale of 800.
  2. The sector's own gravity, as defined in UDMF with the gravity sector property and in Hexen format with the Static_Init special; possibly modified with Sector_SetGravity.
  3. The actor's own Gravity property in DECORATE, possibly modified through ACS with the APROP_Gravity property.

Internally, the default values are all 1.0, so a fall lasting one second (35 tics) gives an accumulated speed of 36 in the default conditions.

In addition, being underwater also affects gravity depending on the depth of immersion: a waterlevel of 1 divides it by 16; a waterlevel of 2 or 3 divides it by 8.

Although you are advised to use MAPINFO for it, level gravity can also be affected with FraggleScript with either gravity <int value> on a scale of 100 or with consolecmd gravity <float value> on a scale of 1.

See also