Brush Entity Last edited 4 weeks ago2024-10-19 23:24:43 UTC

Brush entities are one of the two types of entity. A brush entity is comprised of one or more brushes, and thus are entities that either define an area or make up some part of the level geometry. This includes doors, elevators, trains, buttons and more, as well as areas that trigger some element of game logic, such as causing damage to the player or activating other entities when the player enters them.

Properties

Brush entities have a few properties of interest that are only defined geometrically (not through entity keyvalues): Some other properties applicable to brush entities in common (via various means): Compiler keyvalues with no effect on entity's function:
💡 If you want, you can edit your FGDs to expose the common properties above to all brush entities. One easy way is to extend the ZHLT BaseClass since most brush entities inherit it in most FGDs.
Advanced property: model
During compilation, the brushwork of entities are compiled into brush models (there can be 512 of these) and the raw brushwork data removed. In return, the entities get assigned a model keyvalue which points to the index into the BSP file's brush model list. Multiple entities sharing this value will share the same brush model and this can be set up with the zhlt_usemodel keyvalue. It can even point to an external BSP file e.g. models/healthbox.bsp or an actual model e.g. models/prop/door.mdl (Note: models use different kind of collision and thus absent if used like this. Also, the incompatible collision mode will crash the game when it checks for it.)

There doesn't seem to be a way to explicitly set model value in the editor short of redefining the FGDs, and such edits are usually done with post-compile tools like bspguy.

Types and interactivity

As previously mentioned way at the beginning of this page, brush entities can be cleanly divided into two types:
  1. Functional - entities that represents something e.g. doors, trains...
  2. Triggers - defining a volume that does things when you "touch" it.
These entities employ different types of interactivity (monospaced word being the name of the method used in code): A func_door uses the first three.

For entities that define an area of effect, only the bounding box of the entity is used, so it should only be of cuboid shape to truthfully represent in-game behaviour. In the same vein, a func_plat creates its own trigger area that uses its bounding box as base, and likewise might work weirdly if allowed its default behaviour while being non-rectangular in shape. Last and most notably, func_pushable uses its bounding box for collision with players and not the clipping generated from its brushwork.

Miscellaneous

1 Comment

Commented 6 months ago2024-04-18 14:33:31 UTC Comment #106136
My FGD's ZHLT BaseClass is like this:
fgd
@BaseClass = ZHLT
[
    zhlt_lightflags(choices) : "ZHLT Lightflags" : 0 =
    [
        0 : "Default"
        1 : "Embedded Fix"
        2 : "Opaque (blocks light)"
        3 : "Opaque + Embedded fix"
        6 : "Opaque + Concave Fix"
    ]
    light_origin(string) : "Light Origin Target"
    zhlt_hull1(target_destination) : "info_hullshape (standing)"
    zhlt_hull2(target_destination) : "info_hullshape (big monsters)"
    zhlt_hull3(target_destination) : "info_hullshape (crouching)"
    zhlt_usemodel(target_destination) : "ZHLT Template Model Target"
    zhlt_copylight(target_destination) : "ZHLT Copy Lighting From Target"
    zhlt_noclip(choices) : "ZHLT No-clipping" : "" =
    [
        "" : "Default clipping"
        1 : "No clip"
    ]
    zhlt_invisible(choices) : "ZHLT Invisibility" : "" =
    [
        "" : "Default (visible)"
        1 : "Invisible"
    ]
    zhlt_customshadow(string) : "ZHLT custom shadow (Alpha/RGB)" : : "Float value that specifies opacity of this brush entity. 0.0 (opaque) -> 1.0 (no shadow). Enter three values for RGB."
    zhlt_embedlightmap(choices) : "ZHLT embed lightmap" : "" =
    [
        "" : "No"
        1 : "Yes"
    ]
    zhlt_embedlightmapresolution(choices) : "ZHLT embed lightmap resolution" : "" =
    [
        "" : "[UNSET]"
        1  : "1 "
        2  : "2 "
        4  : "4 "
        8  : "8 "
        16 : "16"
        32 : "32"
        64 : "64"
    ]
    skin(choices) : "Contents" : "" =
    [
        ""  : "[UNSET]"
        -1  : "Empty"
        -2  : "Solid"
        -3  : "Water"
        -4  : "Slime"
        -5  : "Lava"
//        -6  : "Sky"
        -15 : "Translucent"
        -16 : "Ladder"
        -17 : "Fly field"
        -18 : "Gravity fly field"
        -19 : "Fog"
    ]
]

You must log in to post a comment. You can login or register a new account.