Skip to content

Hueycoatl: tail facing and hidden while sunk, per-target head attack animations (#3558) - #6622

Merged
UnhealthyKraken merged 4 commits into
RSPSApp:mainfrom
Bandit-HaxUnit:fix/3558-hueycoatl-tail-head
Nov 23, 2026
Merged

UnhealthyKraken merged 4 commits into
RSPSApp:mainfrom
Bandit-HaxUnit:fix/3558-hueycoatl-tail-head

Conversation

@Bandit-HaxUnit

@Bandit-HaxUnit Bandit-HaxUnit commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #3558 (the remaining parts; the Peek lines and the pet chance were fixed in #3564).

Problem

Server (before) Live (rsprox 4052, 4054, 3399)
Tail facing Spawned and moved with no facing; the client draws a turn-speed-0 NPC at angle 0, so both sides faced south npc face_angle (instant) on every show: 512 out of the east cave, 1536 out of the west
Tail while sunk Only the one-shot disappear sequence, so a player who came into view later saw the idle, raised tail Added drawn as nothing (body customisation model -1); reset as it shows; hidden again 2 ticks after a sink unless it shows on that tick (three -1s for the broken tail)
Head attacks The per-style sequence (and shield variants) in the shared update huey_attack_melee (11669) shared every volley; each target gets npc_anim_specific with the style's sequence (11670/11671, 11673-11675 shielded) and npc_spotanim_specific charge in slot 0
Body caves Reported as missing or misplaced Checked side by side with live in game: they look the same; no change

Fix

  • server/.../npc/NPC.ts, net/PlayerSession.ts, net/protocol/ClientProtocol.ts: a held NPC face angle (NPC.setFaceAngle(angle, instant)), sent as NPC update mask 0x80000 (angle, instant flag) with every update while set, so late viewers get it too.
  • client/game/sync/NpcUpdateDecoder.ts, client/game/OsrsClient.ts: decode the face angle (instant sets the drawn angle as well as the target, the only way to turn a turn-speed-0 NPC); a type customisation model of 0xffff decodes as -1.
  • client/rs/config/npctype/NpcType.ts (npcTypeHasModel), NpcModelLoader.ts, game/scene/SceneRaycaster.ts, render/render/overlays.ts: an NPC with a -1 model is drawn as nothing and can't be clicked, as in the game.
  • runelite-gateway/.../ActorBlocks.kt, EntityMirror.kt: the gateway reads the face angle after the type customisation and passes it on with rsprot's setFaceAngle(angle, instant); before, its three bytes misaligned the rest of the NPC update on RuneLite sessions.
  • server/plugins/bosses/hueycoatl/Fight.Hueycoatl.js: the tail spawns hidden facing west, each show sets its side's angle and resets the customisation, each sink hides it 2 ticks later unless it has shown again (whole, broken, and on the kill).
  • server/plugins/bosses/hueycoatl/Attacks.Hueycoatl.js: Rain Fire plays 11669 for everyone and sends each target its own style sequence and charge spotanim.
  • Shared.Hueycoatl.js: TAIL_FACE, TAIL_HIDDEN_MODELS. docs/hueycoatl.md: the capture facts.

Testing

  • server/tests/hueycoatl-tail-head.test.cjs (new, 4 pass): spawn hidden at 512, shows west at 1536; the 2-tick swap never hides; the broken tail is hidden with three -1s 2 ticks after each sink and shown again at its next show; Rain Fire's shared and per-target packets, shielded and not.
  • client/tests/npc-face-angle-hidden-models.test.ts (new, passes): face angle and -1 models round-trip through the real encoder and decoder; npcTypeHasModel.
  • Neighbours pass: hueycoatl.test.cjs, hueycoatl-camera-reset.test.cjs (31 with the new file), echo-bosses, ides-of-milk-parity, client npc-type-customisation, npc-transparency, npc-headbars, npc-world-view-sync, npc-head-icons, npc-spot-anim-slots. tsc --noEmit clean in client. packet-sender.test.cjs Poc/browser world host #8 (dialogue text resend) fails with or without this change.
  • runelite-gateway ActorBlocksTest (5 pass, 1 new): a block with the type customisation and the face angle decodes both and leaves the stream at the next block; without the decode line it fails.
  • Revert check: with main's production files the 4 server tests and the client test fail.
  • In game (agent MCP + vision screenshots): chain, body, summit, shield; the tail rises west then swaps east on schedule, facing the arena from each cave; a client that logged in mid-cycle saw only the one tail. Body caves checked against live by the user.

Not covered

  • Live turns off the tail's menu ops while it sinks (npc enabled_ops); tsps has no NPC ops packet, so the hidden tail relies on the fight's own checks.
  • The recordings predate the 30 September 2026 update "Fixed Hueycoatl's tail spawning in the wrong orientation"; the angles are the recorded ones.
  • One Rain Fire style per volley for everyone is ours; each recording only shows its own player's.

Reference

  • rsprox recordings 4052 (tail ticks 80-191, head volleys), 4054, 3399.
  • https://oldschool.runescape.wiki/w/The_Hueycoatl
    Self-reviewed with the review checklist at 57ad38b; its notes (the broken tail's model count in the docs, setFaceAngle being for standing NPCs) are addressed in 598346b. Left open: the tests use a fake NPC, so the PlayerSession face-angle line and the client's instant rotation are covered only by the protocol round-trip and the in-game check.

🤖 Generated with Claude Code

Bandit-HaxUnit and others added 3 commits November 23, 2026 11:17
…ile sunk; per-target head attacks

The tail never turns, so live holds it with npc face_angle (instant): 512 out of the east cave,
1536 out of the west. It is added drawn as nothing (body customisation model -1), shown with a
reset, and hidden again 2 ticks after a sink, so a late viewer sees no tail. Adds the NPC face
angle update (mask 0x80000) to the protocol and client, and makes the client draw an NPC with a
-1 model as nothing (no model, no clickbox).

Rain Fire is huey_attack_melee for everyone; each target gets its own style sequence (shielded
variants while shielded) and charge spotanim as npc_anim_specific / npc_spotanim_specific.

Refs RSPSApp#3558 (rsprox recordings 4052, 4054, 3399).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r standing NPCs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Bandit-HaxUnit
Bandit-HaxUnit marked this pull request as ready for review November 23, 2026 11:15
@UnhealthyKraken
UnhealthyKraken self-requested a review November 23, 2026 18:09
@UnhealthyKraken

Copy link
Copy Markdown
Collaborator

Reviewing this now (review loop, head 598346b).

@UnhealthyKraken UnhealthyKraken left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed PR #6622 at 598346b (main 8fd5092, integration tree 4e9b8d23bfdb1d9c462a1f8682818e81e8881bb2).

What it does

Holds the Hueycoatl's tail at a fixed facing (npc face_angle, instant) and draws it as nothing (body customisation model -1) from its spawn and from 2 ticks after each sink until it shows again.
Adds the NPC update mask 0x80000 end to end (server NPC state, session, protocol writer, client decoder, client rotation) and makes the client treat an NPC with a -1 model as not drawn and not clickable.
Rain Fire now plays huey_attack_melee (11669) in the shared update and sends each target its own style sequence and charge spotanim in slot 0.

What was checked

  • Behaviour: the tail spawns at the east tile hidden with angle 512, shows west a tick later with 1536 and a customisation reset. A sink hides it 2 ticks later unless it shows again first (tailShows counter). The broken tail and the kill use the same sink(). No items, coins or persistent state involved. The face angle is resent every update while set, so late viewers get it.
  • Parity (captures): rsprox_transcripts/237/04052.txt: tail added at tick 80 (line 5256) with face_angle 512 instant and body_customisation model -1; tick 81 telejump west, npc_huey_tail_appear_01, 1536 instant, empty customisation (reset); sink 117 and show 119 with no hide; whole tail sinks 153; break and show 155; broken sink 159 then three -1 models at 161; show 183; sink 189, three -1s at 191; knock-out 192. All match the PR and docs. rsprox_transcripts/237/04054.txt: add with 512, show with 1536 (lines 246762-246793). rsprox_transcripts/235/03399.txt: the kill at tick 812 has the tail sink at 812 and three -1s at 814, so the kill path is evidenced too. Rain Fire in 04052 (ticks 51, 73, 88, 103, 118, 133, 148, 163, 174, 185): shared huey_attack_melee with no shared spotanim, plus npc_anim_specific (11669/11670/11671, and 11673-11675 while the head is 14011) and npc_spotanim_specific slot 0 (2968/2971/2974). The shielded and unshielded forms match the code.
  • Parity (Wiki): The Hueycoatl page only says "Fixed Hueycoatl's tail spawning in the wrong orientation" (30 September 2026) and gives no angle. It says nothing about the tail being hidden or about Rain Fire animations. The PR already states the recordings predate that fix; no Wiki conflict.
  • Traced: NPC.setFaceAngle -> PlayerSession (faceAngle: npc.getFaceAngle()) -> npcUpdateMask/writeNpcUpdateBlock -> NpcUpdateDecoder -> OsrsClient (setTargetRot, setRotation). Mask 0x80000 is bit 19, free, inside the third mask byte writeMask already handles; decoder order matches writer order (after TYPE_CUSTOMISATION). setTypeCustomisation(null) sends the 5-cycle reset; {models:[-1]} encodes as 0xffff and decodes to -1. The client modelIds consumers (NpcModelLoader, SceneRaycaster x2, overlays.ts) now go through npcTypeHasModel or skip negatives. Dump: huey_tail_broken (14015) has two models; the PR sends three -1s as live did, and any -1 hides it.
  • Rules: no generated JSON, no plugin config or description change (no world-config-docs needed). A hide and a show scheduled on the same tick resolve to a reset (hide runs first), as the tests assert.

Findings

  1. runelite-gateway/src/main/kotlin/gateway/down/ActorBlocks.kt:146-177 (npc()): the gateway decodes NPC update blocks itself and stops at NPC_TYPE_CUSTOMISATION (0x40000). The server now writes the new FACE_ANGLE mask (0x80000, ClientProtocol.ts:3161: a short angle and an instant byte, :3452-3454). The gateway never reads those 3 bytes. So on a RuneLite gateway session with the Hueycoatl tail in view, they are left in the stream, and every later field and NPC block in that update is misread. This PR does not change the gateway.
    Fix: add NPC_FACE_ANGLE = 0x80000 to ActorBlocks.kt, read u16() then u8() after the type customisation (the writer order), and map it in EntityMirror, or at least consume and drop it. Add a gateway decoder test for a block with the bit set.

Notes, not findings:

  • server/tests/hueycoatl-tail-head.test.cjs:6-7 cites Rain Fire "ticks 61, 79, 96"; the 04052 volleys are at ticks 51, 73, 88. Comment only.
  • A sunk (hidden) tail can still be targeted by the server; live disables its ops. The PR lists this under "Not covered"; fixing it needs an NPC ops packet (shared protocol), so it stays a note.
  • Capture 04052 omits the held face_angle on the tick right after each sink (118, 154, 160, 190); we resend it every tick. Harmless.

Scope

ordinary (it adds a protocol mask and a client NPC rendering rule, but only the Hueycoatl uses either)

Verified

  • yarn build in server/ on the integration commit: ok
  • hueycoatl-tail-head.test.cjs: 4/4
  • hueycoatl.test.cjs: 20/20
  • hueycoatl-camera-reset.test.cjs: 7/7
  • echo-bosses.test.cjs: 7/7
  • Revert check (main's Fight, Attacks and Shared plugin files): hueycoatl-tail-head.test.cjs 0/4; files restored with git checkout HEAD --
  • docs/: yarn install --frozen-lockfile and yarn build (Yarn 1.22.22): build complete
  • Recordings 04052, 04054 and 03399 read line by line as listed above
  • main+head merge tree: clean
  • generated JSON: none edited

Not verified

  • Client tests (npc-face-angle-hidden-models.test.ts, npc-type-customisation, npc-transparency) and tsc --noEmit: the client has no tsx or installed toolchain in this worktree. I covered them only by reading the decoder, writer and consumers.
  • ides-of-milk-parity and the other client neighbours the PR lists were not run.
  • The PlayerSession face-angle line and the client's instant rotation were not exercised live; the tests use a fake NPC, as the PR admits. I traced the path by reading.
  • No live game session; the visible turn behaviour and the late-viewer case rest on the captures and the PR's own in-game check.

Verdict

Await author (1)

The gateway decodes tsps NPC update blocks itself and stopped at the type customisation, so the
new face angle's three bytes were left in the stream and every later field of that update was
misread on a RuneLite session with the Hueycoatl's tail in view. Read the angle and instant flag
after the type customisation and send them with rsprot's setFaceAngle.

Also corrects the Rain Fire ticks cited in the Hueycoatl test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Bandit-HaxUnit

Copy link
Copy Markdown
Collaborator Author

Fixed in 0db0ac5:

  1. Gateway: ActorBlocks.npc() now reads NPC_FACE_ANGLE (0x80000) after the type customisation, as a u16 angle and a u8 instant flag (the writer's order). EntityMirror.applyNpc passes it on with rsprot's setFaceAngle(angle, instant), so RuneLite sessions turn the tail as well as staying aligned. New ActorBlocksTest case: a block with both fields decodes both and leaves the reader at the next block. It fails with the decode line removed (5/5 pass with it). The hidden model needs no gateway change: it arrives as 0xffff and rsprot writes it unchanged, which the native client reads as -1.

Notes: the test's Rain Fire ticks now read 51, 73, 88. The sunk tail's ops and the held angle's resend cadence stay as noted (no NPC ops packet; resending every tick is a superset of live).

@UnhealthyKraken
UnhealthyKraken self-requested a review November 23, 2026 21:21
@UnhealthyKraken

Copy link
Copy Markdown
Collaborator

Reviewing this now (review loop, head 0db0ac5).

@UnhealthyKraken
UnhealthyKraken dismissed their stale review November 23, 2026 21:28

The gateway finding is fixed at 0db0ac5 (see the new review).

@UnhealthyKraken UnhealthyKraken left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed PR #6622 at 0db0ac5 (main 093d8ab, integration tree 04c79aeacec8ae0a5d534b38a3748603fe6276c2).

Prior review: #6622 (review) on the earlier head

Prior findings

  1. Gateway ActorBlocks.npc() stopped at 0x40000 and did not read FACE_ANGLE 0x80000: resolved. runelite-gateway/src/main/kotlin/gateway/down/ActorBlocks.kt now reads u16 angle then u8 instant after the type customisation, and EntityMirror.kt passes it to setFaceAngle(angle, instant). The order and widths match the server writer (writeNpcUpdateBlock: type customisation, then shortBE angle and a 0/1 byte).

What it does

Adds a held NPC face angle (update mask 0x80000) end to end: server, web client, RuneLite gateway. The Hueycoatl tail uses it to face the arena from each cave, and is drawn as nothing (model -1) from its spawn until it first shows and from 2 ticks after each sink until it shows again. Rain Fire now plays 11669 for everyone and sends each target its own style animation and charge spotanim.

What was checked

  • Behaviour: tail spawn, show, swap, break, final-phase sinks and the kill path in Fight.Hueycoatl.js. The hide timer is guarded by a show counter and isRegistered(), and runs on the fight's generation-checked scheduler, so a reset drops it. A hide and a show on the same tick end in the reset state either way. The held angle is resent every tick (as live does), and only the Hueycoatl tail sets it.
  • Parity (recordings, checked line by line):
    • rsprox_transcripts/237/04052.txt: add at tick 80 (line 5256) with face_angle 512 instant and model -1; show at 81 (5319) west with 1536 instant and a customisation reset; face_angle resent every tick while shown (82, 83); whole-tail swap 117 sink / 119 show east with 512, no hide in between; sinks at 159 and 189, three -1s at 161 (line 9248) and 191 (line 10998), exactly 2 ticks later. The 1536 west / 512 east pairing matches.
    • rsprox_transcripts/237/04054.txt: add at tick 8302 with model -1, show 8303 west with 1536; whole-tail swaps never hide.
    • rsprox_transcripts/235/03399.txt: on the kill (tick 812) huey_knockout and the tail sink share a tick and the three -1s follow at 814 (likewise 1109/1096 and 1429/1411). This supports "hidden again on the kill".
    • Rain Fire: every volley carries the shared huey_attack_melee (11669) with no shared spotanim; each target gets npc_anim_specific (11670/11671, 11673-11675 shielded) and npc_spotanim_specific slot 0 (2968/2971/2974) on the same tick (04052 ticks 51, 73, 88, 103, 118, 133; 04054 ticks 7233-7373; 03399 ticks 612-718). Volleys seen without specific packets (04052 tick 10) are from a player outside the arena.
    • Beyond the recordings: one style per volley for everyone (the PR and docs say so), and hiding the whole-tail form with a single -1 (the recordings only show the broken tail's three -1s, and the whole tail is never sunk without a show except at the kill, where it is already the broken form).
  • Wiki: the page states the 30 September 2026 change "Fixed Hueycoatl's tail spawning in the wrong orientation"; it says nothing about visibility while sunk or Rain Fire animations, so those rest on the recordings. The docs note that the angles predate that fix is accurate.
  • Traced: NPC.setFaceAngle -> PlayerSession NpcView -> npcUpdateMask/writeNpcUpdateBlock -> NpcUpdateDecoder -> OsrsClient; gateway decoder -> EntityMirror. npcTypeHasModel consumers: NpcModelLoader, SceneRaycaster, overlays.getNpcDefaultHeight. The 0xffff to -1 decode only affects type customisations, whose other users (Echo bosses) send real ids.
  • Rules: LF endings; no generated JSON; no plugin description or config change (no world-config-docs run needed).

Findings

No defects found.

Scope

ordinary

Verified

  • Server build (yarn build in server/) on the integration commit: ok
  • server/tests/hueycoatl-tail-head.test.cjs: 4/4; hueycoatl.test.cjs: 20/20; hueycoatl-camera-reset.test.cjs: 7/7; echo-bosses.test.cjs: 7/7; echo-boss-controllers.test.cjs: 14/14; ides-of-milk-parity.test.cjs: 33/33
  • Client (tsx): npc-face-angle-hidden-models, npc-type-customisation, npc-exact-move, npc-tint, npc-world-view-sync, npc-transparency, npc-headbars, npc-head-icons, npc-spot-anim-slots: all pass
  • Gateway gateway.down.ActorBlocksTest: 5/5 pass. Revert check: with the face-angle decode line removed the new test fails (expected (512, true) but was null).
  • Revert check: with main's server/plugins/bosses/hueycoatl files the 4 new server tests fail (0 pass); with main's NpcType.ts and NpcUpdateDecoder.ts the new client test fails.
  • docs: yarn install --frozen-lockfile and yarn build (Yarn 1.22): ok
  • main+head merge tree: clean
  • generated JSON: none edited
  • Environment: Gradle first failed with git exit 128 (rsprox clone, "Filename too long") on this deep worktree path; fixed with GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=core.longpaths GIT_CONFIG_VALUE_0=true. It then needed a JDK 11 toolchain for the pinned rsprox build, which this machine lacks; the gateway test ran with a scratch init script (outside the repo) forcing toolchains to JDK 17.

Not verified

  • tsc --noEmit in client, and the in-game checks (real client rendering of the -1 tail, the instant turn): not run; covered only by the protocol round-trip test and the author's report.
  • packet-sender.test.cjs #8: not run.
  • The tail's menu ops while sunk (live enabled_ops): tsps has no NPC ops packet, as the PR notes; not a defect of this change.

Verdict

Merge

@UnhealthyKraken
UnhealthyKraken merged commit 66277e1 into RSPSApp:main Nov 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Hueycoatl: phase-1 body models, tail orientation/animation, head attack animations, chain Peek lines and pet chance differ from live

2 participants