Reprisal Differences: Instinct, Highlights and Gaze¶
This page records Reprisal's Instinct mode, the object tracker that decides what Instinct highlights, the overrides file that corrects the tracker per mission, the renderer that draws the highlights and outlines, and the gaze-based choice of the object to interact with. None of these exists on the PC. Camera and aiming are on Controls, Camera and Aiming, pickup and gameplay rules on Gameplay Rules, the prompts and the pickup wheel's drawing on HUD, and the touch buttons on Touch Controls.
Addresses are Ghidra's (ELF virtual address + 0x100000), as on the rest of this section. Several of the functions involved were not split out by Ghidra's analysis (they have no file in the decompiled tree); for those the page gives the address of the instruction that was read in the disassembly.
Summary¶
| Feature | PC | Reprisal |
|---|---|---|
| Instinct mode | None | Hold (keyboard, gamepad) or toggle (touch) FeralInstinctMode; time capped at 0.7, the picture fades over 0.5 s through the camera's post filter, music ducked to 50 %, sounds low-passed |
| Where Instinct is refused | — | Option AllowInstinctMode off, cut sequences, 47's cameras other than third and first person (scope, keyhole, closet and others), in-game map, pickup wheel, the syringe used on an item |
| Object tracker | None | FeralInstinctTracker event attached to every geom with an action, every target, guard, VIP and police officer, security cameras, explosion controllers and bomb places |
| Range | — | 1000 units (10 m) from 47 to the object's origin, preference InstinctModeRange |
| Categories | — | Target (dark red), Guard (dark grey), Object (khaki), Climbable (khaki); highest-priority source wins |
| Per-mission corrections | — | assets/InstinctObjectOverrides.json: 226 entries in 12 missions, mostly climbable drainpipes and windows and linked elevator parts |
| Highlight rendering | None | Two new material passes, FeralObjectHighlight (fill) and FeralObjectOutline (outline, size 2.0), coloured by shader constant |
| Choosing the object to act on | ZHitman3::GetNearestActionObject: best facing × priority ÷ distance among near objects |
With EnableGazeInteractions (on): a ray from the camera picks the object, then its highest-priority action; fuzzy fallback within 100 units of the ray |
| Interaction highlight | None | White highlight (fill alpha 0.25, opaque outline) on the gazed action's object and the pickup wheel's choice, option "HIGHLIGHT INTERACTABLE OBJECTS" |
| Pickup list | Every pickup in range | With gaze: only the gazed object's pickups; on touch with EnablePickupWheelOnGaze the wheel offers all pickups in range |
| Pickup radius of ordinary items | 80 | 140 (PickupRadiusNormal); ammunition 60 and items carried by actors 140 are unchanged |
Instinct mode¶
PC behaviour¶
The PC has no Instinct mode, no FeralInstinctMode action and no greyed picture. The closest PC
features are the debug slow-motion actions (EnableSlowMotion/DisableSlowMotion) and the
scripted post filters.
Turning Instinct on and off¶
Instinct is a global flag (0x37393b9, read by 0x168cae0), not a member of the Hitman. It
changes only in three places: the setter 0x1681c68, an inlined copy of it in the Hitman's
frame update (the store at 0x1689c9c), and the two "force off" paths described below. Every
change does the same four things:
- Stops the current sound of the OSD sound definitions (
ZSDOwner, game data + 0x1468, the PC'sm_pSoundDef_OSDat 0xa34;0x1302940) and plays OSD sound 0x10 when Instinct turns on, 0x11 when it turns off (0x1302c04, Reprisal'sZSDOwner::PlaySoundwith a flags argument, see Audio). On the PC these indices areOSDSND_InScopeCameraandOSDSND_Hint_PipDisabled(src/hitman3/gui/osdsound.h); what Reprisal's definitions play there is in its encrypted data. - Writes the flag.
- Tells the Hitman's camera (
ZHM3Camera, Hitman + 0x1140) the new state and the current game time in seconds (0x1627524): this starts the picture's fade (see The grey picture). - Recomputes the time scale (
0x150f448, see Time).
The input side is in Reprisal's rewrite of ZHM3InputControl::UpdateBaseActions (0x16c51b8,
called from ZHM3InputControl::Update at 0x16c507c). It reads the player option
AllowInstinctMode (settings store, default on) and the action FeralInstinctMode, and writes a
one-frame request flag (input control + 0x28) with a latch (+0x29):
if not AllowInstinctMode:
if Instinct active: request = true # force it off
elif device is keyboard/mouse or gamepad: # input device type 0, 1 or 2
held = FeralInstinctMode down
request = active xor held
if latch == held: request = false
latch = held and not blocked # blocked = Hitman + 0x1164
elif device is touch: # type 3
request = FeralInstinctMode fired # the button fires on release
The Hitman's frame update then toggles: when the input control is active (input control + 0x1e,
inferred to be the PC's m_bActive) and the request is set, the new state is
not active and not blocked; if it differs from the current state the four steps above run. The
time scale is refreshed every frame whatever happens (0x150f448 with −1).
The result is hold to use with a keyboard or gamepad (the tutorial says "Activate Instinct Mode
by holding {FeralInstinctMode}") and tap to toggle on touch ("Activate Instinct Mode with
{instinct}"). The touch button (buttoninstinct, template instinct in
VirtualControlPad/Layouts/VCPLayoutDefault.xml) sends element ex1 with behaviour
onreleaseover. If Instinct is blocked while the key is held, it comes on when the block ends as
long as the key is still held (the latch is cleared while blocked). The keyboard binding is not in
the library; the string holdlalt exists, and the port binds Left Alt (from strings only).
Where Instinct is refused¶
| Condition | Effect | Evidence |
|---|---|---|
Option AllowInstinctMode off |
Instinct forced off; option change also handled by 0x16a75c0 (stores Hitman + 0x1158 and turns Instinct off) |
0x16c51b8, 0x1764da8 case 0x12, 0x1764850 case 0x12 |
| A block is held | Hitman + 0x1160 counts blocks; the first block sets Hitman + 0x1164 and turns Instinct off; the last unblock clears + 0x1164 | block 0x16a7780, unblock 0x16a7888 |
| Cut sequence camera | Blocks while it runs | ZCutSequenceCamera (0x1408910 calls block at 0x1408c04, unblock at 0x1408e84) |
| 47's camera in a mode other than third person, first person or mode 10 (the PC's modes end at 9): the sniper scope, keyhole, closet, bullet, positional, dialog and binocular cameras | Blocks while that camera is active | ZHM3Camera's activate and deactivate functions (0x1624b98 blocks and 0x162594c unblocks unless the mode at camera + 0x130 is 1, 2 or 10) |
| Pickup wheel opened | Instinct turned off; its state is saved in ZGui + 0x178 and restored when the wheel closes, on touch only | ZGui::v88 (0x16ee2f4) |
| In-game map opened | Instinct turned off | 0x1701498 (call at 0x17014e4) |
The syringe used on an item (food or drink): the item form of ZHitmanActionSyringe's constructor, which sets m_bInjecting (Hitman + 0x1b60) |
Instinct turned off | 0x16b3d78 (vtable 0x3093d68, ZHitmanActionSyringe) |
Both block functions also update the touch layout: virtual control 26 (the Instinct button) is
shown only when the option is on and no block is held (0x14ee864(vcp, 0x1a, allowed and
count == 0)).
Time¶
0x150f448(scale, engine) replaces the PC's direct writes of the engine time scale
(engine + 0xc18). It keeps the last requested scale in a global (0x329fc18), written only when
the argument is not −1 and the engine's lock byte (+0xc1c) is clear, and stores:
scale = requested
if Hitman exists and Instinct active and not blocked:
scale = min(requested, InstinctModeTimeMultiplier) # default 0.7
So Instinct caps time at 70 % at once (there is no ramp), and slower scales requested by other code (aim slowdown, scripted slow motion) still apply. The preference is read once and cached.
The grey picture¶
Reprisal does not draw the grey in code: it drives a post filter that the scene data provides.
When the Hitman's camera is set up it looks up a child event named PostFilterSet of the camera
geom and keeps it (camera + 0x1b8, store at 0x1624464), then sets one of its fields to 1
(0x1411924, inferred to be the priority). Every camera update (0x162535c) then does:
t = now - start # seconds since the last change (start = camera + 0x1c4)
if 0 < t < 0.5:
blend = 2 t if Instinct on else 1 - 2 t
clamp blend to [0, 1]
postFilterSet.SetfPriorityBlend(blend) # 0x1411990
elif camera + 0x1c8 is set: # one final write, then cleared
postFilterSet.SetfPriorityBlend(1 if Instinct on else 0)
0x1411990 is Reprisal's ZPostFilterSetEvent::SetfPriorityBlend (src/engine/eventsbase/postfilter.cpp):
it stores the value and sends UpdatePostFilter to the post filter geom. The fade is therefore
linear over 0.5 s in both directions. What the filter does (desaturation, darkening, tint) is
defined by the PostFilterSet data in the encrypted scene files and could not be read.
Audio¶
All instinct audio changes are Feral additions:
| What | How | Default | Evidence |
|---|---|---|---|
| Instinct on/off sounds | OSD sounds 0x10 (on) and 0x11 (off); their level byte (sound + 0x174) is InstinctModeSFXVolumePercent × 100, clamped to 0–100 (inferred to be volume in percent) |
1.0 → 100 | 0x1302c04 |
| Music | ZMusicController: saves the current volume (+0x350 → +0x2e8), sets the target to current × InstinctModeMusicVolumePercent and fades at |Δ|/0.05 per second (0.05 s); on exit the saved volume returns with the same fade |
0.5 | duck 0x17e4eec, restore 0x17e4fc8, called each frame from ZHM3LevelControl::v31 (0x17adf68) |
| Level music emitters, M01 | Sound objects CelloMusic, Mulher_Dulce_YardMusic, Waterfall, WaterfallRumble, Waterfall_Extra: volume × InstinctModeGenericVolumePercent (clamped 0–1), restored on exit |
0.4 | hook 0x17b99fc, set by ZHM3LevelControlM01::v40 (0x17b87f4); scaler 0x14794e8 |
| Level music emitters, M00 | Every sound object named HipHop: volume × InstinctModeHipHopVolumePercent |
0.2 | hook 0x17b5be4, set by ZHM3LevelControlM00::v40 (0x17b3b28) |
| Low-pass | In the synth's per-sound update, while Instinct is on, each sound's filter value (0–127, 127 = unfiltered) becomes min(127, int(InstinctModeLowpassPercent × 127)) = 85; sounds with their own filter (flag bit 5 of +0xc6) take the smaller of the two |
0.67 | getter called at 0x130bbd0; filter flag set in 0x130b674 |
The music hooks are called by the music controller with 1 when ducking starts and 0 when it ends (controller + 0x1db0). Only M00 and M01 install one. The emitter scaler saves the emitter's own volume (+0x17c) the first time and scales that, so repeated calls do not compound.
Port¶
port/builtin_mods/instinct/scripts/main.lua reimplements Instinct; its switch and fade are
instinct_state.lua, tested by tools/port/tests/instinct_state_test.lua. The mod's switch is
AllowInstinctMode. Matches:
- hold to use on keyboard and gamepad with Reprisal's latch (a key still held after a block turns Instinct back on; after the map or the pickup menu it must be pressed again), a tap to toggle on touch;
- refused while a cut sequence camera runs (
m_lInCutSequence) or 47's camera is in a mode other than third or first person, turned off as the map, the pickup menu or the syringe on an item begins, and on touch restored when the pickup menu closes; no change while 47's input control is inactive or the game is paused; - the 0.7 time cap at once;
- the picture's blend linear over 0.5 s of game time from the change, both ways, restarting on a
reversal, as the camera drives
PostFilterSet; - OSD sounds 16 and 17 after the current OSD sound stops (
obm.instinct.sound); - the music controller's music, emitters and 3D music × 0.5 over 0.05 s, the highs at 0.67, and on
top M01's five named sound objects × 0.4 (the first of each name) and every M00 sound object named
HipHop× 0.2 (obm.instinct.duck_emitters), at once, restored on exit; - range 1000 and the colours.
Differences: the grey itself is the port's (the post filter's saturation taken to 0 by the blend),
since the PostFilterSet data is encrypted; it has no vignette. On the PC's data, OSD sounds 16
and 17 are the in-scope camera and pip-disabled hint sounds, not Reprisal's Instinct sounds. The
touch button's lit state is the touch layer's own toggle, which stays lit after the map turns
Instinct off (one tap turns it on again, as in Reprisal).
The Instinct tracker¶
Classes¶
FeralInstinctTracker is a new Glacier event class (ZGEOM_FeralInstinctTracker, registered by
_INIT_349 at 0x15a1b68, size 0xb0, vtable 0x30776d0). Like ZAction, it is a child event of
the geom it highlights; code finds it with the geom's "find event" virtual (vtable offset 0x208)
and creates it with "add event" (0x218). The PC has no such class.
| Offset | Field |
|---|---|
| +0x38 | owner geom |
| +0x50 | no sources left (pending removal) |
| +0x51 | highlight currently shown |
| +0x52 | category fixed by an override |
| +0x58 | category (0 Target, 1 Guard, 2 Object, 3 Climbable) |
| +0x5c | ForceHide |
| +0x60 | sub-object indices (vector<int>) |
| +0x78 | linked geoms (vector<geom*>) |
| +0x90 | highlight object (see Highlight rendering) |
| +0x98 | sources: vector<{int reason; REF source}> |
FeralInstinctDebugUI is an internal Dear ImGui tool for editing trackers and writing the
overrides file (see Debug UI).
Categories and colours¶
| Category | Priority | Fill (ARGB) | Outline (ARGB) | Fill as RGBA 0–1 |
|---|---|---|---|---|
| Target (0) | 3 | 0xd92d1210 |
0xff8c1e1c |
0.176, 0.071, 0.063, 0.851 |
| Guard (1) | 2 | 0xd9222222 |
0xffcfcfcf |
0.133, 0.133, 0.133, 0.851 |
| Object (2) | 1 | 0xd9858062 |
0xffc6c3ad |
0.522, 0.502, 0.384, 0.851 |
| Climbable (3) | 0 | 0xd9858062 |
0xffc6c3ad |
as Object |
The table is static data at 0x32a38b8 (stride 0x20: priority, fill, outline, name). At start-up
0x15a00d4 (called from 0x14f170c) looks for the settings InstinctCategoryFillColour_<Name>
and InstinctCategoryOutlineColour_<Name> (names Target, Guard, Object, Climbable); a
setting that exists is read as a string, converted to a number and replaces the colour. No defaults
are registered for these keys. The colour words are ARGB: the renderer unpacks them as
R = bits 16–23, G = 8–15, B = 0–7, A = 24–31, each ÷ 255 (0x137ca18).
Sources¶
Each tracker keeps a list of sources: who asked for it, and why. A reason maps to a category
through the table at 0x9e3890:
| Reason | Added by | Category |
|---|---|---|
| 0 | A ZAction on the geom (0x15a04b0, from ZAction slot 20 at 0x13f1888, and again from ZAction::Command when an action is shown, 0x13f19b4) |
Object |
| 1 | An override from the JSON file (0x12b6d74) |
Object, but never used to choose the category |
| 2 | Character type Target, OptionalTarget or VIP (0x164bbf0) |
Target |
| 3 | Character type Enemy or Policeman (0x164bbf0) |
Guard |
| 4 | CExplosionController initialisation (0x15cd2b8) |
Object |
| 5 | ZPlaceBomb initialisation, for the bomb's object and each geom in its list (0x15ebcf4, 0x15ebd3c) |
Object |
| 6 | ZSecurityCamera::v19 (0x15ed77c) |
Object |
Adding a source (0x15a0784) appends it, clears "no sources", and, when the reason is not 1 and
the category is not fixed by an override, raises the category if the new one has a higher
priority. Removing (0x15a0c58) erases the matching {reason, source}; removing reason 1 unfixes
the category; if no source is left the tracker marks itself for removal and unlinks its linked
actions; otherwise, unless fixed, the category becomes the highest-priority one among the
remaining sources (the first one on a tie) and the highlight is rebuilt if it changed.
No source ever maps to Climbable: climbable objects exist only through the overrides file.
Which actions add an object¶
0x15a04b0(action, geom) decides whether a ZAction's geom is tracked:
item_ok = false
if geom is a ZHM3Item:
template = geom.template; holder = geom.holder # vtable 0x518, 0x530 (inferred)
item_ok = (template[0xde] or template[0xdd])
and (holder is none or holder is a ZHM3ItemContainer)
and item type not in {245 CardFan, 246 card, 291 WineBarrel01}
action_ok = true
if action.type == AT_PICKUP and geom is a ZItem:
action_ok = template's virtual 0x528 is non-zero (not identified)
if geom is a ZItem of type 257 (ScopeVideoCamera) and action.type != AT_STEALTAPE (41):
action_ok = false
if geom is the Hitman: action_ok = false
if item_ok or action_ok:
find or create the geom's tracker; add source (0, action)
In practice every door, switch, panel, place-item point and item lying in the world that carries
an action is tracked as an Object. Interest points remove their action's source when they are
deactivated (0x15e3fd8), and the VCR's tape command removes it too (0x15f201c). Items rebuild
their highlight when picked up or put in a container (0x166fc58, 0x166fca0).
Characters¶
Reprisal adds a setter for the PC's m_eCharacterType (eCharacterType in
src/hitman3/interfaces/charactertype.h), 0x164bbf0(actor, type). It is called when an actor
loads (0x164b62c), from the script interface (0x179d788, 0x179d824), from M04's rehab
targets (0x17bfec8, 0x17bffd0), and from a ZHM3Actor routine that re-applies the current
type (0x1653278; inferred to run when the actor's state changes). With the actor's state
(ZActor::ACTORSTATE, + 0x732: 0 dead, 1 awake, 2 unconscious) it does:
alive = state != DEAD
if alive:
if type in {Target, OptionalTarget} and old not in {Target, OptionalTarget}: add (2, actor)
if type in {Enemy, Policeman} and old not in {Enemy, Policeman}: add (3, actor)
if type == VIP and old != VIP: add (2, actor)
if old in {Target, OptionalTarget} and (type not in that set or not alive): remove (2, actor)
if old in {Enemy, Policeman} and (type not in that set or not alive): remove (3, actor)
Civilians and animals are never tracked. A VIP's source is never removed (the removal cases do not include VIP), so a VIP who dies keeps its Target highlight; this looks like an oversight.
Each frame¶
The tracker's frame update (FeralInstinctTracker::v31, 0x15a0958):
if no sources:
hide; remove the event # vtable 0x120
elif ForceHide: nothing
elif Instinct off:
if shown: hide
else:
visible = true
if owner is a ZHM3ItemWeapon:
visible = owner.holder is none or a ZHM3ItemContainer
elif owner is a ZHM3ItemContainer and not carried and not (virtual 0x5b8):
visible = owner.holder != Hitman
d = distance(owner world position, Hitman world position)
show = visible and d < InstinctModeRange
if show and not shown: build the highlight if needed; enable it (priority 1)
if not show and shown: disable it
The range is an integer preference: the default is the static value 1000 (0x32a38b4), replaced
by InstinctModeRange when that is set and greater than 0. It is read on the tracker's
initialisation (v18, 0x15a0918) and again when settings change (0x15a08f4, from
0x178485c). The test is a strict 3D distance between origins, so a large object is tracked by
its pivot, not its nearest point. There is no line-of-sight, room or facing test in the
tracker; what is hidden behind walls depends on the renderer (see below). A weapon in someone's
hands and a briefcase 47 carries are not highlighted.
Building the highlight¶
0x15a1320 builds the tracker's highlight object with its category's fill and outline: the first
entry is the owner with the tracker's sub-object list; if that list is empty and the owner is a
ZGROUP, each direct child is added as a whole entry too. A sub-object list restricts the
highlight to those mesh sub-objects (the debug UI calls them "Object %d" of the geom's prim).
Port¶
obm.instinct.objects (port/engine/mods/_sdl/modluainstinct.cpp) builds the trackers every
frame while Instinct is on: every geom with a ZAction in the action controller (not 47, and a
ScopeVideoCamera only for its tape action), the geoms of security cameras, explosion controllers
and bomb places and each geom in a bomb place's list, then the port's objects file
(port/builtin_mods/instinct/objects.json), resolved once per scene.
The objects file holds the information of Reprisal's overrides file in the port's own format,
pointed at the PC version's scenes. Its entries are grouped by the PC scene's file name
(M05_Main), and each names its geom by its path in the PC scene graph: a list of node names
from the root's child down, as the PC scenes name them, with #n for the n-th of nodes sharing a
name. The fields are category (object or climbable), hide (Reprisal's ForceHide),
auto_tracker (IsAuto), subobjects and links (LinkedGeom, kept only for geoms with an
Action event). The file was made by resolving every entry of Reprisal's file in the PC-data
scenes of M00 to M12 and writing the geom each one found. The scenes store some nested objects
as one geom whose name joins the levels with ! (Controllers!Actions!GarageDoorActivate, the
hidden action of A New Life's garage door), which Reprisal's paths write as separate levels; the
objects file names the PC scene's own node, so it needs no such matching. Five entries of
Reprisal's file name items at the scene's root (ROOT\<name>: a crate in M01, a nail gun and a
crate in M03, two frying pans in M11). At the start of a mission the PC scenes have them under
the characters' and items' groups (Items!Heaven!Chef!Pan), so the objects file names them
there; M01's crate name matches two crates (a drug lab crate mover's and a loading yard
worker's), and both are listed. All five are hide entries. With OPENBLOOD_TRACE_INSTINCT=1
each scene logs its entries, links and static sources, and any path that does not resolve: all
227 entries resolve in M00 to M12 from a PC installation.
An entry changes the tracker Reprisal's 0x12b6d74 picks: with IsAuto the geom's first
tracker, otherwise its first tracker with the same sub-objects, so a manual entry without
sub-objects changes the tracker the geom's action made: eleven hidden props are hidden this way,
of which six resolve (crate-mover crates in M01 and M03, an M06 MP9 ammunition box, M12's albino
remote). Otherwise the entry is a tracker of its own. An entry with sub-objects highlights only
those meshes of its geom (see Highlight and outline rendering). A tracker shows when it is not ForceHide, passes the weapon
and container tests above, and its geom's origin is less than 1000 units from 47's. Trackers of one
geom with the same sub-objects show the highest-priority category. The Instinct mod adds the
characters: living targets, optional targets and VIPs as Target, living guards and police as
Guard, whatever their species; a VIP seen alive keeps its highlight after death. Nothing is
climbable except the objects file's entries.
As in Reprisal, a tracker on an action helper with no model of its own draws nothing: hidden
action geoms (PlaceBombAction, ActionArrow01, ElevatorButton_*, exit areas), and the
cigarette pools' template items. The objects file adds trackers on the visible models of most
of them. OPENBLOOD_TRACE_INSTINCT=1 logs each scene's count of overrides and links, every entry
that does not resolve (with the scene paths of geoms of that name), once per scene every Instinct
or gaze highlight whose geom has no mesh (highlight draws no mesh), and each change of the gazed
object and its highlight geom.
Differences: the item template flags (+0xdd, +0xde) and virtual 0x528 are not identified, so any item with an action is tracked; actions on characters are not tracked; interest points and the VCR do not remove their sources, which matters only while their actions stay registered. The highlight renderer takes 128 highlights a frame; objects nearest 47 come first.
The overrides file¶
Loading¶
assets/InstinctObjectOverrides.json (file name set by _INIT_64, 0x12bb390) is read and
applied by 0x12b70bc (no direct caller; inferred to run on level load):
- Parse the file as a JSON array; each element becomes an entry; entries are grouped by
GeomId. - Resolve each
GeomId(0x12b7820): it must start with the current scene's file name (case-insensitive); the rest, which begins withROOT\, is passed to the scene root's path lookup (virtual 0x408). Entries of other scenes, or whose geom is missing, are kept aside unchanged so that the debug UI writes them back when it saves. - For each entry of a found geom, find or create its tracker (
0x12b6d74):IsAuto: truetakes the geom's firstFeralInstinctTracker, the one actions and characters created;IsAuto: falsetakes the tracker whose sub-object list equals the entry'sSubobjects, so one geom can carry several manual trackers;- if none matches, a new tracker is created with source reason 1.
- Resolve each
LinkedGeompath the same way. - Apply (
0x15a100c): unlink the old linked actions, set category, ForceHide, sub-objects and linked geoms, fix the category (+0x52), rebuild the highlight and re-enable it if shown, then link the new actions.
Fields¶
| Field | Type | Meaning |
|---|---|---|
GeomId |
string | Path of the geom: scene file name, then ROOT\, then the geom names from the root separated by \. Names of included scenes contain / (M00/M00_Characters.zip). Duplicate names carry #nn suffixes as in the scene (Clothbundle_01_00#01). |
Category |
string | Target, Guard, Object or Climbable (0x159ffb4); fixes the tracker's category |
ForceHide |
bool | Never show this tracker; used to suppress automatic highlights of props |
IsAuto |
bool | Modify the automatically created tracker instead of a manual one |
Subobjects |
int array | Mesh sub-objects of the geom to highlight; empty = the whole geom (and, for a group, its children) |
LinkedGeom |
string array | Geoms whose Action event should use this geom as its interaction target (see Linked geoms) |
A written file uses exactly these six keys (writer 0x12b7a38; the scene prefix comes from
0x12b8670).
Linked geoms¶
For each linked geom that has an event named Action, the tracker registers
{owner REF, sub-objects} in a new list on that action (action + 0x1c0, reference-counted;
0x15a1550, removal 0x15a1704). The gaze picker uses this list: when the player looks for an
action on the linked geom, the ray is tested against the listed geoms instead, and the white
interaction highlight is drawn on them. This is how invisible helpers (a PlaceBombAction, an
ElevatorButton_* trigger, an ActionArrow) light up the visible model (the winch, the panel,
the elevator housing).
Contents per mission¶
226 entries; no Target or Guard entries, and none for M07 or M13.
| Mission | Entries | Object | Climbable | ForceHide | IsAuto | With LinkedGeom | With Subobjects |
|---|---|---|---|---|---|---|---|
| M00 | 8 | 3 | 5 | 1 | 1 | 2 | 1 |
| M01 | 17 | 11 | 6 | 2 | 0 | 5 | 2 |
| M02 | 19 | 16 | 3 | 0 | 0 | 15 | 4 |
| M03 | 34 | 12 | 22 | 7 | 2 | 3 | 1 |
| M04 | 16 | 3 | 13 | 0 | 0 | 2 | 3 |
| M05 | 6 | 3 | 3 | 0 | 0 | 3 | 3 |
| M06 | 20 | 7 | 13 | 5 | 5 | 2 | 9 |
| M08 | 10 | 3 | 7 | 0 | 3 | 3 | 2 |
| M09 | 30 | 9 | 21 | 0 | 0 | 9 | 7 |
| M10 | 28 | 10 | 18 | 0 | 0 | 10 | 22 |
| M11 | 21 | 15 | 6 | 2 | 1 | 12 | 5 |
| M12 | 17 | 5 | 12 | 2 | 2 | 3 | 7 |
| All | 226 | 97 | 129 | 19 | 14 | 69 | 66 |
By combination: Climbable, manual, shown 129; Object, manual, shown 72; Object, manual, hidden 11; Object, automatic, hidden 8; Object, automatic, shown 6.
Notable entries:
- Climbables are drainpipes (
So00A_DrainPipe_01,So06N_ClimbDrainPipeA_Main_01with sub-object 1 and the matching_Top_01with 1–3), climbable walls and windows (Wall_Unique_01,So12A_wallD_win_01sub-objects 2–4), grids and stage lifts. - Elevators: panels and housings linked to their button actions in M01, M02, M11
(
ElevatorPanel_00→ElevatorButton_1st_00,ElevatorHouse\Elevator→hatchsub-objects 8 and 11), and the M00 fake elevator (Si00A_Elevator_House_01→Hatch, sub-object 3). - Bomb and accident setups: M00 winch →
LightRigSetup\PlaceBombAction, M03 chandelier winch →ChandelierSetup\ActionArrow01/02, M06 crane →Pianodrop\PlaceBombAction, M01 rope machine →BombRig\ActionArrow01. - Characters' action boxes: M02
PhotographerMale_01\Ground→TalkBox_Action,PianoBartender\Ground→Speakerbox; M11OfficeGuardReceptionist\Ground→ActionBox. - Hidden props: crate-mover crates (M01, M03), M03's nail gun, M06's MP9 ammunition boxes (four automatic, one manual), M11's pans, M12's albino remote and a main-hall door, M00's kiosk door, an M03 cloth bundle and chandelier.
- Multi-action objects: M12's X-ray machine
Fc12F_Xray_01(sub-objects 1, 2, 4) linked to three place-suitcase/toolbox actions; M02'sLazerButtonlinked to both laser switch actions.
Highlight and outline rendering¶
Highlight objects¶
A highlight object (0x13c6044, 0x28 bytes) holds a fill and an outline colour (ARGB words), a
list of entries {geom REF, sub-object indices} (0x13c61b0 adds one) and a "registered" flag.
Enabling it with a priority (0x13c6420) inserts {priority, highlight} into a global
unordered_map<geom REF, vector> (0x3446f30, guarded static) for each of its geoms and sorts
each vector by priority (0x13c6560); disabling (0x13c638c) removes it (0x13c6764). Priorities
used:
| Priority | User |
|---|---|
| 1 | Instinct tracker |
| 2 | Gazed action's object, pickup wheel's selected item |
| 3 | Item highlight of 0x16f05c0 (see Interaction highlights) |
A geom can make a highlight of itself and all its children through a new virtual (slot 121,
vtable offset 0x3c8, 0x14616a8 on ZGROUP and most geoms); the gaze code uses it.
Which entry of the vector the renderer draws when several are registered could not be
determined: the code that reads the map was not found (the map is reached only through its
static accessor 0x13c64d4, which has two callers, both writers).
Passes¶
Reprisal's material technique parser (0x1384b58) knows three new pass names after the PC's
RefractionMask:
| Pass | Id |
|---|---|
FeralObjectHighlight |
0x12 |
FeralObjectOutline |
0x13 |
FeralShadow |
0x14 |
When a render entry is set up for a pass (0x13a2b84), Reprisal copies the highlight's colour
into the render state (+0xc6c): the fill for pass 0x12, the outline for pass 0x13. The shader
constant switch (0x137b970) then provides two new constants, named in the semantic table (entries {type, id, name} at
0x3039238 and 0x3039248):
| Semantic | Id | Value |
|---|---|---|
v4FeralHighlightPassColor |
70 | the render state colour, unpacked ARGB → float4 RGBA ÷ 255 |
fFeralHighlightOutlineSize |
71 | ObjectHighlightOutlineSize, default 2.0 (the only reader is this switch, 0x137bb34) |
The outline pass takes a separate draw path that builds its own vertex declaration (0x1355418
branches to 0x1355720 for pass 0x13), which suggests the outline is produced in the vertex
shader by pushing vertices outwards by fFeralHighlightOutlineSize (inferred). Whether the size
is in pixels or world units, the blend states, and whether the passes test depth (that is,
whether highlights show through walls) are set in the effect files, which are in the encrypted
data packs and could not be read. The fill colours' alpha of 0xd9 (0.85) and the gaze fill's
0x3f (0.25) suggest alpha blending over the lit object (inferred).
Highlight passes are added to the geom's own render entries, so a geom the PC's room and portal culling does not draw gets no highlight either (inferred from the render-entry path).
Port¶
port/engine/drawing/old/_sdl/highlightsdl.cpp draws highlights as a screen-space mask with an
outline of ObjectHighlightOutlineSize's 2.0 taken as pixels at 1080 lines, and a depth comparison
(only visible surfaces). A highlight covers the meshes of its geom and of every geom below it; one
with sub-objects (an overrides entry's Subobjects, for Instinct and for the gaze) covers only
those meshes of its own geom, sub-object n being the n-th prim of the geom's prim chain. With
the PC data that is the n-th mesh object of the PC header, as Reprisal's debug UI numbers them
("Object %d"), unless an earlier object was too large and was split into several prims (the
converter, pcprims.cpp); with the PS2 disc data the numbering is the PS2 prims' and may not match.
M11's basement lift buttons, for example, light only the button panel of the wall
Si11B_WallA_4m_HoleA_01 (sub-objects 4 and 5), not the wall. The unit, the blend and the depth
behaviour are in Reprisal's encrypted effect files, so these stay the port's choices. When a geom
has several highlights the first added that covers the mesh is drawn: targets, then guards, then
objects for Instinct.
Gaze interaction¶
PC behaviour¶
The PC chooses the action to offer in ZHitman3::GetNearestActionObject
(src/hitman3/characters/zhitman3.cpp). For every geom in the Hitman's near-items list that is
not in his hands and not hidden, it asks for the geom's actions and scores each that is not hidden,
out of range or disabled, and not AT_PICKUP or AT_CLOTHES:
The best score wins. Pickups go through the pickup list (ZHitman3::CanOperateObject, range
checks below). ZActionArbiter (src/engine/geomsextend/zactionarbiter.cpp) is the NPCs' attack
and crime-scene arbitration and plays no part in the player's choice.
Reprisal: choosing by gaze¶
0x16879b8 runs once per game tick (it compares the tick counter with Hitman + 0x1a9c):
- With
EnableGazeInteractionsoff it calls the PC'sGetNearestActionObject(vtable 0xce0) unchanged. - With it on (the default), it runs the gaze picker (
0x1687cd0→0x16a8bc8), stores the gazed geom (Hitman + 0x1168) and its highlight target (Hitman + 0x1170), asks the gazed geom for its actions and keeps those that are notAT_PICKUP/AT_CLOTHESand not hidden, out of range or disabled; among them it takes the highest priority (the first on a tie). Distance and facing are no longer used. If the chosen action isAT_STRANGELINELEVATOR(33), the highlight target becomes a fixed geom of the Hitman (Hitman + 0x2020, not identified) with no sub-objects. - The result is passed to the action control (
0x16aaff4) as the PC's result was.
The gaze picker 0x16a8bc8(hitman, nearItems):
- Targets. For each geom in the near-items list (the same
REFTABthe PC uses, vtable 0xaa0), add{geom, no sub-objects}. If the geom has anActionevent whose linked list is not empty and the geom is not namedSpeakerbox, the linked{geom, sub-objects}targets are used instead and remembered with their owner. (As compiled, the replacement clears every target collected so far, not just the owner's; low confidence, read from the decompiled code.) - Ray. From the camera (the camera object at offset 0x30f0 of the global at
0x34e8198) position along its forward axis, 100,000 units long. - Exact test (
0x16a7fb0): in list order, the first target the ray hits wins. A target with sub-objects is tested triangle by triangle against those sub-objects (two-sided); a target without is tested with the collision system's line test on the whole geom; a group without sub-objects is tested child by child. There is no test against walls or other geometry. - If nothing is hit, or the hit geom is named
Ground:- Escape rule (
0x16a89c8): a target that offersAllLevels/Actions/EscapeorAllLevels/Actions/ExitHideoutis chosen at once; - Fuzzy rule: for each target compute
d, the shortest distance from the ray segment to the target (to any triangle edge of its mesh in the geom's local space,0x16a874c; for geoms of one class, a bounding test with the collider size as radius). Dividedby 10 forSi10O_Elevator_Car_A_01when sub-object 17 is listed, forKnifeThrowing_TestRoomand forFood_Aphrodisiac_01. Keep targets withd < FuzzyGazeOuterColliderSize(default 100.0, read once into0x3743118) and take the smallestd.
- Escape rule (
- Result. If the chosen target is a linked target, the gazed geom is its owner (the geom with
the action); otherwise the target itself. Output: the geom's REF and the highlight target
{geom, sub-objects}.
Pickups¶
The pickup list builder (0x171113c, inside the pickup menu) starts from the gaze result:
- gaze on and something gazed: on keyboard and gamepad, or on touch with
EnablePickupWheelOnGazeoff, the list holds only the gazed geom's pickups; - otherwise (gaze off, nothing gazed, or touch with
EnablePickupWheelOnGazeon) it holds every pickup in the near-items list, as on the PC.
On touch with EnablePickupWheelOnGaze on, the pickup menu counts the gazed pickups separately
(+0xe19) and uses that count for the prompt and for whether tapping opens the wheel
(0x1711100, 0x16edff4, ZPickupMenu::v58 at 0x17183cc). While the wheel is open the touch
layout switches to VirtualControlPad/Layouts/VCPLayoutPickupMenu.xml: the left stick plus a
Confirm (a) and a Cancel (b) button on the right (0x14ed568).
When the action menu offers more than one action and any of them is not AT_BUTTON or
AT_SURRENDWEAPON, its prompt reads InGame.MultipleActions ("[UPDATED] MULTIPLE ACTIONS") with
{ActionMenuOpen}; otherwise InGame.SelectFloor with {ActionMenuFast} (ZActionMenu::v61,
0x17103dc). InGame.MultiplePickups ("[UPDATED] MULTIPLE PICKUPS") is not referenced by the
library (from strings only; presumably the menu data). See HUD for the prompts.
Pickup radii¶
Reprisal's ZHitman3::CanOperateObject (AT_PICKUP case, read at 0x16843e4 and 0x1684f48)
replaces the PC's constants with preferences:
Angles are between 47's facing (the camera's in first person) and the direction to the action,
in the horizontal plane (ZHitman3::IsItemActionInFront).
| Object | PC | Reprisal | In front within 120° | In front within 70° | Else |
|---|---|---|---|---|---|
ZItemAmmo |
60; 45 if not in front within 60° | PickupRadiusAmmo 60; × 0.75 = 45 if not in front within 60° |
— | — | — |
Item held by a ZHM3Actor |
140 | PickupRadiusFromActor 140 |
required | full radius | half radius |
| Any other item | 80 | PickupRadiusNormal 140 |
required | full radius | half radius |
So ordinary items can be picked up from 140 units (70 when not within 70° in front) instead of 80 (40). The 120° and 70° limits and the halving are the PC's. See Gameplay Rules for the other pickup changes.
Interaction highlights¶
ZGui's frame update (ZGui::v88, 0x16ee2f4) maintains three highlights, all white: fill
0x3fffffff (alpha 63/255 = 0.247), outline 0xffffffff (0x9fa130). UseGazeHighlight below
is the player option "HIGHLIGHT INTERACTABLE OBJECTS" (InGame.GazeHighlight, default on, kept
at Hitman + 0x115b; options case 0x15 in 0x1764850/0x1764da8).
| Highlight | Shown when | Geom | Priority | Evidence |
|---|---|---|---|---|
| Pickup wheel selection | The wheel is open; or gaze and UseGazeHighlight are on and the pickup menu has a selection |
the selected pickup's geom and children | 2 | 0x16f01ac |
| Gazed action | EnableGazeInteractions and UseGazeHighlight on, and the gazed geom is not one of 47's own (vtable 0x9b8, 0x9c0) |
the gaze picker's highlight target; with sub-objects through 0x16f0940, else the geom and its children |
2 | 0x16f032c |
| Nearby item | EnableGazeInteractions and UseGazeHighlight on |
the first ZHM3Item not named Item_Coin_* in the group returned by Hitman helper 0x168cc14 (not identified; also used by the throw prompts) |
3 | 0x16f05c0 |
Each is rebuilt only when its geom changes and is disabled when its condition fails. With
EnableGazeInteractions off, only the wheel's selection is highlighted, and only while the wheel
is open.
Port¶
The interaction mod's GAZE INTERACTIONS is EnableGazeInteractions (off by default, on in the
Reprisal HUD preset). PortGazeUpdateActionControl (modluainstinct.cpp), called from
ZGui::ClassFrameUpdate before the menus read the action control, runs the gaze picker and gives
ZHM3ActionControl::Update the gazed geom's highest-priority action, once a frame. The picker
follows Reprisal: the near-items list, with the objects file's linked geoms in place of a linked
action's geom (not Speakerbox); a 100,000-unit ray from the camera along its axis, both taken
from the main view as the last frame drew it (47's camera geom itself can sit elsewhere between
updates, pulled in by its collision, which made the gaze and its highlight flicker every other
frame);
the first target in list order the collision line test hits, child by child for a group; on no hit
or a Ground hit, an escape or hideout exit at once, else the target nearest the ray within 100
units (a tenth of the distance for the three named objects).
port/builtin_mods/interaction/scripts/main.lua draws Reprisal's white highlights (fill 0.247,
opaque outline): with HIGHLIGHT INTERACTABLE OBJECTS (UseGazeHighlight) and gaze, the gazed
highlight target unless it is 47's own, only its listed sub-objects for a linked target that has
some (as 0x16f0940 does); the pickup menu's choice while it is open, or with both options when
it is the gazed object's.
Differences: a target with sub-objects is tested as its whole geom; the fuzzy distance is measured
to the geom's bounding box, not its mesh's edges; a linked object replaces only its own entry in
the list; the fixed geom highlighted for AT_STRANGELINELEVATOR is not identified (the gazed
target is highlighted). The pickup list is not narrowed to the gazed object's pickups and
EnablePickupWheelOnGaze is not reproduced. The nearby-item highlight is not reproduced: its helper
(0x168cc14) is not identified. Without the gaze option the PC's choice stays.
Preferences and options¶
| Key | Kind | Default | Meaning |
|---|---|---|---|
AllowInstinctMode |
Player option | on | Instinct can be used; also shows the touch button |
UseGazeHighlight |
Player option | on | "HIGHLIGHT INTERACTABLE OBJECTS": the white interaction highlights |
InstinctModeRange |
Preference (int) | unset → 1000 | Tracking distance in units; used only when > 0 |
InstinctModeTimeMultiplier |
Preference | 0.7 | Time scale cap during Instinct |
InstinctModeLowpassPercent |
Preference | 0.67 | Sound filter level (× 127) during Instinct |
InstinctModeMusicVolumePercent |
Preference | 0.5 | Music volume factor |
InstinctModeGenericVolumePercent |
Preference | 0.4 | M01 music emitters' volume factor |
InstinctModeHipHopVolumePercent |
Preference | 0.2 | M00 HipHop emitters' volume factor |
InstinctModeSFXVolumePercent |
Preference | 1.0 | Level of the Instinct on/off sounds |
InstinctCategoryFillColour_<Name>, InstinctCategoryOutlineColour_<Name> |
Setting (string) | none | Colour overrides per category |
ObjectHighlightOutlineSize |
Preference | 2.0 | Outline size shader constant |
EnableGazeInteractions |
Preference | on | Camera-ray choice of the object to act on |
EnablePickupWheelOnGaze |
Preference | on | Touch only: the wheel offers all pickups in range |
FuzzyGazeOuterColliderSize |
Preference (float bits) | 100.0 | Fuzzy gaze radius around the ray |
PickupRadiusNormal, PickupRadiusAmmo, PickupRadiusFromActor |
Preference | 140, 60, 140 | Pickup ranges |
UI strings: InGame.InstinctMode ("INSTINCT MODE"), InGame.GazeHighlight,
InGame.GamepadLabel_FeralInstinctMode ("Instinct Mode"), VCP_Instinct,
InGame.GamepadLabel_PickupMenuOpen ("Pickup Wheel"), InGame.OpenPickupWheel ("SELECT PICKUP"),
InGame.MultipleActions, InGame.MultiplePickups, the tutorial Tutorial_12_Climb_* ("INSTINCT
MODE & CLIMBING") and Tutorial_H07_Climb ("Use Instinct Mode to find a way up").
Debug UI¶
FeralInstinctDebugUI (internal ImGui windows; no release path to it was found) offers:
| Window | Strings | Function |
|---|---|---|
| Instinct Mode Debug | Instinct Mode Debug |
entry (address not found) |
| Tracked Instinct Objects | Max Dist, Object, Distance |
0x12b1930 |
| Instinct Object Info | Short Path, Full Path, Type, Render Info, Prim id, Object %d. Material: %s |
0x12b16cc |
| Geom Tree | Jump to selection, Filter by distance (Warning: Very slow) |
0x12b1b78 |
| Actions Debug | Refresh List, Show Box for all, Exclude Pickups, Exclude Doors, Only Show Actions without a Prim, Num Linked Objects |
0x12b0a7c |
| Tracker editing | Add Instinct Tracker, Remove, Category, Subobjects Table, Should Track?, Linked Action Objects, Add Linked Object |
0x12b00f8, 0x12af104, 0x12af9cc, 0x12af2d8 |
| Saving | Save Instinct Object Overrides |
0x12b7a38 |
Not determined¶
- The look of the Instinct picture (the
PostFilterSetdata is encrypted). - The highlight shaders: depth test, blend states, the unit of the outline size, and therefore whether Instinct shows objects through walls.
- Which highlight the renderer draws when a geom has several (the map's reader was not found).
- The exact keyboard binding of
FeralInstinctMode. - The template flags at +0xdd/+0xde that make an item trackable, and the template virtual 0x528 checked for pickup actions.