Skip to content

Treat triggers as SKIP, and treat aaa prefix as trigger in HL1 mode - #500

Draft
SirYodaJedi wants to merge 3 commits into
ericwa:mainfrom
SirYodaJedi:nodraw_triggers
Draft

SirYodaJedi wants to merge 3 commits into
ericwa:mainfrom
SirYodaJedi:nodraw_triggers

Conversation

@SirYodaJedi

@SirYodaJedi SirYodaJedi commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Reimplements trigger-related portions of #386 in slightly more backward-compatible ways.

  • Trigger textures now no longer emit faces, greatly reducing vertex count. This is important for vanilla BSP formats (BSP29, BSP30, BSP38).
  • trigger now acts as a prefix, allowing custom trigger textures named things such as trigger_hurt or trigger_tele.
  • aaa now acts as a prefix for triggers in HL1 mode. The default trigger texture in GoldSrc is aaatrigger (see halflife.wad), and some games have additional textures such as aaa_hurt or aaa_push (see opfor.wad).
Old Description ~~EWT applies TEX_SPECIAL for the `trigger` texture, unlike vanilla compilers. This saves lightmap usage (and speeds up compile times),~~ but it still counts towards vertex limits (particularly important for HL1, wherein vanilla BSP compatibility is expected, so BSP2 is a no-go). I've added a new QBSP arg, `-nodrawtriggers`, to treat triggers as if textured with SKIP. This definitely works in HL1 (it's default behavior in VHLT), and I don't see why it wouldn't work in Q1. I didn't make it default behavior because leaving the trigger model can be useful for map debugging in mods/engines that have a cvar to render triggers (but having the behavior inverted could make sense). I considered calling it `-skiptriggers`, to go with the usual nomenclature, but I was concerned that would sound like it was removing trigger entities. Feel free to rename it to something like `-triggers_as_skip` if you think that would be more suitable (current arg name is taken from VBSP).

The standard trigger texture in Half-Life is AAATRIGGER, however some games like Opposing Force and Condition Zero have addtional trigger textures for signifying different types of triggers, such as aaa_hurt for trigger_hurt and aaa_push for trigger_push. As such, I've treated aaa as a prefix for trigger textures, but only in HL1 mode (although if the ability to use multiple trigger textures for different trigger types is desired by Q1 mappers, this could be changed to be allowed with a QBSP arg).

@SirYodaJedi
SirYodaJedi marked this pull request as ready for review August 27, 2026 03:32
@L-P

L-P commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

I've been summoned to give my two cents on this as I have been the one complaining about this behaviour in the first place.

This PR does two unrelated things:

  1. trigger as skip
    I would skip faces by default so everyone can benefit from it instead of having to know the docs by heart to be able to save faces.
    Large triggers can generate thousands of vertices/faces quickly as faces are split proportionally to texture scale, for formats with little headroom (ie. BSP29) you absolutely want to skip them.
    If trigger faces need to be present for a debug feature in some engines, that's the less common use case and should be behind the flag, not the other way around.

  2. aaa* textures
    I don't think EWT should care about {V,Z,SD}HLT conventions, especially if it's behind a feature flag1, and I hope Goldsrc support completion #386 never gets merged in its current form. EWT should implement GoldSrc-specific features not HLT-specific stuff.
    There's no good reason to use the Half-Life names and prefixes, if you want to port .map files made for HLT, port the maps, don't alter the compiler behaviour.
    If I wanted to visually differentiate triggers when mapping I would make trigger_ a prefix, not aaa.

Footnotes

  1. More code and documentation to maintain, combinatorial explosion of behaviours to test, less popular codepaths breed bugs that get noticed later. ↩

@SirYodaJedi

SirYodaJedi commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor Author

This PR does two unrelated things

I combined them because they're kinda intertwined. Both separately check texture names for triggers at different stages (it probably could be optimized to check once).

Large triggers can generate thousands of vertices/faces quickly as faces are split proportionally to texture scale, for formats with little headroom (ie. BSP29) you absolutely want to skip them.

The tessellation doesn't occur if the texture is flagged as a trigger texture. EWT currently only considers the texture name trigger, used by Quake, to be a trigger texture, whereas Half-Life uses aaatrigger instead.

I will push a commit later today to invert the behavior, though (I suppose -keeptriggerfaces would work).

I don't think EWT should care about {V,Z,SD}HLT conventions, especially if it's behind a feature flag

aaa prefix isn't ZHLT family behavior. aaatrigger was used in HL1 and aaa_hurt etc were used in Op4, both prior to ZHLT development. EWT treats trigger as TEX_SPECIAL to not be lightmapped; this PR extends that to aaatrigger et al so that the textures already included in the game can be used.

If I wanted to visually differentiate triggers when mapping I would make trigger_ a prefix, not aaa.

I could use strstr(), although that would probably be slower and would not work with Op4's variants.

@L-P

L-P commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The tessellation doesn't occur if the texture is flagged as a trigger texture.

Isn't the tessellation of trigger textures the reason the PR exists in the first place? Increasing the scale is how I generated less faces initially, then I used texturedefs to alias trigger to skip.

2026-08-27_20-56 2026-08-27_21-05

aaa prefix isn't ZHLT family behavior.

I meant GoldSrc compiler behaviour which I conflate with *HLT because no one uses (or should be using) the original compilers anymore. I forgot aaatrigger also came in halflife.wad.

@SirYodaJedi

SirYodaJedi commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Isn't the tessellation of trigger textures the reason the PR exists in the first place? Increasing the scale is how I generated less faces initially, then I used texturedefs to alias trigger to skip.

Huh, could've sworn it applied TEX_SPECIAL; guess I misread the code or I'm conflating it with something else. I'll look into that.

@SirYodaJedi
SirYodaJedi marked this pull request as draft August 27, 2026 20:41
Also treat `trigger` as a prefix for trigger textures, like with `aaa` in HL1 mode.
@SirYodaJedi SirYodaJedi changed the title add -nodrawtriggers, and treat aaa prefix as trigger in HL1 mode Treat triggers as SKIP, and treat aaa prefix as trigger in HL1 mode Aug 27, 2026
@SirYodaJedi

Copy link
Copy Markdown
Contributor Author

Whoop, I seem to have broken something; a regression test failed. Converted back to draft.

If I wanted to visually differentiate triggers when mapping I would make trigger_ a prefix, not aaa.

Made trigger work as a prefix (or tried to, anyway).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants