fuaZandroX modding reference

Burrowing

A burrowing projectile goes into the wall, floor or ceiling it hits and comes out the far side, instead of exploding on it or bouncing off it. A drill through a wall, a mole round dug down through a ledge, a spike that pokes up through a 3D floor.

Availability

ZandroX only. Does not exist in Zandronum 3.2 or in any other port.

Projectiles only (+MISSILE, which Projectile sets). Works in netgames: the server decides every burrow, and clients see the server's missile go in and come out.

The short version

ACTOR Drill
{
    Radius 6
    Height 8
    Speed 20
    Damage 10
    Projectile
    +CANBURROW
    BurrowDistance 96
    States
    {
    Spawn:
        BAL1 A 1
        Loop
    Death:
        BAL1 CDE 4
        Stop
    }
}

Fired at a wall up to 96 units thick, this drill goes in, crosses it at its own speed and comes out the other side still flying. Against anything thicker it explodes at the face as it always did.

What it can burrow

Flag Lets it burrow
+CANBURROW all four below at once
+CANBURROWWALLS a wall: any line's face, a step's riser and a lintel included
+CANBURROWFLOORS down through a floor
+CANBURROWCEILINGS up through a ceiling
+CANBURROW3DFLOORS a solid 3D floor, through its side, top or bottom

+CANBURROW then -CANBURROW3DFLOORS gives everything but 3D floors. A burrow must be allowed both faces: the one it goes in by and the one it comes out of. A walls-only drill that would come up out of the top of a ledge stays out.

These are never burrowed, whatever the flags:

  • a line that blocks projectiles or everything (blockprojectiles, blockeverything), one-sided walls included, so a mapper protects a wall with a flag that already exists and ACS's Line_SetBlocking turns it on and off;
  • a horizon line or a polyobject's line;
  • a sky: a sky floor or ceiling, or the space above a sky ceiling a line leads into.

How it moves

  1. Sinking in. It meets the face and sinks in until its whole box is inside, over BurrowEnterTime tics (0: at its own speed). Its sprite really is half in the wall meanwhile, and the walls hide the part that is inside.
  2. Inside. It crosses the solid at its own flight speed. It touches nothing in there but what stands in a gap too narrow for it to come out into (see below).
  3. Coming out. It emerges over BurrowExitTime tics (0: at its own speed) and flies on.

So BurrowEnterTime 20 and BurrowExitTime 3 grind slowly in and punch quickly out. A wall thinner than the projectile itself is never wholly around it: the two halves meet in the middle.

The path is decided at the impact. It follows the line it was flying along, or with +BURROWGRAVITY the arc it would have flown had the solid not been there. Without that flag gravity stops inside the solid and it comes out with exactly the velocity it went in with, so a lobbed shot's arc carries on from where it left off.

Where it comes out is the first place past a face where its whole box fits again: a gap or corridor too narrow or too low for it is passed by, and the solid on both sides of it counts as one.

BurrowDistance (default 128) is the thickest solid it gets through, face to face along its path. With no way out in reach it never goes in and explodes at the face, unless it has +BURROWDEADENDS, which makes it dig in that far and die there. BurrowCount limits how many burrows it gets in its life.

Bouncers

A projectile with bounce flags too burrows where it can and bounces off the rest: a solid too thick, burrow-proof, or not among its CANBURROW surfaces. +BOUNCEBEFOREBURROW turns that round: it bounces off every surface its bounce flags cover, and burrows only a surface they leave out, or one where its last bounce of a BounceCount would explode it.

Hitting things

Any part of it out in the open strikes what that part touches, just as a flying projectile would: while it sinks in, while it comes out, and while it crosses a gap too narrow for it to come out into (a long projectile through a thin wall between two thick ones fills both gaps beside it). The hit lands, a +RIPPER rips on through, and anything else makes it explode at the point of its path nearest what it struck with some of it in the open: just short of the face it went in by, just outside the one it came out of, or level with what it struck on a low step, past a thin wall or in a gap, so the explosion is where the hit was and not swallowed by the wall. Wholly inside, its box touches nothing, and two burrowing projectiles pass each other, as wherever they meet one of them is inside the solid.

States and effects

The engine spawns no debris. The projectile's own states do, so a drill can throw rock chips and a plasma bolt metal sparks:

State Entered
Burrow, with Burrow.Wall, Burrow.Floor and Burrow.Ceiling when it starts to sink in
Burrow.Exit, with the same three when it starts to come out
Burrow.DeadEnd when it dies inside (else Death)

Floor means the face is below the projectile (a floor, or a 3D floor's top) and Ceiling above it. Without a Burrow.Exit state, a projectile a Burrow state took returns to Spawn once it is out.

The states can read where it is:

Expression Meaning
BurrowPhase 0 not burrowing, 1 sinking in, 2 inside, 3 coming out
BurrowDepth how far its centre is past the face it went in by (coming out: short of the face it leaves), negative on the open side
BurrowSurface the face in use: 1 wall, 2 floor, 4 ceiling, 8 3D floor
BurrowExitX, BurrowExitY, BurrowExitZ where it will be when it is out
BurrowsDone how many burrows it has started

To pick debris by material, a state can ask ACS for the texture of the face: fua_BurrowTexture.

From ACS

Burrowing in ACS: fua_BurrowProbe asks whether there is a way through a wall before anything is fired, fua_BurrowTexture reads the faces' textures, fua_BurrowAbort ends a burrow, and SetActorProperty changes the four properties on one projectile.

Netplay

The server decides every burrow. Clients draw the server's missile going in and coming out, and only the server's copy strikes anything.

Known limits

  • With gl_spriteclip (r_spriteclip) at 2 or 3 the renderer lifts a projectile's sprite out of a floor it sinks into. At the default 1 it is drawn where it is.
  • A bouncer touching an actor while half in a wall explodes rather than bouncing off it.

See also