summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-03 23:07:40 +0100
committersalmonik <salmonik@tuta.io>2026-11-03 23:07:40 +0100
commit3249caf17de0dcab005398995ef3e611b3f81131 (patch)
tree159ed49a5010d330e52322572026e0bcd046717a /CONTEXT.md
parentAI: debug-log NPC relation changes (diff)
downloadhl2h-3249caf17de0dcab005398995ef3e611b3f81131.tar.gz
hl2h-3249caf17de0dcab005398995ef3e611b3f81131.zip
AI: fix relationship lookup; classify citizen/hacked turrets
m_Relationship is DEFINE_UTLVECTOR (FIELD_CUSTOM), not FIELD_EMBEDDED, so the datamap scan always returned -1 and every NPC fell back to the model heuristic. Resolve it as FIELD_CUSTOM with an embedded fallback. Floor turrets never add relationship rows when friendly: CNPC_FloorTurret overrides Classify() to CLASS_PLAYER_ALLY for citizen-built (SF_FLOOR_TURRET_CITIZEN) and Alyx-hacked turrets. Read m_spawnflags and m_bHackedByAlyx from the server instead. Widen the datamap offset window (0x4..0x4000) for derived-class fields and log the new offsets plus turret state in the NPC debug line.
Diffstat (limited to 'CONTEXT.md')
-rw-r--r--CONTEXT.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index c6b9c2c..fb97636 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -157,6 +157,13 @@ vocabulary / decisions.
157- This makes map-scripted friendly turrets and other relationship overrides 157- This makes map-scripted friendly turrets and other relationship overrides
158 dynamic instead of model-name guesses. When no row exists, the old model 158 dynamic instead of model-name guesses. When no row exists, the old model
159 heuristic is used. 159 heuristic is used.
160- `m_Relationship` is declared with `DEFINE_UTLVECTOR`, so its datamap entry
161 is `FIELD_CUSTOM` (not `FIELD_EMBEDDED`). Resolving it as embedded silently
162 returned `-1` for every NPC.
163- Floor turrets are special: citizen-built turrets (`SF_FLOOR_TURRET_CITIZEN`,
164 spawnflags `0x200`) and Alyx-hacked turrets (`m_bHackedByAlyx`) report
165 `CLASS_PLAYER_ALLY` from their overridden `Classify()` and never add a
166 relationship row. They are classified from those server fields instead.
160- Bugbait-controlled antlions are also treated as friendly when their server 167- Bugbait-controlled antlions are also treated as friendly when their server
161 `m_hFollowTarget` is set, covering antlions that spawned before the global 168 `m_hFollowTarget` is set, covering antlions that spawned before the global
162 `antlion_allied` state changed. 169 `antlion_allied` state changed.