fuaZandroX modding reference

Actor property

fua_HitSides sides

fua_HitSides

Availability

ZandroX only. Does not exist in Zandronum, GZDoom or UZDoom.

Works in netgames. A class default, the same on the client and the server. Changing it at runtime is server-authoritative, like the rest of the attack hitbox — see A_SetHitSize.

Usage

Gives the actor's attack hitbox the outline of a regular polygon instead of a square.

Seen from above, an attack hitbox is a square, and that square never turns with the actor: its sides always face the map's axes. An attack coming in along an axis meets a flat side at the hitbox radius, but one coming in along a map diagonal meets a corner at about 1.41 times that radius. A large actor is therefore hit noticeably earlier on diagonals than straight on.

fua_HitSides trims those corners. The polygon keeps a flat side on each axis at exactly the hitbox radius, so it always fits inside the square and only the corners move in:

Sides Farthest reach (at a corner)
4 (default) 1.414 × the radius — the square
8 1.082 × — flat sides on the diagonals too
12 1.035 ×
16 1.020 ×
32 1.005 × — effectively round

The radius is HitRadius when it is set, and Radius otherwise. Height is unaffected.

Parameters

  • int sides

    How many sides the outline has, from 4 to 32 in steps of 4. Anything below 8 is the square, other values are rounded down to a multiple of 4, and anything above 32 is 32. Default is 4.

What it changes

Everything that decides whether an attack reaches the actor:

  • Hitscan and rails, including shots that come down onto its top or up into its bottom.
  • Projectiles. A projectile's own radius widens the polygon evenly, so a wide projectile does not catch early on the corners either.
  • Splash damage. The distance is measured to the polygon's sides, so a blast as far off on a diagonal as on an axis does the same damage. The blast's own reach stays square; for a round blast, give A_Explode its XF_CIRCULAR flag, which measures straight from centre to centre.
  • Autoaim, the HUD crosshair's target name, and the hitbox overlay, which draws the polygon.

It never changes movement: walls, doorways and other actors still meet the square Radius, so the actor walks exactly as before.

Examples

A boss that should be hit at the same distance from whichever direction players come at it. Its collision box stays small, so it still fits its arena's corridors:

ACTOR RoundBoss : BaronOfHell
{
    Radius 24          // physical — unchanged
    HitRadius 96       // shootable out to 96 units...
    HitHeight 96
    fua_HitSides 16    // ...from any direction, give or take 2%
}

Setting it on a base class covers every class that inherits from it.

Changing it at runtime

  • DECORATE: A_SetHitSize's third argument — A_SetHitSize(-1, -1, 8) makes an octagon and keeps the extent; 0 returns to the square.
  • ACS: APROP_FUA_HitSides (62) — see Actor size properties in ACS.

Implementation notes

The shape's maths, the list of engine paths it reaches and its tests are in features/hitshape.

See also