Written for the PreyVR / motion-controls effort by Vittorio "Vee" Romeo, September 2026. Everything below was learned while building three DLL mods on the Chairloader framework and is offered freely (the mods are MIT):
- Viewmodel Tweaks & Ironsights - https://github.com/vittorioromeo/Vee.ViewmodelTweaks - moves the weapon and first-person arms to arbitrary camera-relative poses (hip offsets, ironsights lock, sway, recoil, FOV control). The most VR-relevant one: it is, in effect, "place the weapon and hands where I say, every frame".
- Mediumcore Death - https://github.com/vittorioromeo/Vee.Mediumcore - death rework, inventory, saves, traumas, signals.
- Simulation Rollback - https://github.com/vittorioromeo/Vee.SimulationRollback - save/load by name, voice lines, subtitles, Bink videos, post effects, HUD drawing.
Each repository has a DEVNOTES.md with more detail and the source is small enough to read in one sitting.
This document collects the parts most likely to matter for a VR conversion and the traps that cost us crashes.
It is written to be pasted into an LLM's context as well as read by a human; sections are self-contained.
Build targeted: Steam Prey 1.0.1.0 as patched by Chairloader to the EGS 2021-08-18 PreyDll.dll (the
only build Chairloader supports; Chairloader replaces the Steam DLL with it). All RVAs are into that
PreyDll.dll unless stated. PreyDll.dll is monolithic: CryEngine (system, renderer, entity system, action,
audio ATL) and the game code are one module; Prey.exe is a thin launcher.
- https://github.com/thelivingdiamond/Chairloader - mod loader with a PDB-derived SDK (
Common/Prey/**/*.h), hooking (PreyFunction<Sig>(rva).MakeHook()+SetHookFunc,InvokeOrig), ImGui overlay (F1), cvar persistence (REGISTER_CVAR2withVF_DUMPTOCHAIR->Mods/config/Chairloader_CVars.xml), a hot-reload cycle, andChairManager/PreyFiles/= the game's paks extracted (XML data, localization, levels). Mods arePrey/Mods/<Name>/{ModInfo.xml, <Name>.dll}. - The SDK headers are generated from Arkane's PDB, so class layouts, member offsets and static/member function RVAs are almost always right. Interface vtable orders copied from stock CryEngine are not always right (section 3).
- Mod lifecycle hooks and where they run:
UpdateBeforeSystemfrom aCGame::Updatehook before the original;MainUpdatefrom aCSystem::Updatehook after the original;LateUpdatefromCCryAction::PostUpdate(HUD drawing goes here);Drawinside the ImGui frame. - Unregister your cvars in
ShutdownSystem(IConsole::UnregisterVariable(name, true)for your prefix); the console keeps raw pointers to name/help/storage that vanish with your DLL and touches them at engine shutdown (crash on exit otherwise). - The F1 GUI shows the hardware cursor, so
CHardwareMouse::m_iReferenceCounter > 0also fires for it; checkgCL->gui->IsEnabled()before treating a visible cursor as "game menu open".
- Ghidra headless is fast enough to decompile single functions on demand:
analyzeHeadless <proj> <name> -process PreyDll.dll -noanalysis -postScript <script>with a script that takes0x18XXXXXXX Namelines,disassemble()+CreateFunctionCmd, thenDecompInterface. The SDK'sPreyFunctionRVAs are your entry points;0x180000000is the preferred image base. No RTTI names survive in the binary, so find vtables via the constructor'slea rax, [rip+vtable]. - capstone + pefile for quick disassembly around an address and for dumping vtables / strings.
- Crash triage:
Game.logprints the call stack as raw addresses. Map them to modules with the module list of the minidump (error.dmpin the Prey root, MINIDUMP module stream), symbolize your own frames withllvm-symbolizer --obj=<your.dll> --relative-address <rva>against your PDB, and disassemble the game's frame around the return address (the instruction before it is the call). - Cross-compiling on Linux works: clang-cl + lld-link against copied MSVC/Windows SDK headers (the official
route is VS2022 + CMake + vcpkg). clang-cl matched the MSVC ABI in every case we checked, with one
miscompile (section 3,
Draw2dLabel). - Struct offsets in the SDK can be checked at compile time:
template<int N> struct Probe; Probe<offsetof(T, m)> p;with-fsyntax-onlyprints the value in the error.
- Random
EXCEPTION_STACK_OVERFLOWinJobSystem_Workerthreads inCParticleContainer::UpdateParticles(a largeallocafor particle sorting). Worker threads inheritPrey.exe's default stack size (SizeOfStackReserve= 1 MB). Patching the PE header to 8 MB (and zeroing the checksum) removed the crashes. A VR build that pushes more particles per frame may hit this sooner.
- Struct returns > 8 bytes (
QuatT,std::vector,std::pair, ...): for member functions the hidden return pointer comes afterthis:R* fn(T* _this, R* _ret, args...). Several SDK headers declare these as returning the struct directly (ArkItemSystem::GiveArchetype,IEntity::CreateProxy, ...); declare your ownPreyFunctionwith the real layout. - 8-byte structs with a user-declared constructor (
ArkBinkPlayerHandle) are returned through a hidden pointer (MSVC rule: no user-defined ctor/dtor/copy for register return) but passed by value in a register (they are still trivially copyable). Handle both when calling through raw function pointers. PreyFunctionobjects are rebased at DLL init. A function-localstatic PreyFunctionis constructed too late and calls the raw RVA. Keep them at file/class scope.- The SDK's
physinterface.his stock CryEngine; Prey's physics structs are bigger.pe_status_livingis 152 bytes in Prey (an extraVec3aftervelGround,groundSurfaceIdxat +0x64 not +0x58) vs. 136 in the header.GetStatus()into a header-sized stack local silently overwrote the caller's savedxmm6(our framedt), producing wrong smoothing with no crash. Rule: every struct the game fills in (pe_status_*,ray_hit,SLocalizedInfoGame, ...) gets Prey's layout when known and a generous pad after it regardless. - Prey added parameters to some engine functions.
ILocalizationManager::LocalizeString(const char*, wstring&, bool bEnglish, void** pOutHolder)has a 5th out-pointer the header lacks; leaving it to the stack garbage made the game write through it.IEntityAudioProxy::ExecuteTrigger(trigger, ELipSyncMethod, proxyId, callbacks)likewise has the CE 3.8 lip-sync parameter. IRenderAuxGeom::Draw2dLabel(..., fmt, ...)(inline variadic wrapper in the header) was miscompiled by clang-cl at one call site: theva_listpointed at the argument's bytes instead of its slot. CallRenderText(Vec3, SDrawTextInfo&, "%s", va_list)yourself withconst char* p = text; (va_list)&p.
Verified by decompiling the game's own callers. Where the header is wrong, call by byte offset
(((R(**)(void*, Args...))*(void**)obj)[off/8](obj, args...)).
| Interface | Header | Real slots (byte offsets) |
|---|---|---|
IGameFramework |
two virtuals short in places | +0x120 GetISubtitleManager, +0x1D8 GetArkSaveLoadSystem (then +0x08 GetCampaignSlot), +0x298 SaveGame(path, quick, immediate, reason, ignoreDelay, checkpoint), +0x2A0 LoadGame(path, quick, ignoreDelay). IsGameStarted/IsGamePaused/GetLevelName via the header are fine. |
IEntity |
two spurious virtuals at the front (SetLocalSeg/IsLocalSeg); GetId is really slot 1 |
+0x08 GetId, +0xE8 GetWorldTM, +0x210 CreateProxy(type) -> shared_ptr via hidden ptr. Prefer CEntity::FGetProxy (0x904D50) / FCreateProxy (0x903540) statics from CryEntitySystem/Entity.h (that class header is PDB-derived and correct). |
ILocalizationManager |
two slots low | +0x80 LocalizeString(const char*, wstring&, bool, void**), +0x98 GetLocalizedInfoByKey(key, SLocalizedInfoGame&). ISystem::GetLocalizationManager (+0x4A0) via header is fine. |
IRenderer |
two slots high at the tail | +0x898 GetIArkBinkManager(). Everything we used before that (GetWidth/GetHeight, SetState, Draw2dImage, GetWhiteTextureId, GetIRenderAuxGeom) matched. |
IEntityAudioProxy (CEntityAudioProxy vtable @ 0x181d28e08) |
order differs | +0xA8 CreateAuxAudioProxy(bool) -> id, +0xB0 RemoveAuxAudioProxy(id), +0xD8 ExecuteTrigger(trigger, lipSync, proxyId, const SAudioCallBackInfos&), +0xF8 SetEnvironmentAmount(env, amount, proxyId), +0x120 SetObstructionCalcType(type, proxyId). Entity audio proxies wrap IAudioProxy objects from IAudioSystem::GetFreeAudioProxy() (+0x98). |
IAudioSystem, ISystem, IArkBinkManager, IArkDialogAudioManager, IRenderAuxGeom, ISubtitleManager, IAnimationOperatorQueue, ISkeletonPose, IDefaultSkeleton, IAttachmentManager, IAttachment |
match | (slots we relied on are listed where used below) |
Prey kept Crysis 3's first-person setup. The order of operations per frame matters for anything that wants to put the camera or the weapon somewhere else:
ArkPlayerCamera::PrePhysicsUpdateupdatesm_rotation(viewAng3: pitch = x, yaw = z) from input and smoothsm_leanAmount(10/s).- The first-person arms character is animated (mannequin).
CProceduralWeaponAnimationContext::Update(0x17D4D50) callsCProceduralWeaponAnimation::Update(dt)(0x17D31E0), which blends the weapon's authored pose offsets, look/strafe sway, recoil, bumps and zoom into two view-spaceQuatTs:m_rightOffset(this+0x2D8, weapon hand) andm_leftOffset(this+0x2F4, support hand). The context rotates them into the aim frame (Quat::CreateRotationVDir(aimDir)) and pushes them additively onto the hand IK joints through anIAnimationOperatorQueuepose modifier (joint index atctx+0x18; queue slots 8/9 = push position / orientation witheOp_Override=?/eOp_Additive=3). Some mannequin fragments (jump/land) have no weapon procedural clip; the context early-outs onm_instanceCount < 1and nothing is applied (the weapon snaps back) - we hook that function and force the count to 1. - The camera is built from the skeleton, not the other way round.
ArkPlayerCamera::UpdateView(0x145ED50) ->GetDesiredPositionAndRotation(0x145C530) reads the#cameraattachment of the arms character (IAttachmentManager::GetInterfaceByName= vtable+0x38,IAttachment::GetAttModelRelative=+0x68), rotates it by the entity rotation, and combines view angles with lean roll (m_leanAngle * m_leanAmount). The position is returned relative to the entity because the arms render in camera space (ENTITY_SLOT_RENDER_NEAREST;CView::Updateadds the entity position). Nothing touches the skeleton between this call and rendering -> post-hookingGetDesiredPositionAndRotationis the last moment to override camera and/or weapon transforms consistently. For VR: this is where an HMD pose can replace the game's camera while the arms still follow. - The weapon is not rendered from its own entity.
CArkWeapon::AttachToHandbinds the weapon's character as a skeleton attachment (CSKELAttachment) of the arms and clears the weapon entity's render flag; it is drawn atarmsWorldMatrix * CAttachmentBONE::m_AttModelRelative(aQuatTatattachment+0x130;GetAttModelRelative()returns a reference to it, so it can be written directly).CArkWeapon::m_pAttachmentis at+0x2B0. Muzzle flash / projectile origin are attached to the weapon bone, so moving the weapon moves the shot origin too. - Hand joints follow via the final absolute pose buffer
ISkeletonPose::GetAbsJointByID(slot 24) returns by reference - the skinning reads it at render time, so you can rigidly move the weapon-hand subtree (and the support hand when it is near the weapon) after step 3. Hierarchy:IDefaultSkeletonGetJointCountslot 1,GetJointParentIDByID2,GetJointNameByID6,GetJointIDByName7; the weapon hangs offr_handProp_jnt(child of the right hand joint).
What the Ironsights mod does with this (directly reusable for motion controls, replacing "aim pose" with "controller pose"):
- Skeleton side, after the context pushed its operators: push
eOp_Additiveposition/orientation for the weapon-hand IK joint so the hand lands oncamera(model) * pose * (weapon relative to IK joint)^-1. Uses the previous frame's camera + this frame's mouse delta (the camera is not final yet). UsingeOp_Overrideinstead kills the authored fire/reload hand animation; additive keeps it, and the game's own frame-old additive is subtracted back out to recover the pure animation (used to extract the recoil kick). - Render side, in the
GetDesiredPositionAndRotationpost-hook: writem_AttModelRelative = camera(model) * poseand move the hand joint subtree by the same rigid delta. Deterministic, no filtering -> no jitter. Everything read from the game is checked for finiteness / near-unit quaternions; accumulated state is reset on bad numbers (Ang3(Quat)in CryMath uses an unclampedasin). - Per-weapon poses keyed by
IEntityClass::GetName()of the equippedCArkWeapon.
Other pieces around the pipeline:
- Near FOV. The arms/weapon render in the "nearest" pass with their own FOV in
r_DrawNearFoV(EFQ_Set/GetDrawNearFov).ArkPlayerZoomManager::Reset()/SetNearFOVUnlocked()hard-code 55 deg andArkPlayerZoomManager::Update()rescales it while zooming - agame.cfgvalue never sticks; re-apply per frame after the game's update. Camera FOV:ArkPlayerZoomManager::SetDesiredHFOV(hfov, time, false, high)/ClearDesiredHFOV;cl_hfovis the base. - Player state useful for gating:
ArkPlayer::GetInstancePtr(),m_stance(STANCE_SNEAK= crouch),m_bInTrackview(scripted sequence / cutscene),ArkPlayerMovementFSM::IsSprinting()(0x1570580) /IsInZeroG()(0x1570370),ArkPlayer::IsInCombat()(0x15514A0: list of NPCs fighting the player is non-empty),ArkPlayerAwarenessComponent::m_awarenessStates(VectorMap<EntityId, {m_level: EArkAttentionLevel unknown/noticed/curious/interested/known}>), velocity frompe_status_living::vel(see the size trap). - Weapon state (
CArkWeapon):m_bIsReadyToAttack@+0x48B(cleared for select, reload and every shot),m_bIsReloading@+0x48C,m_bIsUnequipping@+0x48D,m_condition(0..100),CArkWeapon::FireWeapon(0x16659B0) is the shot event for every weapon.ArkPlayerWeaponComponent:m_equippedWeaponId,m_toBeEquippedWeaponId@+0x64,m_bIsUnequipping@+0x78. The draw animation has a window where the arms are not yet valid for overrides - we gate on ready + a minimum delay after the equipped id changed (0.75 s worked for all weapons). - Procedural offsets you may want to keep or kill:
CRecoilOffset/CBumpOffset/CLookOffset/CStrafeOffset::Computecan be hooked to capture (and scale) what the game adds. - Time:
gEnv->pTimer->GetRealFrameTime()for real time;GetAsyncTime()as int64 ticks for a clock that does not freeze in menus.ITimer::GetFrameTime()is scaled/paused game time.
- Mod key bindings: an
IInputEventListenerregistered withgEnv->pInputreceives raw events; events are not delivered while a cursor is on screen, which is the behaviour you want for gameplay binds. - Action maps: the UI enables/disables the
"UIInput"action map throughCUIManager(theArk:BinkMovieflow node callsGetActionMap("UIInput")thenEnable(true)after a movie). - Reticle:
hud_reticleSetting(SCVars+0x930; 0 off, 1 default, 2 dot) is what the options menu writes; its only readers are 4 sites inCArkUIHUD; at 0 the HUD getsreticleDisplay("none")andinteractIconDisplay("none"). - In-world screens use the HUD reticle as the cursor:
ArkExaminationMode::UpdateReticlePos(0x157EBA0) movesm_reticlePos(+0x60) and sendsreticlePositionto the HUD. State:ArkPlayer::m_examinationMode.m_examinationState != inactivewithm_examinationType == worldUI. For a VR laser pointer this is the hook: feed your own screen position into that path. - The HUD is Scaleform Flash (
IUIElement, events likereticlePosition,subtitleUpdate,audioLogUpdate), reached throughCGame::m_pUIManager(CUIManager::GetUIEventSystem("<TypeName>")returns the game-side event system object, e.g."ArkSubtitleHandler").
- Full-screen quad / fades:
IRenderer::SetState(GS_BLSRC_SRCALPHA | GS_BLDST_ONEMINUSSRCALPHA | GS_NODEPTHTEST)thenDraw2dImage(x, y, w, h, GetWhiteTextureId(), 0,0,1,1, 0, r,g,b,a, 1), coordinates in an 800x600 virtual space, fromLateUpdate. - 2D text:
IRenderAuxGeom::RenderText(see trap 6);SDrawTextInfo.flags = eDrawText_2D | eDrawText_800x600 [| eDrawText_Center]puts positions in the same virtual space; size ~12 virtual px per unit. Chairloader replaces the engine's aux geom (CAuxGeomCB), all of this goes through it. - Post-process parameters:
I3DEngine::SetPostEffectParam(name, value, force)with names fromArk/VisualEffects/ArkPostEffectParams.xml:VisualArtifacts_Vsync/VsyncFreq/Interlacing/InterlacingTile/ Pixelation/Noise/SyncWaveFreq/SyncWavePhase/SyncWaveAmplitude,FilterArtifacts_ChromaShift/Grain,Global_User_Saturation/Contrast/Brightness,FilterBlurring_Amount,ArkPostAliens_Glitch,AlienInterference_Amount. Set every frame while active; reset afterwards. (For VR you will probably want to disable several of the game's screen-space effects; the same parameter names apply.) - Named game post effects:
Ark/VisualEffects/ArkPostEffects.xml(64-bit ids),CGame::m_pArkPostEffectManager->EnableEffect(id)/DisableEffect(id, blendOut). E.g.Player_EndGameVRTermination= 14610450286789593543 (gamma-to-black then white-out),Player_Fatality= 12635110349617286617,Player_NearDeath= 2428940965280750461. - Bink movies:
IRenderer::GetIArkBinkManager()(+0x898);IArkBinkManager::MT_LoadMovie(path, instanceId, type 1 Fullscreen/2 Background/3 Texture, flags 1 AutoStart|2 Looping)[slot 3, handle via hidden pointer],MT_ReleaseMovie[4],MT_StartMovie[5],MT_StopMovie[6],MT_IsMoviePlaying[8]. Fullscreen movies are composited by the renderer over the frame - relevant if you need to intercept them for a stereo view. Files inGameSDK/Videos/*.bk2(KB2jheader: frame count @+8, w/h @+20/+24, fps @+28/+32).
- Every dialogue line is an ATL trigger
Play_<voiceId><dialogId>(16 hex digits each), defined inLibs/GameAudio/GameMode/Campaign/Voice_<voiceId>.xml; text inLocalization/English_xml.pak: voices/Voice_<voiceId>.xml, names inArk/Dialog/VoiceLibrary.xml. Radio voices' banks are resident, but line media is streamed on demand:IArkDialogAudioManager::Load(triggerId, IArkDialogLoadListener&)(manager:CGame::m_pArkResponseManager->GetAudioManager()) ->OnLoad(id, ok)-> execute;Unloadlater. Executing without loading "plays" silence. - Voice events are positioned 3D sounds; executing on the global audio object (no position) is silent.
Radio calls go through
ArkDialogPlayerTranscribe::SetEntity(0x13F8A50): aux audio proxy on the player entity, audio environment"Transcribe"(IAudioSystem::GetAudioEnvironmentID) at 1.0 = the radio filter, occlusion ignored,ExecuteTrigger(trigger, lipSync=1, auxProxyId, callbacks). ArkAudioTrigger::Load(name)/Execute(IEntity*)(Ark/ArkAudioUtil.h) is the simple path for SFX;Execute(nullptr)pushes anSAudioRequest{flags, objectId 0, ...}with data{vtable, eART_AUDIO_OBJECT_REQUEST=3, eAORT_EXECUTE_TRIGGER=0x10, triggerId, float 0, lipSync}(the SDK lacksSAudioObjectRequestData). TheIAudioSystemheader vtable matches the binary (PushRequest+0x18,GetAudioTriggerID+0x40,GetAudioEnvironmentID+0x68,GetFreeAudioProxy+0x98).- For VR: the listener is the camera; moving the camera to the HMD through the camera path above keeps audio consistent. Hand-held weapon sounds are attached to the weapon bone (moves with your override).
The game's path (ArkDialogSubtitleManager::ShowSubtitlePart, 0x11B4BF0): text from
ArkDialogSubtitleManager::GetSubtitle(dialogId, voiceId, SLocalizedInfoGame&) (0x11B44B0; localization key
"%llX_%llX" = dialogId_voiceId, fallback "%llX"), formatted "<font color='#FFDF80'>%ls%ls</font> %ls"
(speaker, @ui_SubtitleNameSeperator, text), shown by ArkSubtitleHandler::ShowSubtitle(wstring, bMetaGameMenu) (0x1632330 -> Flash subtitleUpdate) and removed by HideSubtitle (0x1631C70). Handler:
CUIManager::GetUIEventSystem("ArkSubtitleHandler") (static_cast from the returned IUIGameEventSystem*,
which is at +8). Bink subtitle timings: Ark/Dialog/BinkSubtitles/<movie>.xml (frame numbers).
- Health reaching 0:
ArkPlayerHealthComponent::DoDeath()(0x155E420) holsters, sets the death movement state and camera, armsm_timeRemainingBeforeDeathMenu.ArkPlayerHealthComponent::Update()(0x155F4A0) is the only place that opens the death menu; skipping the original whileIsDead()keeps it shut with no side effects (m_bDeathMenuOpenedsays if the game got there first). ArkPlayer::Revive()(0x1556B80) is the dev "Revive" button: reloads the player model, re-attaches the weapon, resets the FSM and health.ForceKill()(0x155E530) for testing. Scripted deaths haveArkPlayer::m_bInTrackviewset.- Health changes:
ArkPlayerHealthComponent::SetHealth(0x155EFE0); consumable/operator effects arrive as signals inArkPlayerSignalReceiver::OnReceiveSignal(0x1575690); psiCArkPsiComponent::IncrementPoints(0x157FFD0); traumasArkPlayerStatusComponent::GetTraumaForStatus(status)->ArkTraumaBase(IsEnabled,Activate(level)),ReduceStatus(signalId, amount)(0x14631A0); suit integrity is theSuitIntegritytrauma. - Inventory: items are entities -
ArkInventory::GetItemIDs(),ArkItemSystem::GetItem(id),CArkItem::Drop(count, const Vec3*)(0x10B0D40),RemoveFromInventory(),IArkItem::ResetCount(n),CArkItem::InitializeCount(0x10B3600) for spawn counts,ArkFabricator::SpawnItem(0x1166DE0),ArkItemSystem::GiveArchetype(returnsstd::vector- see trap 1). - Level entrances are
SpawnPointentities (Properties.destinationName = "From_<Level>");ArkGame::OnLevelTransitionFinished()(0x116F1A0) fires after a transition placed the player;ArkGame::OnLevelToLevelTransition(0x116F190) at its start.
ArkGame::SaveToSlot(const char* name, bool immediate)(0x116FE80, member, bool) is what QuickSave / ManualSave / IronmanSave end in:IGameFramework::SaveGame(name, quick=true, immediate, eSGR_QuickSave(3), false, nullptr)+ appends the name toArkGame::m_savesThisSession[campaignSlot](this+0x50 + slot*0x18). Slot names (manual6,autosave2, anything you like) become folders underSaved Games/Arkane Studios/Prey/SaveGames/Campaign<slot>/<name>/(save.CSF,save.meta, one<level>.levelper visited level, ~2 MB).CanManualSave()(0x116CB40, static) gates F5 (ArkPlayerInput::OnActionQuickSave0x15638A0) and the pause menu Save;CanAutoSave()(0x116CA90) checksg_blockAutoSavethen callsCanManualSave()- a hook on the latter must let calls from insideCanAutoSavethrough. A hidden "ironman" option exists (ArkDifficultyComponent::m_difficultyOptions[0]).- Loading:
ArkGame::LoadLastSave(listener)(0x116EB30) ->IGameFramework::LoadGame(name, quick=true, ignoreDelay=false)(+0x2A0); returneLGR_NoSavesExist(7) from a hook to refuse quietly. F9 =ArkPlayerInput::OnActionLoadLastSave(0x1563460); pause menu screens =ArkPauseMenu::OpenSaveLoadMenu(bool bSave)(0x1370300). Issue loads only fromUpdateBeforeSystem:LoadGameruns synchronously and tearing the level down from the post-CSystem::Updatehook crashed the Chairloader GUI (nullImGui::GetIO()). - Load completion: the player entity survives a same-level save load, so "player gone and back" misses
it.
ArkGame::PostSerialize()(0x116FAE0) runs once at the end of every save load - hook it.ArkGame::OnSaveGame()(0x116F4B0) runs after any save.ArkGame::m_saveFileToLoad(string @+0xD0) holds a pending load. - Play clock:
ArkGame::m_campaignPlayTime(uint64 ms @+0xE8, +1000 per accumulated second viam_campaignTimerAccumulatorfloat @+0xF0) counts active play only and is serialized in saves. - Campaign slot:
IGameFramework+0x1D8GetArkSaveLoadSystem ->+0x08GetCampaignSlot.
ChairManager/PreyFiles/ (Chairloader's extraction of the paks): Ark/ (game data: Dialog/VoiceLibrary.xml,
Dialog/BinkSubtitles/, VisualEffects/ArkPostEffects.xml + ArkPostEffectParams.xml,
Campaign/POILibrary.xml, ...), Libs/GameAudio/ (ATL controls, preloads), Localization/English_xml/
(voices/Voice_*.xml, UI strings), Levels/. GameSDK/Videos/ for Binks. Options the menu writes are cvars
(gameOptions.xml, e.g. hud_reticleSetting).
- A smoothed value that snaps or freezes while the code is right -> the step is garbage -> a callee wrote past a stack struct (trap 4). Look for structs the game fills in.
- A hook that seems to run but the game ignores the result -> check the SDK vtable slot against a decompiled caller (section 3) or the struct-return convention (traps 1/2).
- Crash with a small absolute address (0xC, 0x10) right after a call into the game -> an undeclared out parameter (trap 5).
- Crash in
vsprintfunder Chairloader's aux geom ->Draw2dLabel(trap 6). - Audio "plays" but is silent -> not loaded (dialog manager) or executed on the unpositioned global object.
- A per-frame value read from
ITimer::GetFrameTime()is 0 in menus/pause; use real time for effects. - Text/quads in the wrong place ->
eDrawText_800x600/Draw2dImagevirtual space vs. pixels.
Questions, corrections or requests for specific decompiles: open an issue on any of the three repositories.