Reprisal Differences: Touch Controls¶
The PC game has no touch controls. Reprisal draws Feral's Virtual Control Pad (VCP) over the game: a floating move stick, a camera trackpad (or a camera stick), and context-sensitive buttons, laid out by XML files and editable in game. The VCP does not call game code: it fills a virtual controller state (sticks, triggers and buttons), which the game's touch input device reads like a gamepad through its own binding file. The game in turn tells the VCP which scene, buttons and icons to show.
This page documents the data files, the runtime classes and their algorithms, how the game decides what is shown, the layout editor, and the port's reimplementation. Gamepad and keyboard controls are on Controls, Camera and Aiming; the minimap and HUD layout are on HUD. Addresses are Ghidra's (ELF virtual address + 0x100000). Where a claim is not read directly from code it is marked inferred or from strings only.
Summary¶
| Feature | PC | Reprisal |
|---|---|---|
| Touch input | none | Feral VCP: XML-defined sticks, trackpad, buttons, labels, deadzones; feeds a virtual controller |
| When shown | — | input mode 3 (touch): no gamepad or keyboard+mouse in use, or ForceTouchControls; EnableVCP on (default on) |
| Movement | keyboard / gamepad stick | floating stick: jumps to the finger anywhere in the left third, radius 70 (tablet) / 150 (phone) canvas units, 10 % inner deadzone per axis, linear response at default sensitivity |
| Camera | mouse / right stick | trackpad over the right two-thirds (default), or a fixed right stick ("Joystick-Style"); trackpad sensitivity and acceleration options |
| Context buttons | — | the game picks one of four scenes (default, scope, binoculars, closet) and shows, hides and re-skins buttons each refresh |
| Layouts | — | Default and "Higher" (Alternate), each right- or left-handed (tablet); Default and left-handed only on phones; unlimited custom layouts |
| Editor | — | drag, pinch, scale 50–200 % in 10 % steps, opacity in 5 % steps, nudge by 2 units, per-stick deadzones, sensitivity, inversion; add and delete controls |
| Haptics | — | per-control press, engage and boundary vibration envelopes, scaled by the Virtual Controller Vibration option and strength |
| Gestures | — | Feral gesture recognisers (tap, pan/swipe, pinch, rotate, press) feed a touch device with 8 buttons and 18 axes: a tap anywhere performs the available action or picks up the gazed item; a three-finger swipe ("FeralClaw") requests the in-game menu; pinch resizes in the editor and zooms the map and statistics screens |
Activation¶
PC behaviour. The PC reads keyboard, mouse and gamepad only (src/engine/system/ input
devices; PC Differences: GUI and Input).
Reprisal behaviour. The game's input system (ZSysInputWintel, 0x14e99c8, 0x14ea4b4)
chooses an input mode whenever devices change:
- If
ForceTouchControlsis on and a touchscreen device (type 0x21) exists: mode 3 (touch). - Otherwise, a gamepad present: mode 2; else keyboard and mouse both present: mode 1; else a touchscreen present: mode 3; else unchanged.
The mode selects the binding file (0x14ea79c): modes 0/1 feralkeyboardclassic.cfg or
feralkeyboardmodern.cfg (by KeyboardLayout), mode 2 feralgamepadclassic.cfg or
feralgamepadmodern.cfg (by GamepadLayout), mode 3 feraltouch.cfg. These files are inside the
encrypted packs, so the touch bindings cannot be read. The mode is pushed to the touch device
(FeralTouchWintel, constructor 0x14ecc98), which refreshes the VCP (below). The VCP is shown
only in mode 3, so connecting a gamepad hides it unless touch is forced.
| Preference | Default | Getter | Effect |
|---|---|---|---|
EnableVCP |
on | 0x14ecc98 (read into the touch device), setter 0x14ee7ac |
master switch; when off the pad is never shown |
ForceTouchControls |
off | 0x11ad924 |
forces mode 3; also calls Java FeralInputDeviceDetector.setTrackingEnable(false) so external devices are not tracked (0x2282e54, applied in 0x123b8b0 and on change in CAndroidFeralGame::v79 0x1240130) |
DisplayControlsPrompt |
on | 0x123b8b0 |
when a mouse, keyboard or controller is detected, shows the dialog GenericUI.PrioritiseTouch / GenericUI.PrioriseTouchControlsDialog with buttons GenericUI.EnableTouchControls and GenericUI.UseConnectedDevice; that the first sets ForceTouchControls is inferred (the handler is not decompiled) |
UseNativeVCPBackend |
on | 0x11b4334 |
on: the native Direct3D 9 VCP renderer with a 2048×2048 texture canvas (0x11b4524); off: a Dear ImGui renderer (0x11b4638) that opens the ImGui window VirtualControlPad (a debug path) |
EnableVCPDebug |
off | 0x11b4200 (read with EnableVCP) |
debug drawing; effect not traced |
DeviceIsTablet |
set by Java | CAndroidFeralGame::v114 0x123e124, cached by 0x11b5f24 |
chooses phone or tablet sizes and presets (see Phone and tablet) |
Evidence: 0x14e99c8, 0x14ea380, 0x14ea79c, 0x123b8b0, 0x11b4334; keys in prefs.tsv.
The data files¶
All VCP data is in assets/VirtualControlPad/ of the APK, outside the encrypted packs. The
loader (0x1ffc4c4, 0x1ffc34c, 0x1ffe108) reads VCPConfig.xml from
{}\VirtualControlPad\VCPConfig.xml and takes the subfolders Fonts, Layouts, Textures and
Audio; the default layout is VCPLayoutDefault. Custom layouts go to a separate user folder
(the string VCPLayouts is next to these; that it names the folder is inferred).
| Path | Contents |
|---|---|
VCPConfig.xml |
canvas, fonts, the control templates, and the editor's menus |
Layouts/VCPLayoutDefault.xml |
the Default preset (schema version 2) |
Layouts/VCPLayoutAlternate.xml |
the Higher preset (version 2): Default with the controls raised |
Layouts/VCPLayoutPickupMenu.xml |
the layout while the pickup menu is open (legacy version-1 schema) |
Textures/*.tga, Textures/menu/*.tga, Textures/editor/*.png |
icons (140×140 or 256×256 RGBA), editor chrome |
Audio/menu_select.wav, Audio/back.wav |
editor button sounds |
Fonts/menu4k.ttf, menu4k_jp.ttf, menu4k_ru.ttf |
label font, with Japanese and Russian variants |
VCPConfig.xml¶
| Element | Values | Meaning |
|---|---|---|
<config version="2"/> |
2 | schema version |
<canvas minwidth minheight minOpacity/> |
1920, 1080, 96 | the virtual canvas and the lowest resting opacity (code default 48); optional initialOpacity, initialFadeOutDelay, initialFadeOutDuration are read but not set |
<font id filename filename_jp filename_ru size cropX cropY/> |
ids default, hitman16, hitman14, hitman12, hitman11, sizes 16/16/14/12/11 |
label fonts; filename_<lang> picks the localised file |
<templates> |
25 <template name> |
reusable control definitions (below) |
<rootmenu>, <filemenu>, <editmenu>, <addmenu>, <configmenu>, <confirmationmenu> |
the editor's screens (see The layout editor) |
Canvas size (0x1ffe468). With the screen aspect a = width / height: if a ≤ 16/9 the canvas
is 1920 × 1920/a, otherwise 1080·a × 1080. All positions and sizes are in canvas units, so a
20:9 phone has a 2400×1080 canvas and a 16:10 tablet a 1920×1200 one.
Element schema¶
A layout is a <layout> holding elements and <scene>s. The element tags and their type numbers
(0x1ff8040) are: stick 0, button 1, trigger 2, trackpad 3, deadzone 4, label 5,
image 6, scrollarea 7, gesturereceiver 8, slider 9, editable 11. Every element accepts
(0x1fd7cc4):
| Child | Attributes | Meaning |
|---|---|---|
config |
id, name, template, parentid, priority, passthrough, customizable |
identity; template copies a template's values first; parentid positions relative to another element; priority orders drawing and touch handling; passthrough lets a touch reach elements below (the element returns "consumed, pass on" instead of "consumed"); customizable="0" keeps it out of the editor |
position |
anchor, alignment, x, y, ignoreLH |
anchor is a point of the parent (the canvas if none), alignment the point of the element placed there, x/y an offset in canvas units; both take topleft, topmiddle, topright, middleleft, middle, middleright, bottomleft, bottommiddle, bottomright (0–8, 0x1ff8700) |
size |
width, height, relativewidth, relativeheight, radius (sticks and buttons), originalwidth, originalheight, fixedratio |
default 100×100; relativewidth/relativeheight are fractions of the canvas; a button given radius is a circle of diameter 2·radius, one given width/height is a rectangle |
colour |
r, g, b, a |
tint and base alpha |
opacity |
min, max, fadeInDuration, fadeOutDuration, fadeOutDelay |
resting and touched opacity (0–255) and fade times in seconds; fades step at 1/60 s (0x1fc33b0, 0x1fc3314, 0x1fc3514) |
img |
event, value, target, frames, fps, isExtruded, aspect, width, height |
texture per event (below) |
audio |
event (onPress, onRelease, onPressRelease), value, volume |
sound per event |
altControl |
setting, value |
a variant switched by a setting (none used) |
fillscreen |
stretch to the canvas (none used) |
Attribute variants. Every attribute lookup (0x1ff589c) tries, in order, the attribute name
with a device-model suffix (_<model>, from 0x2244488; inferred that this is the model),
then the form-factor suffix _phone or _tablet (0x1ff5590), then the handedness suffix _lh
or _rh (0x1fc9dd8), then the bare name. So x_phone="440" overrides x on phones, and
anchor_phone overrides anchor. The shipped files use only _phone.
Left-handed mirroring (0x1fd7cc4). When a layout is loaded left-handed, every element
without ignoreLH="1" has its x offset negated, and its anchor and alignment swapped left↔right
(topleft↔topright, middleleft↔middleright, bottomleft↔bottomright; the table at 0xa331f4
applies to anchors 0, 2, 3, 5, 6 and 8). Elements with ignoreLH (pause, journal, map, skip,
minimap deadzone) stay where they are.
Image events. A control's texture is chosen by event name: onLoad (idle), onTouchDown
(pressed), onTouchUp, onEdit (in the editor), toggleOn, toggleOnPressed (0x1fed50c). The
game can set a prefix per template (0x2004f34); the button then looks up <prefix>onLoad
etc., falling back to the plain event. This is how one Fire button shows punch, strangle, inject
and the rest.
Controller elements (the element attribute; _INIT at 0x1ffabc8): a, b, x, y,
left and right (the two sticks; internal ids 7 and 8), dpadup, dpaddown, dpadleft,
dpadright, start, back, leftthumb, rightthumb, leftshoulder, rightshoulder,
lefttrigger, righttrigger, device, ex1–ex13. Value 23 means "none".
Button attributes (0x1fcdb2c):
| Child | Attributes (default) | Meaning |
|---|---|---|
defaultaction |
element, behaviour (default), toggles, maxdisplacement (0 = unlimited) |
the tap action; behaviour is default (held while touched), toggle/toggles, release/onrelease, or releaseover/onreleaseover (0x1ff81cc) |
holdaction |
element, delay (1.0 s), interval (0), cancelsdefault, preventstoggle, preventstouchup, cancelonexit |
a second action after holding |
doubletapaction |
element, behaviour, waitfordoubletap, maxdelay (0.5 s) |
a double-tap action |
pressHaptic, releaseHaptic, (hold haptic) |
str (0–65534), a, d, r, s, l |
vibration envelope: strength and, by their names, attack, decay, release, sustain and length (inferred) |
Stick attributes (0x1fd0490; the writer 0x1fdd458 lists the same):
| Child | Attributes (default) | Meaning |
|---|---|---|
defaultaction |
element (left/right), sensitivity (5), invertx, inverty, curveexponent |
output stick; sensitivity 0–10 sets the response exponent (below) |
size |
radius (100), innerdeadzone (0), outerdeadzone (0) |
radius in canvas units; deadzones in percent, clamped to 0–100 |
initialrange |
x, y, width, height, relativewidth, relativeheight |
the floating zone, relative to the stick's centre |
control |
direction (horizontal, vertical) |
lock to one axis |
tapaction |
element, maxdisplacement |
action for a quick tap on the stick |
holdaction |
element, delay (1.0 s) |
action after holding |
tapandholdaction |
element |
action held while a touch that follows a tap within 0.5 s stays down |
extremityaction |
radius, startangle, endangle, stoponleave, element |
actions pressed when the stick is pushed past a radius within an angle range |
engageHaptic, boundaryHaptic (+boundaryHapticVariableStrength, …VariableSharpness), innerDeadzoneHaptic, outerDeadzoneHaptic |
str, a, d, r, s, l |
vibration when the finger lands, crosses a deadzone, or reaches the rim |
The trackpad takes only size (0x1fd42fc); the deadzone only size; the gesture
receiver swipeupaction, swipedownaction, swipeleftaction, swiperightaction and a
gestureHaptic (0x1fe2230); the slider upperinnerdeadzone, lowerinnerdeadzone,
direction, and defaultaction startingoffset maintainoffset element (0x1fe2c28). No shipped
layout uses a gesture receiver, slider or extremity action.
Legacy schema. A layout whose config version is missing or below 2 is parsed by 0x1fcace4,
which uses child elements instead of attributes: <id value>, <template name>,
<parent value>, <font value value_phone>, <labelAlignment value>, <priority value>.
VCPLayoutPickupMenu.xml is in this form.
Templates¶
All game templates are 70×70 canvas units on tablets and 112×112 on phones, with colour alpha 153
(60 %). "Group 1" press haptic: str=32534 a=0.2 d=0 r=0.2 s=0.4 l=0.04; "Group 2" (pause, map):
str=32534 a=0 d=0 r=0 s=0 l=0.02; the journal uses r=0.2, crouch a=1 r=0.2 s=1.
| Template | Kind | Element (behaviour) | Hold | Icons (onLoad; prefixed variants) |
|---|---|---|---|---|
leftstick |
stick | left, sensitivity 5 |
— | outer_thumbstick + knob inner_thumbstick; radius 70 / 150 (phone), inner deadzone 10 %; initial range x −240 (phone −440), y −2000, width 0.333 of canvas, height 4000; opacity max 153 min 0, no fades; engage haptic 32000, boundary haptic 65534 |
rightstick |
stick | right, sensitivity 5 |
— | as leftstick, no initial range (fixed) |
camera |
stick | right; tapandholdaction righttrigger |
— | knob right_stick_fire; editor only |
trackpad |
trackpad | — | — | invisible (alpha 0) |
deadzone |
deadzone | — | — | invisible, priority −5 |
pause |
button | start (onreleaseover) |
— | pause |
objective |
button | back (onreleaseover) |
— | journal; newIntel_: intel |
map |
button | leftshoulder (onreleaseover) |
— | map |
fire |
button | righttrigger (default) |
— | fire; punch_: punch; coin_: throw; throw_: throwattack; strangle_, inject_, detonate_ |
reload |
button | rightshoulder (onreleaseover) |
— | reload; disabled_: reloaddisabled |
crouch |
button | lefttrigger (onreleaseover) |
ex3 after 1.0 s, cancels default |
crouch |
drop |
button | y (onreleaseover) |
— | drop |
pickup |
button | a (onreleaseover) |
— | pickup |
placeretrieve |
button | ex2 (onreleaseover) |
— | place; retrieve_: retrieve |
disguise |
button | b (onreleaseover) |
— | disguise |
use |
button | a (onreleaseover) |
— | none (unused) |
inventory |
button | x (onreleaseover) |
ex4 after 0.3 s, prevents toggle, cancels on exit |
readyup; holster_: holster |
togglezoom |
button | dpadup (onreleaseover) |
— | x5; x2_: x2 |
zoomin, zoomout |
button | dpadright, dpadleft (default, held) |
— | zoomin, zoomout |
instinct |
button | ex1 (onreleaseover) |
— | instinct |
throw |
button | leftthumb (onreleaseover) |
— | throwstart |
view |
button | rightthumb (onreleaseover) |
— | scope_mode |
closebinoculars |
button | rightthumb (onreleaseover) |
— | closebinoculars |
customslot, menuincrease, menudecrease, editableoutline, editablehandles |
editor | a |
— | menu/button, menu/increase, menu/decrease, editor/outline_*, editor/resizer_handle |
Every game icon also has <name>_pressed (onTouchDown) and <name>_edit (onEdit).
Unused textures. No file or string references crouch_disabled, crouch_disabled_pressed,
emptytextbutton_button_greyedout, inventory, inventory_pressed, inventory_edit,
left_stick_looking, left_stick_looking_edit, ls, rs, ls_preview, shoot,
shoot_pressed, shoot_edit, menu/cancel, menu/confirm (and their pressed forms),
menu/config_disabled or menu/line. add_move and add_camera are the add-menu tiles for the
move and camera sticks; emptytextbutton_button backs the text buttons (Skip, Confirm, Cancel).
The in-game control list (HitmanBloodMoney.InGame.VCPList) names the icons: pause, view
briefing, drop, aim/switch view, move, Instinct, un-holster (tap) / open inventory (hold),
holster, crouch, melee, throw coin, strangle, pick up, shoot, reload, equip disguise, place item,
retrieve item, zoom ×2 / ×5, inject, detonate mine, aim throw, throw, put away binoculars, zoom
in, zoom out, view map.
Layouts: every control¶
Positions are canvas units (x right, y down) from the anchor; "phone" values come from the
_phone attributes. Sizes are 70 (tablet) / 112 (phone) unless noted. In the Default and Higher
layouts every stick and button uses alignment="middle" (the offset places the control's centre)
except the top row (alignment="topleft"/"topright").
Default (VCPLayoutDefault.xml)¶
| id | Template / element | Tablet anchor (x, y) | Phone anchor (x, y) | Shown when (game rules below) |
|---|---|---|---|---|
buttonpause |
pause / start |
bottomleft (30, −810) | topleft (140, 30) | always (default, closet) |
buttonjournal |
objective / back |
bottomleft (130, −810) | topleft (280, 30) | not in the hideout; newIntel_ icon for new intel |
skipbutton + skiplabel |
x, 300×105 (phone 400×140), text SkipDeathCutscene |
topleft (80, 120) | topleft (140, 165) | only while a death cutscene or Last Stand can be skipped |
buttonmap |
map / leftshoulder |
bottomright (−80, −810) | topright (−140, 30) | only when the Feral minimap is off and not in the hideout; then moved to the HUD's minimap_button point |
minimapdeadzone |
deadzone, priority 6 | placed by the game | — | over the minimap when it is shown |
leftstickmove |
leftstick / left |
bottomleft (220, −300) | bottomleft (440, −310) | always (default, scope, binoculars) |
buttondrop |
drop / y |
bottomleft (280, −500) | (520, −610) | drop allowed, or dragging a body |
buttonplaceretrieve |
placeretrieve / ex2 |
bottomleft (280, −160) | (520, −90) | place or retrieve possible |
buttonfire |
fire / righttrigger |
bottomleft (160, −460) | (350, −560) | see the Fire rules |
buttonthrow |
throw / leftthumb |
bottomleft (160, −560) | (350, −710) | a throwable item can be thrown |
buttondisguise |
disguise / b |
bottomleft (390, −200) | (700, −150) | a disguise can be taken |
rightstickmove |
rightstick / right |
bottomright (−300, −320) | (−450, −340) | camera style Joystick |
trackpad |
trackpad, priority 5, 0.667 × 1.0 of canvas | bottomright (0, 0), alignment bottomright | same | camera style Trackpad (default) |
buttonfireright |
fire / righttrigger, 100×100 (phone 200×200) |
bottomright (−160, −570) | (−250, −570) | see the Fire rules |
buttoninventory |
inventory / x, hold ex4 |
bottomright (−160, −180) | (−240, −140) | not dragging a body, not in the blocking movement states |
buttoninstinct |
instinct / ex1 |
bottomright (−290, −140) | (−450, −70) | Instinct allowed and not blocked |
buttoncrouch |
crouch / lefttrigger, hold ex3 |
bottomright (−430, −190) | (−650, −140) | not dragging a body and not in some movement states |
buttonreload |
reload / rightshoulder |
bottomright (−110, −290) | (−180, −310) | firearm ready, spare ammo, clip not full |
buttonview |
view / rightthumb |
bottomright (−310, −510) | (−470, −630) | not dragging a body, not in the blocking movement states |
buttonclosebinoculars |
closebinoculars / rightthumb |
bottomright (−310, −510) | (−470, −630) | binoculars scene |
buttonpickup |
pickup / a |
bottomright (−420, −490) | (−640, −600) | at least one pickup candidate |
buttontogglezoom |
togglezoom / dpadup |
bottomright (−160, −180) | (−240, −140) | scope scene |
buttonzoomin |
zoomin / dpadright |
bottomright (−110, −290) | (−180, −310) | binoculars scene, when zoom is available |
buttonzoomout |
zoomout / dpadleft |
bottomright (−160, −180) | (−240, −140) | binoculars scene, when zoom is available |
Scene membership (<scene> lists; customizable marks the scenes the editor offers):
| Scene | Display name | Editable | Elements |
|---|---|---|---|
default |
VCPScene_Default |
yes | skip button and label, pause, journal, map, minimap deadzone, move stick, camera stick, drop, place/retrieve, fire (left), throw, disguise, trackpad, fire (right), inventory, Instinct, crouch, reload, view, pickup |
binoculars |
VCPScene_Binoculars |
yes | minimap deadzone, move stick, camera stick, close binoculars, zoom in, zoom out, crouch, trackpad |
scope |
VCPScene_Scope |
yes | map, minimap deadzone, move stick, camera stick, fire (left), trackpad, fire (right), crouch, toggle zoom, reload, view |
closet |
VCPScene_Closet |
no | pause, journal, map, minimap deadzone, trackpad |
Every scene also lists an id rightstick, which no element has; the camera stick is
rightstickmove. The game shows and hides it by template name, so the stray id has no effect
(inferred).
Higher (VCPLayoutAlternate.xml)¶
Identical on phones. On tablets the top row moves to the top edge — pause topleft (30, 300),
journal topleft (130, 300), map topright (−80, 300) — and every stick and button is 220 units
higher (for example the move stick at bottomleft (220, −520), the right fire button at
bottomright (−160, −690)). Its default scene lists skiplabel before skipbutton; otherwise the
scenes match.
Pickup menu (VCPLayoutPickupMenu.xml)¶
Loaded while the pickup wheel is open, never left-handed. It has the move stick (bottomleft
(240, −470), phone (440, −320), fixed opacity 153), confirmbutton (a, label
InGame.ConfirmVCP, middleright (−300, −100), phone (−350, −100), 300×105 / 350×120) and
cancelbutton (b, label InGame.CancelFromVCPEditor, middleright (−300, 100), phone
(−350, 100)). It has no scenes and no camera control.
The runtime¶
Classes¶
| Class | Role | Key functions |
|---|---|---|
CFeralVirtualControlPad |
owns the canvas, layout, scenes, elements, editor menus, the controller state it fills, and timers | constructor 0x1ffc4c4; touch dispatch v25 0x200a680; gesture entry v26 0x200ad58; editor pinch v27 0x200af0c; load layout 0x1ffd08c; show/hide 0x2002d18 |
CFeralVirtualControlPad::CStandaloneGestureHandler |
registers the pad with the gesture recogniser and forwards gestures to v26/v27 | 0x1ffc0ec |
CFeralVCPCoordinator |
shared owner object for the pad (shared_ptr) | vtable slots 0x2013944–0x2013af8 (not analysed further) |
CFeralVCPLayout, CFeralVCPD3D9Layout |
per-backend drawing of the element list | 0x126db74 |
CFeralVCPElement |
base: position, size, anchors, opacity and fades, images, audio, haptics | 0x1fc1e50 (constructor), 0x1fc3d90 (haptic), 0x1fc382c (press/release a controller element) |
CFeralVCPButton |
buttons | hit test v10 0x1fed808, touch v11 0x1feda08, reset v2 0x1fed410 |
CFeralVCPAnalogueStick |
sticks | constructor 0x1ff056c, set size v5 0x1ff1400, hit test v10 0x1ff18d4, touch v11 0x1ff2020, haptics 0x1ff1434 |
CFeralVCPTrackpad |
camera trackpad | constructor 0x1ff6960, hit test v10 0x1ff6af0, touch v11 0x1ff6c00, read and reset 0x1ff6a4c |
CFeralVCPDeadzone |
touch blocker | v10 0x1ff3188, v11 0x1ff3288 |
CFeralVCPElementGestureReceiver |
swipe-to-button area | v11 0x1ff3954 |
CFeralVCPElementEditable |
editor wrapper around an element: outline, handles, move, scale | 0x2014ee8–0x2016058 |
CFeralVCPElementSlider, CFeralVCPScrollArea, CFeralVCPLabel, CFeralVCPImage |
slider, add-menu scroller, text, picture | |
CFeralVCPCamera, CFeralVCPD3D9Camera |
2-D projection for drawing |
Touch dispatch¶
Touches arrive as Feral events: one kFEventTouchMulti per Android motion event, holding a
kFEventTouchChanged per pointer with its raw type (1 Up, 2 Down, 3 Moved, 4 Lost), location,
touch id and timestamp. The pad's v25 (0x200a680) handles each pointer:
- Convert the location to canvas units.
- Offer it to each enabled, visible element in list order through the element's touch slot
(v11). An element answers 0 (not mine), 1 (consumed), 2 (consumed, pass on, for
passthrough) or 3 (consumed and stop, the deadzone). Answers 1 and 3 end the search. - A Down that no element took is offered again with a second-pass flag; on this pass a stick
accepts a touch inside its
initialrange(the floating zone). - A touch still unclaimed goes to a fallback button, then to the pad's listeners.
Each element remembers the id of the touch it owns and ignores others until that touch ends, so
one finger drives one control and several fingers drive several controls at once. The element
order follows priority (inferred: the minimap deadzone, priority 6, is placed above the
trackpad, priority 5, so a touch starting on the minimap does not turn the camera).
Analogue stick¶
State: R = ⌊width/2⌋ (the radius; 70 or 150), the home centre, the owned touch, the touch-down
time and point.
Touch down (0x1ff2020):
- First pass: accept if the finger is within R of the stick's centre.
- Second pass (nobody else took it): accept if the finger is inside the initial-range rectangle
(centre + (x, y), size width × height); the stick's centre then jumps to the finger
(
0x1fc25a8), giving an output of zero. For the move stick the rectangle is x from −240 (phone −440) to +0.333 of the canvas width from the centre, and 4000 units tall: in effect the left third of the screen. - Record the time and point, start the hold timer if a
holdactionexists (delay, default 1.0 s), press thetapandholdactionelement if the previous tap ended less than 0.5 s ago, and showonTouchDown.
Move. With d = finger − centre:
- If
directionis horizontal, d.y = 0; if vertical, d.x = 0. - If |d| > R: if
maxdisplacementis set and |d| exceeds it, mark the touch as "moved" (it can no longer count as a tap); then clamp d to length R (to the extremity radius when extremity actions exist, pressing the action whose angle range contains atan2(d) in degrees). The base does not follow the finger. - Play haptics (
0x1ff1434): the engage haptic when the touch starts; the inner- and outer-deadzone haptics when |d| crosses those radii outwards; the boundary haptic when |d| crosses R − R/10 outwards, its strength scaled by |d|/R whenboundaryHapticVariableStrengthis set, its sharpness by |d.y|/R whenboundaryHapticVariableSharpnessis set. - Compute the output (below).
Output, per axis, with inner = innerdeadzone/100, outer = outerdeadzone/100 and the
exponent e = (15 − sensitivity)/10 (1.0 at the default 5, 1.5 at 0, 0.5 at 10):
a = min(|d.x|, R) / R
if a < inner: v = 0
elif a > 1 - outer: v = 1
else: v = (a - inner) / (1 - outer - inner)
x = trunc(v^e * (d.x > 0 ? +32767 : -32767)); if invertx: x = -x
y: the same with d.y, but the sign is +32767 when d.y < 0 (screen up = stick up); if inverty: y = -y
The values go into the virtual controller's left stick (element left) or right stick
(right) as signed 16-bit axes. The deadzone is per axis (square), not radial. There is no
sprint threshold in the stick: the game receives the analogue magnitude and decides walk or run
itself (the touch tutorial: "move the virtual joystick further to move faster"). The move stick
template uses inner 10 %, outer 0 %, sensitivity 5, so the response is linear from 10 % to 100 %
of the radius.
Touch up / lost. Release the touch, show onTouchUp, return the centre to its home position,
zero the output. If the touch lasted less than 0.25 s and never moved beyond maxdisplacement,
fire the tapaction: toggled if it toggles, otherwise pressed for 0.1 s; remember the tap time
for tap-and-hold. Cancel the hold timer and release the hold and tap-and-hold elements.
Editor. In the editor a finger on the stick drags it; a finger within R/3 of a point above
the centre drags the extremity radius (0x1ff2020, editor path).
Buttons¶
CFeralVCPButton::v11 (0x1feda08). Hit test: a circle of radius width/2 around the centre, or
the rectangle. A Down inside claims the touch and records the time.
Down:
- If a double-tap action waits for a second tap (
waitfordoubletap) and this is not it, start a timer ofmaxdelay(0.5 s); if it expires, the single-tap action is pressed then. - If a hold action exists, start its timer (
delay, default 1.0 s; the inventory uses 0.3 s). When it fires (0x1fee6c8): mark the hold as fired, press the hold element, release the default element ifcancelsdefault, latch the toggle state ifpreventstoggleand the button is a toggle, and play the hold haptic. - For behaviour
default(andtoggleunless prevented), press the default element now; play the press haptic and theonPresssound.
Move: if maxdisplacement is set and the finger has moved further than that from the
touch-down point, release the default element. If the finger leaves the button and
cancelonexit is set, cancel a pending hold and release the hold element.
Up:
- If the finger moved beyond
maxdisplacement, release and stop. - If it was the second tap of a double tap within 0.5 s, press or toggle the double-tap element.
- Release the hold element; if the hold had fired and
cancelsdefaultis set, the default action is skipped. - Behaviour
release: press the default element for 0.1 s ($_3timer). Behaviourreleaseover: the same, but only if the finger is still over the button. Behaviourtoggle: flip the toggled state and press or release accordingly. Behaviourdefault: release (unlesspreventstouchupkeeps it after a fired hold). - Play the release haptic and
onReleasesound; showonTouchUp(ortoggleOn).
So nearly every game button is a 0.1 s pulse on lift-off over the button, Fire and the zoom
buttons are held while touched, crouch fires lefttrigger on a tap and ex3 (not the tap) after
1.0 s, and the inventory button sends x on a tap and ex4 after 0.3 s.
Trackpad¶
CFeralVCPTrackpad (constructor 0x1ff6960, touch 0x1ff6c00, read 0x1ff6a4c). Fields and
their defaults: scale k₁ = 1.0, divisor 50, reference speed 200, minimum speed 1, maximum speed
1000, gain g, sensitivity s = 1.0, exponent p = 1.0.
Touch:
- Down inside the rectangle with no owned touch: own it, clear the history, remember the point, clear the last time.
- Moved (own touch): δ = point − last point; last point = point. If a previous move time exists: push δ into a history of at most the last 3 deltas, add the history's mean to the frame's accumulated delta Σ, add |δ| / (t − t_prev) to the speed sum, and count one sample. Store t.
- Up or lost: release the touch.
Read once per game frame (by the touch device's poll), then reset the accumulators:
if samples == 0: return (0, 0)
speed = clamp((speed_sum / samples) * k1, 1, 1000)
factor = (speed / 200) ^ p
out = Σ * g * s * factor
Settings applied by the game (0x14ef1e0, when the trackpad element is first found):
k₁ = r, g = r·π/50 (r = a display dimension divided by the screen width, 0x11a0aec /
0x11a09fc), s = TrackpadSensitivity/5 + 0.5, p = TrackpadAcceleration² × 0.01056.
Both are game options, not preferences. The options getter (0x1764850, cases 0x1a and 0x1b)
returns 5 for a profile without them and "reset Controls to defaults" (0x14fcd8c) writes 5,
giving s = 1.5 and p = 0.264; this function's own read falls back to 0 (s = 0.5, p = 0) only if
the store has no value. At the slider's top value (10, inferred) s = 2.5 and p = 1.056, roughly
linear in finger speed.
Into the game (touch poll 0x14ecfe4): axis 2 = out.x × 12.5, axis 3 = out.y × 15.625 of
the touch device. When lock-on is active and |out.x| > 0.3, the trackpad switches target instead:
it latches the direction (out.x > 0 = right), zeroes the camera output while the finger is down,
and on release calls the lock-on target switch (0x16c42fc).
Deadzone¶
CFeralVCPDeadzone (0x1ff3288): a Down inside its rectangle is claimed and answered "stop" (3)
until the finger lifts, so nothing else receives it. It draws nothing.
Opacity and fades¶
Each element has a current, maximum and minimum opacity (0–255). At load the current opacity is
max(min, canvas minOpacity) unless the maximum is 0 (0x1fd7cc4; inferred reading). Touch
down fades to the maximum over fadeInDuration; touch up waits fadeOutDelay then fades to the
minimum over fadeOutDuration (0x1fc3314, 0x1fc3514). The shipped durations are 0, so
changes are immediate.
Haptics¶
A haptic is played through 0x1fc3d90 with the element's envelope, multiplied by the element's
strength factor. The game sets that factor on every element (0x2001db0) to
VibrationStrength/10 when the Virtual Controller Vibration option is on, and 0 when off
(0x14ed568). Defaults: on, strength 5 (factor 0.5). ZFeralVCPVibrationToggleOption is the
options-menu toggle (label HitmanBloodMoney.InGame.VCPVibrations, "VIRTUAL CONTROLLER
VIBRATION"); its own code shares slot 0 with ZFeralVibrationToggleOption (0x1742e64) and was
not decoded separately.
Context-sensitive buttons¶
PC behaviour. The PC shows prompts and the action list (src/hitman3/gui/), and every
action has a fixed key or pad button.
Reprisal behaviour. The game keeps a set of boolean flags in the touch device (bytes
+0x108…+0x138, setter 0x14ee864(dev, index, value)); any change marks the VCP dirty, and a
few (indices 4, 5, 6, 0x17, 0x1b, 0x30) also force a layout reload and refresh at once. The
refresh 0x14ed568 runs from the touch device's poll whenever the dirty flag is set.
Show or hide the whole pad¶
normal = hitman exists and not paused-menu (f109, f10f) and HUD active (f10b or f11f or f123)
and not front-end (f138) and not scripted sequence (f108) and (no movie (f10a) or f123)
show = input mode == 3 and EnableVCP and (an OSD overlay state other than 6 is set, or normal)
The same test is exported as 0x14ef140 for the HUD. Hidden means nothing else runs.
Layout reload¶
When reload is requested and the pad is shown: if the pickup menu is open (flag 4, set by
0x170a154), load VCPLayoutPickupMenu; otherwise load VCPSelectedLayout (below). Either way
the trackpad settings are re-applied.
Scene choice¶
- If a peephole view (f12c) or an overlay is active, hide every element; with a peephole, re-show only the camera control.
- Otherwise pick the scene: camera mode 9 (binoculars) →
binoculars(zoom in/out hidden unless zoom is available, f11e); scope view (f132) →scope(the toggle-zoom icon getsx2_when zoomed (f133); Fire gets no prefix and behaviourdefault); camera mode 5 →closet; otherwisedefault. Camera modes areZHM3Camera::ECameraMode(src/hitman3/camera/hm3camera.h).
Per-control rules (after the scene is chosen)¶
| Control | Rule |
|---|---|
map (template) |
hidden if the Feral minimap is on (UseFeralMinimap) or in the hideout (level child HideOut, 0x155346c); when shown outside the editor, buttonmap is moved onto the OSD point osd/minimap_button (0x14ec8e0) |
minimapdeadzone |
when the minimap is shown (or in the hideout): size 0.8 × the HUD minimap rectangle, placed at (x + 0.9 w, y + 0.1 h) of it, i.e. the central 80 % (0x1704d04 reads the HUD minimap); otherwise hidden |
reload |
shown only if a firearm is ready (f113), spare ammo exists (f114, or infinite ammo) and the clip is not full (f115); the disabled_ icon is not used by this code |
trackpad / rightstick |
VCPAimInputStyle 0 (Trackpad-Style, default) shows the trackpad; 1 (Joystick-Style) shows the camera stick (0x14ef460) |
skipbutton, skiplabel |
shown only while a death cutscene can be skipped (f123) or a Last Stand skip is offered (f120, LastStandSkip); the button sends x |
objective |
hidden in the hideout; prefix newIntel_ when a new tutorial or intel entry exists (f128, set by the M00 tutorials and cleared on closing them) or the OSD state is 4 |
pause, leftstick |
never hidden |
crouch |
hidden while dragging a body (f136), or in movement states 11–15 and 23 |
view |
hidden while dragging a body or in movement states 10–15, 17, 18, 23 |
buttonfire, buttonfireright |
hidden in movement states 10–15, 17, 18, 23; the left one also when the Lockon option is on and the camera is not first-person (2), sniper scope (3) or Feral mode (10) |
throw |
a throwable item (not a coin) in either hand, not dragging a body |
pickup |
at least one pickup candidate |
disguise |
a disguise can be taken (f117) |
drop |
drop allowed (f11a) or dragging a body |
placeretrieve |
place (f11b) or retrieve (f11c) possible; prefix retrieve_ for retrieve |
inventory |
hidden while dragging a body or in movement states 10–15, 17, 18, 23; prefix holster_ when an item is in the right hand, else the ready-up icon |
instinct |
AllowInstinctMode on and Instinct not blocked (hitman+0x1160 == 0) |
The movement-state ids are Hitman's move-state ids read through two virtual calls; they were not
mapped to src/ names. The flag setters for disguise, place, retrieve, binocular zoom, scope ×2,
the skip-death and the inject/detonate/strangle flags were not found in decompiled code, so those
meanings come from how the refresh uses them (inferred).
The Fire icon¶
When the Fire buttons are shown, the first matching rule picks the prefix (0x14ed568):
| Order | Condition | Prefix → icon | Behaviour |
|---|---|---|---|
| 1 | a coin is in the right hand (item 300, eHM3ItemCoin) |
coin_ → throw |
releaseover |
| 2 | Hitman is in throw-aim mode (action state 0x10000004), not a coin | throw_ → throwattack |
releaseover |
| 3 | f12a (inject possible, inferred) | inject_ |
releaseover |
| 4 | f12b (detonate possible, inferred) | detonate_ |
releaseover |
| 5 | a firearm is ready | none → fire |
default (held) |
| 6 | f129 (strangle possible, inferred) | strangle_ |
default |
| 7 | fibre wire in hand (item type 38), an item in the right hand, or f126 | punch_ |
default / releaseover |
| 8 | f130, f12f, f12d, f12e (item-type fallbacks, inferred) | coin_, detonate_, strangle_, inject_ |
releaseover |
| 9 | f131 | none → fire |
releaseover |
| 10 | otherwise | punch_ |
releaseover |
The behaviour is set with 0x2005194: held for firing, strangling and melee with the wire; a
release pulse for throwing, injecting and detonating.
What the buttons do in the game¶
The VCP sets controller elements; feraltouch.cfg maps them to game actions and cannot be read.
The icon-to-action table _INIT_166 (0x13df6dc, from strings only) and the templates give
this mapping (inferred):
| Element | Template | Game action |
|---|---|---|
righttrigger |
fire | FireWeapon (shoot, punch, strangle, inject, detonate, throw) |
lefttrigger (tap), ex3 (hold) |
crouch | CrouchSneak; the hold is the fast descent on ladders ("press and hold {crouch}") |
a |
pickup | PickupFast |
b |
disguise | PickupDisguise |
x (tap), ex4 (hold 0.3 s) |
inventory | Holster / open inventory |
y |
drop | drop |
ex1 |
instinct | FeralInstinctMode |
ex2 |
placeretrieve | PlaceRetrieve |
leftthumb |
throw | ThrowItem (aim throw) |
rightthumb |
view, closebinoculars | change view / aim, put away binoculars |
back, start, leftshoulder, rightshoulder |
objective, pause, map, reload | Briefing, pause, map, reload |
dpadup, dpadright, dpadleft |
togglezoom, zoomin, zoomout | scope ×2/×5, binocular zoom |
See Controls, Camera and Aiming for the gamepad side of these actions.
Layout selection and persistence¶
Presets. VCPSelectedLayout (an int in the game options) selects the layout
(0x1726de4, 0x11b4964, 0x11b4828):
| Value | Name | File | Left-handed |
|---|---|---|---|
| 0 | InGame.VCPLayoutDefault "DEFAULT" |
VCPLayoutDefault |
no |
| 1 | InGame.VCPLayoutDefaultLH "LEFT-HANDED" |
VCPLayoutDefault |
yes |
| 2 | InGame.VCPLayoutAlternate "HIGHER" |
VCPLayoutAlternate |
no |
| 3 | InGame.VCPLayoutAlternateLH "HIGHER LEFT-HANDED" |
VCPLayoutAlternate |
yes |
| 4 + n | InGame.VCPLayoutCustom "CUSTOM %d" |
custom layout n (0x2004600) |
as saved |
Left-handed is (value & ~2) == 1. Phones offer only the first two presets (0x11b4ac4: 2 on
phones, 4 on tablets), which matches the files: Higher's phone positions equal Default's.
Deleting a custom layout falls back to the last preset (0x1727c84).
Left-handed mode mirrors every non-ignoreLH element (see the schema). The move stick and its
floating zone go to the right, the trackpad (the Action Area) to the left two-thirds; the top
row stays. The tutorials have _Left variants for this (Tutorial_01_Control_Touch_Left,
Tutorial_56_Splash_02_Touch_Left).
Custom layouts (0x1fdb6b8, writer 0x1fda848, stick writer 0x1fdd458, button writer
0x1fdfdfc) are written as XML version 2 with config name, model, machine, canvasWidth
and canvasHeight, to Custom_<YYYYMMddHHmmss>.xml. Saving overwrites the custom layout being
edited, or creates a new file when editing a preset. Loading reports the analytics event
Feral.FeralLib.VCPLayoutLoaded with LayoutFile, IsCustom and LayoutChangedBeforeLoad
(0x1fcd2a4).
Controls menu preview (ZFeralControlLayoutMenu::v12 0x1725594, 0x17269b0). The menu
draws the selected layout in a VCPPreviewPad box with one VCPPreviewLabel_<id> per visible
element, placed at the element's canvas position scaled into 92 % (tablet) or 93 % (phone) of the
box width and 90 % of its height, offset 5 %; ActionAreaPreview marks the trackpad: 2/3 × 96 %
of the box on the right third, or the left when left-handed, shown only in touch mode.
The layout editor¶
HitmanBloodMoneyInterface::CustomizeVCPLayout(layout, hideAfter, onDone) (0x11b4d30, from the
controls menu 0x1727b5c) loads the layout, opens the editor (0x20073d4) and shows the pad; on
exit it calls onDone and hides the pad if asked.
| Menu (VCPConfig.xml) | Controls | Action |
|---|---|---|
| root | move handle (menu/movehandle, 1000×150, top centre); scene ◀ ▶ with the scene name; Add, Menu, Delete; expand |
drag the toolbar; cycle the editable scenes (Default, Binoculars, Scope); open the add dock; open the file menu; delete the selected control; open the edit panel |
| edit panel | Scale − / + (Scale %d%%), Opacity − / +, Position ▲ ▼ ◀ ▶, config (stick options), collapse |
see below |
| add dock | a scroll area (optionroot) of the 19 options: Move Stick, Camera, Pause, Briefing, Fire, Reload, Crouch, Drop, Pickup, Inventory, Zoom, Throw Mode, Change View, Place/Retrieve Item, Instinct Mode, Equip Disguise, View Map, Zoom In, Zoom Out |
AddMenuInstructions: "Double tap a button to add it to the canvas" (a tap-and-hold variant string exists) |
stick options (StickConfigHeader "Joystick Options") |
Inner Deadzone − / +, Outer Deadzone − / +, Sensitivity − / +, Invert X, Invert Y, VCP_InvertTapAction toggle, Back |
per stick |
| file menu | close; Reset to Left-Hand Default; Reset to Right-Hand Default; Discard and Exit; Save and Exit | |
| confirmation | "EXIT WITHOUT SAVING?" / "Unsaved changes will be lost.", CANCEL (InGame.CancelFromVCPEditor), CONTINUE (InGame.ContinueFromVCPEditor) |
shown when leaving with unsaved changes |
Editing rules (lambdas of SetupMenuEditButtons and SetupMenuConfigButtons, 0x200fd40–
0x2010ea0):
- Select and move: touch a control to select it (outline
editor/outline_*, corner handleseditor/resizer_handle40×40); drag to move (the grab offset is kept). The arrow buttons move it by 2 canvas units per press. - Scale: ±10 percentage points of the current scale per press; pinch with two fingers
scales by the change in
gesture_scale(0x200af0c). A new size is accepted only if it stays between 0.5 and 2.0 of the original size (0x2015e28). - Opacity: shown as p = (o − 5)/2.5 percent of the byte o; each press snaps p to the next multiple of 5 up or down; the stored byte is max(round(2.5·p), 13) + 5, and above 250 becomes
- The range is therefore about 5 % (byte 18) to 100 %.
- Stick options: deadzones ±10 % per press, 0–40 %; sensitivity ±1, 0–10 (exponent
(15 − S)/10); Invert X / Y toggles; the tap-action toggle (
0x2008628) switches the stick's tap action (exact effect not traced). - A tap on empty canvas deselects (
0x20042ac, inferred).
Phone and tablet¶
The form factor (0x11b3608) comes from a UI-mode string (phone 1, tablet 2, Switch 3, original
0) or, when automatic, from DeviceIsTablet (0x22450c0: tablet → 2, else phone → 1). It picks
the _phone/_tablet attribute variants, the number of presets, and the preview scaling. On
phones the controls are larger in canvas units (buttons 112 vs 70, stick radius 150 vs 70, right
fire 200 vs 100) and the top row sits along the top edge. TabletTargetUIWidth and
PhoneTargetUIWidth (1920 and 1366) scale the HUD, not the VCP (HUD).
Gestures and HUD touch zones¶
Besides the VCP's own elements, the game reads touch through a touch input device,
FeralTouchWintel (constructor 0x14ecc98, built through 0x150a050; 33 vtable slots, most not
decompiled). It has 8 buttons and 18 axes (name tables 0x3063a40, 0x3063ac0), which
feraltouch.cfg binds to game inputs:
| Buttons | Axes |
|---|---|
0 tapselect, 1 tapaction, 2 tappickup, 3 swipeleft, 4 swiperight, 5 pressinprogress, 6 touch, 7 doubletapselect |
0–1 taplocationx/y, 2–3 trackx/y (the trackpad), 4 canvaspinchspeed, 5–6 scrollpanx/y, 7–8 scrolllocationx/y, 9–10 presslocationx/y, 11 pressstart, 12–13 canvaspinchx/y, 14–15 canvaspanx/y, 16 canvaspinchdistance, 17 canvaspinchdistancedelta |
Feral's gesture recognisers¶
CFeralGestureRecogniser (singleton 0x1f68014, built by 0x1f67b40, detectors created in
0x1f6a608) runs a set of CFeralGestureDetectors on every touch event and emits gesture events
(kFEventGestureTap 0x2d, Swipe 0x2e, Pan 0x2f, Pinch 0x30, Rotate 0x31, Press 0x32)
with status Began / Updated / Finished / Cancelled and fields gesture_location,
gesture_touches, gesture_taps, gesture_delta, gesture_delta_delta, gesture_scale,
gesture_rotation, gesture_speed, gesture_duration, gesture_direction (None, Up, Down,
Left, Right). Units are screen units (pixels, inferred). Tuning (read in CFeralGame::v59
0x11d8b44; none is registered, so these code defaults apply):
| Preference | Default | Used by |
|---|---|---|
PanThresholdDefault |
20 | pan start distance; also caps the tap and press movement limits |
TapThresholdDefault |
64 | tap movement limit (effective min(64, 20) = 20) |
PressThresholdDefault |
64 | press movement limit (effective min(64, 20) + 4 = 24) |
GesturePressMinDuration |
0.5 s | press begins |
GestureLongPressMinDuration |
2.0 s | long press |
PressMoveLimit |
10 | stored; reader not found |
UseMultipleGestureRecognisers |
off (inferred) | one detector set per screen half |
UseNonDefaultGestureDetectionLogic |
off | XORed with "release date ≥ 2024-05-23"; Hitman's (2023-11-30) gives the default logic |
The detectors:
- Tap (
0x1f63068): four detectors, for (taps, fingers) = (1,1), (2,1), (1,2), (2,2). It fails if a finger moves more than 20 from where it landed, or if more than 0.5 s passes between successive downs and ups; it is recognised when the last finger lifts with the required count. - Pan and swipe (
0x1f63514): any number of fingers, tracked by their centroid; begins when the centroid has moved 20. The direction is vertical if |dy/dx| > 0.2671 (tan 15°), else horizontal. On Finished, if the pan lasted ≤ 0.2 s and |delta| ≥ 50, a swipe is also emitted. - Pinch (
0x1f641c4): exactly two touches; begins when the distance has changed by 64;gesture_scale= distance / initial distance; updates closer than 0.01 s are skipped. - Rotate (
0x1f64778): two touches; begins at π/32 (5.6°) from the initial angle. - Press (
0x1f65468): one- and two-finger detectors; Began after 0.5 s without moving more than 24, a second event after 2.0 s (long press); Finished on release.
Uses3FingerGestures is passed to a function that is empty on Android. CFeralFlickRecogniser
and CFeralJoltRecogniser are motion-sensor recognisers (a jolt is an axis value above 8.0, then
0.5 s locked out); Hitman creates none (inferred). CPullToValueAccel and CVangPullAccel are
IOI engine classes (src/engine/shared/moveutils/), not touch code; nothing links them to the
VCP. "Unknown touch id %d, resetting" is SDL's own message.
What the game does with gestures¶
FeralTouchWintel::v26 (0x14ee95c) routes the events; the poll (0x14ecfe4) turns them into
button and axis values once per frame.
| Gesture | Device output | Game effect |
|---|---|---|
| any touch down / up | button 6 touch, axes 0–1 |
— |
| tap (1 tap) | button 0 tapselect, axes 0–1 |
the Action Area (below); menus select by tap location; video skip |
| double tap | button 7 doubletapselect |
— |
| one-finger pan | axes 14–15 canvaspan (unless pinching) |
map and statistics panning (inferred binding) |
| pan, any fingers | axes 5–6 scrollpan, start point in 7–8 |
menu and list scrolling, weapon-details rotation |
| pinch | axis 4 scale, 16 distance, 12–13 centre; 14–15 and 17 as frame deltas | map and statistics zoom |
| press | button 5 while held, axes 9–10 location, axis 11 start time (s) | — |
| swipe, three fingers | event Feral.HitmanBloodMoney.FeralClaw |
sets a request on the in-game menu object (the owner of the pause/menu state word); that it opens the pause menu is inferred. Ignored while a menu is up |
| swipe left/right, Joystick-Style | — | switches the lock-on target (0x16c42fc) |
| rotate | — | not handled |
Buttons 3 and 4 (swipeleft, swiperight) are never set; they are always 0. Android reports up
to the third pointer as a single-touch "mouse" event too unless AlwaysDetectFeralClaw is set
(0x21d5410; exact effect not traced).
The Action Area. On a frame with a tap, with A = Hitman's current action (hitman+0xae0,
EHM3Action in src/hitman3/gui/ingamemenus.h), G = a gazed object exists, D = the disguise
flag, P = the pickup-candidate count:
pick = EnablePickupWheelOnGaze ? (!D and P > 0) : (D != (P == 1))
if A in {eNone, ePlaceItem, eRetrieveItem, ePlace, eRetrieve}:
tapaction = 0; tappickup = pick and G
else:
tapaction = 1; tappickup = 0
So a tap performs the available action (open a door, drag a body, hide in a closet…), and otherwise picks up the item Hitman is looking at. The code does not test where the tap was: the "right side of the screen" in the tutorials is the trackpad's area (the right two-thirds; the left third belongs to the move stick's floating zone, and buttons take their own touches). Whether a touch claimed by a VCP button still produces a tap gesture was not determined.
Minimap. The HUD minimap rectangle (HUD map object +0x660, from osd.xml minimap,
0x1704ab4) is covered during play by the VCP's minimapdeadzone (above), so a drag starting
there does not move the camera. The tutorials say a tap on the minimap opens the map, but no game
code was found that tests a tap against the minimap; the binding may be in feraltouch.cfg
(unresolved). With the Feral minimap off, the map button sits at osd.xml's
minimap_button point (under the original health and suspicion bars, top right in touch mode).
Weapon Panel and inventory. No separate weapon-panel hit zone was found. The inventory
button gives the described behaviour (tap: holster or ready, x; hold 0.3 s: inventory,
ex4); the input sampler 0x1782574 reports Feral.HitmanBloodMoney.HolsterTriggered and
InventoryTriggered with TriggerMethod = "VCPButton". In the inventory, a tap selects an item by
location (TapSelect, TapSelectLocationX/Y); the source of the left/right swipe was not found.
Other touch inputs (registration read, use inferred): the map screen (0x16fa930:
MapCameraRightTouch, MapCameraDownTouch, MapMoveDownTouch, MapPinchDistance,
MapPinchX/Y); the statistics screen (0x1781efc, 0x1780d2c: StatLeftTouch, StatUpTouch
pan divided by the screen size; pinch zoom z' = z + z·((d/(d − Δ))^¼ − 1), clamped to 0.8–1.3,
changes under 0.0015 ignored, panning corrected about the pinch centre); menu lists
(0x159b8fc, 0x1593428: ScrollXTouch, ScrollLocationX/YTouch, TapSelectLocationX/Y);
the weapon-details 3-D view (0x1755058); video skip (0x173182c: a tap within 0.067 of the
screen on tablets, 0.134 otherwise). In Trackpad-Style the camera code (0x1628f30) treats
ScrollLocationXTouch != 0 as "camera input active" for the lock-on look-break logic.
Preferences and options¶
| Key | Kind | Default | Effect |
|---|---|---|---|
EnableVCP |
preference | on | master switch |
UseNativeVCPBackend |
preference | on | native renderer (off: ImGui) |
EnableVCPDebug |
preference | off | debug drawing |
ForceTouchControls |
preference | off | force touch mode, stop tracking external devices |
DisplayControlsPrompt |
preference | on | ask whether to prefer touch when a device is connected |
DeviceIsTablet |
preference (set by Java) | device | phone or tablet |
VCPSelectedLayout |
game option | 0 | preset or custom layout |
VCPAimInputStyle |
game option (id 0x13) | 0 | 0 Trackpad-Style, 1 Joystick-Style (InGame.TrackpadStyle, InGame.JoystickStyle) |
TrackpadSensitivity |
game option | 5 | s = value/5 + 0.5 |
TrackpadAcceleration |
game option | 5 | p = value² × 0.01056 |
VirtualControllerVibration |
game option (id 0x11) | on | VCP haptics on or off |
VibrationStrength |
game option (id 0x12) | 5 | haptic factor value/10 |
The game options are reset to these values by "reset Controls to defaults" (0x14fcd8c); they are
applied in 0x1764da8. Slider ranges are not in code (0–10 is inferred).
The port's reimplementation¶
The port has its own touch layer in port/engine/system/_sdl/touchcontrolscore.cpp (state machine
and layout) and touchcontrolssdl.cpp (SDL events, game context, drawing and the editor), tested
by tools/port/tests/touch_controls_test.cpp. With the Reprisal HUD (openblood.hud_style
Reprisal) it plays Feral's Virtual Control Pad; otherwise it keeps the port's own layout and
gestures. The Reprisal layout matches as follows.
- Layouts. The positions and sizes of
VCPLayoutDefault,VCPLayoutAlternate(Higher) andVCPLayoutPickupMenuare copied as data (s_aVcpPlacements): anchor, alignment, x and y, their_phonevariants and the left-handed mirroring (x negated, left and right swapped,ignoreLHkept), on Feral's canvas (1920 wide up to 16:9, else 1080 tall). The phone or tablet variant follows the window: a shorter side of at least 600 density-independent pixels is a tablet (Reprisal readsDeviceIsTabletfrom Java).controls.touch_vcp_layoutpicks Default or Higher (the launcher's Reprisal touch layout);touch_left_handedmirrors. Buttons are hit as squares with no margin, as Reprisal's are; the port draws its own discs and icons, since the textures' look is not reproduced.OPENBLOOD_TOUCH_FORM=phone(ortablet) forces the variant, to check a phone's layout on a desktop; the layouts were checked in the game at 2400×1080, 1920×1080 and 1440×1080 in both variants. - Map button and minimap deadzone. The port works out the touch version of
osd.xmlas the Reprisal HUD draws it (QueryReprisalHud, the same rule ashud_style'sRules.layout). With the HUD's Minimap on, the map button is an unseen square over the minimap's central 80 %, Reprisal'sminimapdeadzone; with it off, the map button's top left goes to theminimap_buttonpoint under the bars (15 px right of the bars group's top centre, 90 px below 40 % of its height), clear of the compass. Which of the two applies follows the HUD's Minimap option: the Reprisal HUD hides the game's compass and draws its own, so the compass flag no longer tells them apart (before, the map button was always the unseen one and sat as a fixed circle below and left of the minimap, over the trackpad). - Move stick. Radius 70 (phone 150), per-axis 10 % inner deadzone, no outer one, exponent (15 − sensitivity)/10 (1.0 at the default 5), the output truncated to 16-bit steps, the knob held at the rim. A touch within the radius takes it where it rests; otherwise, after the buttons and the trackpad have declined the touch, one anywhere in the floating zone (from 240, phone 440, left of its centre, a third of the canvas wide) moves it to the finger.
- Camera. The trackpad covers the right two-thirds and takes one touch. It averages the last
three moves, sums them and the speeds, and once a frame gives Σ × π/50 × s × (speed/200)^p,
speed held to 1–1000 canvas units a second, then × 12.5 across and × 15.625 down. s and p come
from
touch_trackpad_sensitivityandtouch_trackpad_acceleration(0–10, default 5, as the game options). Finger times are the SDL events' own, to the microsecond (whole milliseconds made each move's speed jump by up to a quarter on a 120 Hz touch panel). Virtual look stick gives Joystick-Style: the fixed camera stick atrightstickmove, with the stick response above. - Buttons. Every release button presses its pad button for 0.1 s on lifting over the button,
whatever the time held; Throw and the binocular zooms are held. Fire follows the behaviour rule
of
0x14ed568: held with a ready firearm or the fibre wire (item type 38) in the right hand, otherwise a release pulse (coin, syringe, detonator, bare hands and other melee items). Crouch toggles the port's sneak on release and after 1.0 s holds crouch instead (ex3, cancels the tap). The inventory button holsters on release and after 0.3 s holds Square for the inventory; leaving the button first calls the hold off. The Instinct button is a release toggle of the Instinct mod's binding, kept through the pause menu, the inventory and the lists, and dropped for the map, cut sequences and death. - Action Area. A touch that no button took (trackpad, stick or neither), which moves at most 20 pixels and lifts within 0.5 s, performs Hitman's action (Cross), or, when his action is none, place or retrieve, picks up (Circle).
- FeralClaw. Three fingers whose centroid moves 20 pixels (the pan begins), and is 50 or more from where they landed when the first lifts within 0.2 s of that, press Start. The fingers keep working their controls; the weapon-panel zone and the port's three-finger tap are gone.
- Scenes and rules. Peephole (only the camera control), binoculars, scope, closet and default scenes show Reprisal's lists. Reload shows only with a firearm, spare clips and room in the clip; Fire is one button pair whose icon follows the item (coin, cartridge, syringe, fist); Disguise and Place/Retrieve have their buttons when the action is a disguise, a place or a retrieve; Throw needs a throwable that is neither a coin nor a gun; dragging a body hides the inventory, crouch and view buttons; with Lock-on aim assist the left Fire button shows only in first person and the scope; the map button shows only without the minimap.
- Editor. Scale ±10 % in 50–200 %, opacity in 5 % steps from 5 % (as a multiple of the
button's opacity), nudges of 2 canvas units, a delete button for the selected control, the tray
to add controls back, and for either stick the Joystick Options: inner and outer deadzones in
10 % steps to 40 %, sensitivity 0–10, invert X and Y (
touch_move_stick,touch_look_stick).
What still differs:
- The controller elements reach the game through
feraltouch.cfg, which is encrypted. The port maps each button to its PS2 pad button: Pause Start, Journal Select, Map L2, Drop Triangle, Place/Retrieve and Disguise Cross (they perform the listed action), Reload R2, inventory Square, pickup Circle, Fire R1, view R3, crouch the sneak latch on L1, the zooms D-pad up and down. Closing the binoculars presses Square, the port's way out; the scope's zoom toggle steps D-pad up, then down. Throw keeps the port's held L3 (Reprisal's throw mode is not in the touch path), and with several pickups the pickup button holds Circle to open the game's list (Reprisal opens its wheel). The pickup-menu layout places Confirm and Cancel; the port's list needs its Up and Down buttons, set where that layout's stick is. - The trackpad's scale into the camera is in
feraltouch.cfg: the port multiplies the axes by 0.022, which turns a slow drag at the default levels as far as its earlier look did. The lock-on target switch by a trackpad flick is not done. - Unresolved points keep the port's behaviour: the floating zone and the trackpad are mirrored in left-handed layouts; the minimap opens the map from an unseen button over it (its deadzone); a touch on the stick or the camera stick can tap the Action Area, a button's cannot, and a tap counts while another finger holds a control. The Action Area's pickup does not test for a gazed object (Reprisal's G), which lives in the gaze code; any pickup in the list counts.
- Which input shows. Reprisal picks its input mode when devices are added or removed
(
0x14e99c8, JavaFeralInputDeviceDetector), not from the last device used: any connected controller (a handheld's built-in pad included, unless its vendor id is 0) gives pad mode and hides the pad overlay, unlessForceTouchControlsis on;DisplayControlsPromptasks which to prefer when a device appears. The port's Touch controls option does the same: Automatic hides them while a controller is connected (and while a keyboard or mouse is in use, until the next touch), On isForceTouchControls. There is no prompt, and with On the pad still works alongside. Reprisal's touch mode clears the "pad game" flag; the port keeps it set, since its virtual stick reaches 47 through the pad. - Rules that need flags the port does not have: the movement states that hide Fire, crouch, view and inventory, the hideout (journal and map), Instinct's block, the zoom flag of the binoculars, the new-intel journal icon, the skip-death button (the port's death screen keeps its own), and Fire's throw-aim, detonate and strangle prefixes.
- The fades, haptic envelopes, sounds and the
VCPPreviewPadpreview are not reproduced; the port keeps its own haptics and opacity option. Stick options and the layout choice are global, not per preset, and scale and opacity apply to every scene a button appears in. - The port clamps controls into the window's safe area.
Unresolved¶
- The contents of
feraltouch.cfg, so the exact game action behind each controller element. - The setters of several context flags (disguise, place, retrieve, inject, detonate, strangle, binocular zoom, scope ×2, skip death) and the movement-state ids that hide Fire, crouch, view and inventory.
- The effect of the stick options' tap-action toggle and of
EnableVCPDebug. - Whether the floating zone of the move stick is mirrored with the stick in left-handed layouts
(the x offset of
initialrangeis not negated in the code read). - The exact element ordering rule (priority sort) in the dispatch, and whether a touch claimed by a VCP element still produces gesture events (taps for the Action Area).
- How a tap on the minimap opens the map, and the source of the inventory's left/right swipe.
- What the FeralClaw request does exactly (pause menu inferred), and the effect of
AlwaysDetectFeralClaw. - The flick recogniser's algorithm (unused by Hitman).