Crusader_Decomp/docs/scummvm-crusader-movement-tap-turn.md
Maddo 202679f857 Add comprehensive tests for collision detection, entity dispatch, file system, isometric controls, map rendering, and sorting
- Implemented collision tests to verify overlap and movement logic for collision bodies.
- Enhanced entity dispatch entry tests to cover initialization, group ID management, and process handling.
- Expanded file system tests to include crash diagnostics and ensure proper game data root detection.
- Created isometric controls tests to validate movement requests and screen projection calculations.
- Added map renderer tests to check fixed map loading and rendering functionality.
- Introduced map sorter tests to confirm correct rendering order for various items.
2026-09-25 21:41:20 +02:00

3.4 KiB

ScummVM Crusader Movement Tap-Turn Fix

This note records the ScummVM-side movement fix for Crusader: No Remorse tap-turning while running.

Problem

In ScummVM's Crusader implementation, quickly tapping left or right while holding run/forward could fail to rotate the Silencer. The code already had a pending-turn path for short key taps, but it only applied that path while the last animation was run, combatRunSmallWeapon, or walk.

That left out the start-run animations and the large-weapon combat-run animation. If a left/right tap arrived while the actor was still in startRun, startRunSmallWeapon, startRunLargeWeapon, or combatRunLargeWeapon, the pending turn could be cleared before it was applied.

Decompiled Source Evidence

The exported Ghidra decompilation for retail CRUSADER.EXE shows the original controller treats more than plain run/walk as direction-adjustable movement.

Evidence files:

  • exports/src_remorse/functions/segments/seg_1130/Controller_PickNextAnimByKeyevent@1130_12d6.c
  • exports/src_remorse/functions/segments/seg_1130/Controller_UpdateAvatarAngle@1130_10cf.c
  • exports/src_remorse/functions/segments/seg_1130/Anim_1130_0f94@1130_0f94.c

Relevant behavior:

  • Left and right key events use the 0x11 / 0x12 temporary direction markers, then convert them into one direction step right or left according to the target animation's 8-dir or 16-dir mode.
  • If the controlled NPC is busy, Controller_PickNextAnimByKeyevent still allows a keydown turn to update the active animation direction when Anim_1130_0f94 says the current animation supports direction updates.
  • Anim_1130_0f94 includes Anim_Walk, Anim_Run, Anim_StartRunning, Anim_CombatRun_SmallWpn, Anim_CombatRun_LargeWpn, Anim_StartRun_SmallWpn, and Anim_StartRun_LargeWpn in that supported set.

So the original behavior does not limit tap-turn handling to only the settled run/walk loops. It also accepts direction changes during run startup and combat-run variants.

ScummVM Change

Updated ScummVM file:

  • engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp

The _isAnimRunningWalking helper now returns true for:

  • Animation::run
  • Animation::startRun
  • Animation::combatRunSmallWeapon
  • Animation::combatRunLargeWeapon
  • Animation::startRunSmallWeapon
  • Animation::startRunLargeWeapon
  • Animation::walk

This keeps the existing ScummVM pending-turn design, but widens the eligible animation window to match the original controller's supported movement animations. A quick left/right tap while run-forward is active can now be consumed during run startup or either combat-run variant instead of being discarded.

Validation

Static validation performed:

  • Confirmed the changed symbols already exist in ScummVM's Crusader animation enum.
  • Confirmed the ScummVM change is limited to the Crusader mover helper that gates pending turn application.

Runtime validation still needed:

  • Build ScummVM with the Ultima engine enabled.
  • Start Crusader: No Remorse.
  • Hold run plus forward, tap left/right during run startup and while fully running, and confirm the Silencer rotates one direction step without releasing run/forward.
  • Repeat with weapon-ready combat run when possible, including a large weapon if available.

Notes

The live Ghidra MCP bridge was not reachable during this pass, so the evidence above comes from the checked-out exported Ghidra decompilation under exports/src_remorse/ rather than a fresh live decompile.