Skip to content

Stop medics and techs waiting forever for a patient they cannot reach - #189

Open
akacross wants to merge 3 commits into
themuffinator:mainfrom
akacross:fix/medic-unreachable-patient
Open

akacross wants to merge 3 commits into
themuffinator:mainfrom
akacross:fix/medic-unreachable-patient

Conversation

@akacross

Copy link
Copy Markdown
Contributor

Refs #184.

Problem

Once a medic or tech picks the player to heal (rvAIMedic::TakePatient), it becomes passive and ignores enemies, and State_Medic's approach stage only ends beside a patient it can see. If it can see the player but never reach them, it stays in that stage indefinitely, re-pathing in place. Combat can't break it out, and nothing times out. The original Raven DropPatient already notes //FIXME: what if they stay in this state?.

This matches #184: right after hangar1's lift, the script calls $elgar.enableHeal() on Tech Li just before giving him his exit tether. A player with low armor (10 in the report's screenshot) becomes his patient.

Fix (SP and MP, identical)

  • ai_medicApproachTimeout (default 15 s, 0 disables): an approach that sets no new best distance to the patient for that long is abandoned. The medic leaves through the existing bail-out path (StopMove, DropPatient, post-heal script) and logs a warning.
  • Progress means closing the distance, not moving. A medic circling beneath a patient it can't reach moves constantly without getting closer.
  • Cooldown: automatic heals are held back for the same period, so the medic doesn't grab the patient again a second later. A heal the player asks for (TalkTo) isn't held back.
  • No save-format change: the watchdog fields are transient and reset on restore.

Testing

Runtime on Linux x64 (Wayland, OpenGL, retail assets), hangar1:

Scenario 0.14.000 This branch
Tech Li, heal enabled, armor 10, player he can see but not reach (in noclip about 90 units above the floor) Circles beneath the player in State_Medic for the whole 81 s run At 15 s: medic 'elgar' made no progress toward 'player1' for 15 seconds (distance 92); giving up on the heal for now, then State_Combat → State_Passive
Post-lift sequence, armor 10, player across the platform Heals in about 4 s, then walks to his tether Same; no watchdog warning
  • tools/tests/ai_medic_approach_watchdog.py (new, wired into both workflows and openq4_validate.py) checks:

    • SP/MP parity;
    • that the watchdog runs first in the approach stage;
    • the bail-out path;
    • that only automatic heals are held back;
    • that nothing new is serialized.

    It fails on main and passes here.

  • validation_hardening.py passes.

Not verified

Side note: on current main, a startup +map … on the command line leaves the client at the main menu, while the same map command run from a config file loads normally. I tested through +exec instead; that's unrelated to this change.

🤖 Generated with Claude Code

rvAIMedic::TakePatient makes the healer passive and blind to enemies, and
State_Medic's approach stage ended only beside a patient it could see. A
player it could see but never reach therefore held it in that stage for
good, re-pathing in place; issue themuffinator#184 reports Tech Li standing at the edge of
hangar1's lift until the player came back. The original Raven DropPatient
already asked "what if they stay in this state?".

ai_medicApproachTimeout (15 s, 0 disables) abandons an approach that sets no
new best distance to the patient for that long, through the existing
DropPatient and post-heal-script path, and holds back automatic heals for as
long again. Movement alone is not progress: a medic shuffling beneath a
patient it cannot reach moves constantly without closing in. A heal the
player asks for (TalkTo) is not held back. The watchdog fields are transient
and stay out of the save. SP and MP are identical, and
ai_medic_approach_watchdog.py keeps them so.

On hangar1, with Tech Li held beneath a player he could see but not reach,
0.14.000 left him in State_Medic for the full 81-second run; this build gave
up after 15 s and he returned to his orders. A normal heal on the lift top,
armor 10 with the player across the platform, still completes in about four
seconds before he walks to his tether.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@themuffinator themuffinator added bug Something isn't working priority: P1 Functional or qualification gap in intended scope; no release-date promise. status: blocked by CI Required validation is incomplete or failing; inspect linked run evidence. labels Oct 18, 2026

@themuffinator themuffinator left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current SP/MP diff and its integration with TakePatient, DropPatient and State_Medic. The timeout exits through the existing cleanup/post-heal path, the cooldown applies only to automatic patient acquisition, and the transient fields do not alter the save layout. I found no additional blocking source issue in this revision.

The reported Linux unreachable-patient and normal post-lift runs are useful scoped evidence. I have not independently run gameplay. Keep #184 open until its exact reported state or a supplied save confirms progression; the synthetic unreachable-patient test does not prove that report resolved.

CI run 39136341682 failed before platform validation at the unrelated clipboard test-double error. #190 is now merged and the subsequent atlas math include is repaired on main in 80060cc. I am updating this branch from main to obtain fresh checks. Merge remains pending completed CI; skipped platform jobs do not count as passes. Roadmap ownership: Q4-02.

…-patient

# Conflicts:
#	docs/dev/release-completion.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: P1 Functional or qualification gap in intended scope; no release-date promise. status: blocked by CI Required validation is incomplete or failing; inspect linked run evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants