Skip to content

fix(TutorialIsland): walk to and open rat pen gate before melee attack (1.3.17) - #644

Merged
chsami merged 1 commit into
developmentfrom
claude/err-tutorialisland-rat-pen-gate-stuck
Oct 16, 2026
Merged

chsami merged 1 commit into
developmentfrom
claude/err-tutorialisland-rat-pen-gate-stuck

Conversation

@chsami

@chsami chsami commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Problem

Discord bug report "Tutorial Island can't kill rats" (thread), with fresh reports today (1, 2) and earlier confirmations (1, 2).

At the melee giant rat step the script never goes through the rat pen gate. Instead it keeps clicking the rats, or the character stands idle near the ladder/stairs. It is intermittent, and 3 users have reported it.

Root cause

walkAndAttackRat only opened gate 9719 when the player was already standing on the x==3111, y 9516-9519 strip, and nothing ever walked them there. Everywhere else it attacked only if Rs2Walker.canReach(rat) was true, and that check is too loose:

  • The client's shortestpath/transports.tsv lists the rat pen gates (9719/9720) as transports, so the path goes straight into the pen.
  • canReach(WorldPoint) passes when the boxes around the path end and the target overlap, which gives about 2 tiles of slack.

So "Attack" was sent from outside the closed gate. The player walked to the fence, stopped, and the click repeated every tick. When the check came back false, the method returned without doing anything, which is the idle symptom. The ranged step went through the same method.

Change

  • New RatPen helper: gate 9719, outside tile 3111,9518, inside tile 3110,9518. next(playerLoc, ratReachable) returns ATTACK, OPEN_GATE (when the player is within 1 tile of the outside tile on the same plane) or WALK_TO_GATE.
  • walkAndAttackRat now decides reachability with Rs2Tile.isTileReachable (a strict collision-map search from the player). Then it either attacks, opens the gate and waits until the inside tile is reachable, or walks to the gate tile.
  • The ranged step uses a new attackRatAtRange(), which attacks the nearest giant rat with no reachability check, because ranged fires over the fence.
  • TutorialIsland bumped from 1.3.16 to 1.3.17.

Validation

  • New RatPenTest (6 tests): attack when the rat is reachable, walk to the gate from the ladder or the instructor, open the gate on or next to the gate tiles, a null location, and a different plane.
  • PluginManifestVersionTest passes.
  • ./gradlew build -PpluginList=TutorialIslandPlugin succeeds.

Known gaps

  • Not tested in a live client. The gate tile orientation (inside of the pen is west of x=3111, taken from transports.tsv) has not been checked in game.
  • It is unverified whether "Open" also walks the player through the gate. The logic copes either way: once the gate is open the rat becomes strictly reachable and the next tick attacks.
  • RatPenTest covers only the decision function.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV

…k (1.3.17)

The melee rat step only opened gate 9719 when the player already stood on
the x=3111 gate strip, and otherwise gated the attack on Rs2Walker.canReach,
which routes through the gate transport and tolerates a 2-tile endpoint
offset. Rats were clicked from outside the closed pen (spam-clicking) or the
step idled. Now the attack is gated on a strict collision reachability check;
when the rat is not reachable the player walks to the gate and opens it. The
ranged step attacks the rat over the fence without a reachability check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV
@chsami
chsami merged commit a213d1d into development Oct 16, 2026
1 check 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.

1 participant