Problem statement
As I was making my bspguy edits through the entire Half-Life campaign, I hit a perplexing issue: The game freezes on "the" apprehension map (c2a3d). At first I just assume it's a one-off occurrence, but as I revisited the map it's becoming apparent that this is a 100% recurring issue.After adding
-condebug
to launch options and observing the qconsole output, it appears that the game is grinding to a halt with an error spam: Unhandled Ent in Path momentary_door
. So I searched that string in halflife's github, and it appears to be emitted from the AI node file dlls/nodes.cpp, line 283.So, the AI system is detecting that the node path is blocked by an entity that it can't handle. It should have handled
momentary_door
in the same block as func_door
but it doesn't. But then how come this map worked at all in vanilla half-life, but tanks when the same map is in a mod? Not just the map with a minor edit, even the unedited c2a3d tanks it, if it creates a new node graph.
Troubleshooting
My first attempt is to force the mod to use the original node file. I copied the .nod file from valve to <modname> and set it to read only. The problem is that in the mod's grapth folder there are also .nrp files, which is curiously absent from valve's graphs folder. Even when the game can't edit the nod file (it's read only on FS level) it's still creating the nrp file, and seems to be relying on it. It seems to me that the AI system that uses the nod/nrp map combo is causing this problem, as the original game has no nrp files and it works fine.Also, using the original bsp/nod pair works but that defeats the exercise of me wanting to edit the bsp.
Suspecting that maps saved by bspguy compels the engine to produce this problematic node formats, I resorted to ripent-ing the props I wanted to add (VHLT's). This failed, the problematic graph formats are generated, and the same freeze happens.
My final effort is to edit the momentary doors and make them slightly ajar (16u). That seems to work. I tried to follow up by having a pair of doors, a non-solid shut door, and a solid ajar one, which move in unison; but that failed again. I recalled the code doesn't check if the entity's solid.
I guess I had to have the doors ajar. For folks who has played this game a gazillion times it probably wouldn't matter (if they even noticed this change).
Afterword
The question still remain as to how the vanilla game (vanilla BSP and NOD combo) works when the new bsp/nod/nrp combo doesn't. Both vanilla and my mod is using vanilla code, so it's just something in the old nod file format that prevents this check from failing the way it does with modern formats.Hope to see solokiller's unified sdk fix this by including
momentary_door
and/or passable flag to the logic check. I might also raise this issue to valve's github later.