RynthAi jump loot: resend at once when the client's request slot refused the move #29

Open
AwfulWaffle wants to merge 3 commits from AwfulWaffle/RynthSuite:lootjump-slot-refusal into main
First-time contributor

Depends on: lootjump-no-benddown (#24) (its tests send in the air on the no-bend-down call; the resend clears its jump flags). Third of the stack: lootjump-landing-gate (#23) -> lootjump-no-benddown (#24) -> lootjump-slot-refusal (#29) -> {lootjump-merge-floor (#30), lootjump-flight-budget (#31)} (siblings, both on this branch).

What went wrong in play

The acclient holds one pending inventory request. While that slot is held it refuses any other item move with a LOCAL chat line, "You can only move or use one item at a time": nothing reaches the server, no WeenieError comes, and the engine's MoveItemExternal returns true regardless. RynthAi took the refused send for one in flight and waited the whole answer window (PickupAnswerWaitMs, 4-8 s) before it tried again, and that retry cost the item one of its 3 tries. At the jump-loot cadence the loot stalled 4-8 s at a time.

The fix

  • The line is heard (NoteSlotRefusalChat from OnChatWindowText, anchored at the line start so a player quoting it does not count) and stamped with its arrival time on the loot clock.
  • It is taken for the current send's refusal only when it arrived within the send's window (200 ms, or 2.5 s for a send made while the motion queue was busy, because the engine's main-thread queue holds the move that long) and no other item action of this plugin went out between that same window before the send and the line.
  • UseAudit.NoteItemAction stamps those other item actions:
    • every UseFor and UseOnFor except the looter's own corpse opens;
    • the wand, weapon and offhand wields (BuffManager, CombatManager, CombatManager.Offhand);
    • the ground pickup, the give helper (GiveItem) and the item tool's give;
    • the salvage sends and panel adds (SalvageManager), and the meta give actions and salvage-panel add (ExpressionEngine);
    • the MagTools give, drop and dequip, and the HUD and MiniRemote item uses;
    • the stack merges (MergeStackInternal in InventoryManager, ExpressionEngine.UbCompat and AutoVendorManager);
    • the trade adds (TradeAdd in MagToolsCommands.Extra, AutoTradeCommands and AutoTradeManager).
  • Not stamped, as the UseAudit doc lists by file:
    • vendor buy and sell;
    • the salvage panel execute;
    • the pack-to-pack moves and stack splits (MoveItemInternal, PutItemInContainer, SplitStackInternal) in the buff, combat, ammo, offhand, meta, inventory, vendor and trade code;
    • the legacy swap wields;
    • the dashboard's panel drag (PanelDragWithLastItem, InstrumentDashboard).
  • Item actions of other plugins (RynthLua, RynthSort and the rest) are not seen at all: each plugin compiles its own copy of UseAudit.cs, so a stamp there lands on that plugin's clock, not RynthAi's.
  • The send is repeated 250 ms after it, without a jump, never counted as one of the 3 tries or as a too-busy free retry, for up to 11.5 s from the item's first slot refusal (the engine clears a held slot after 10 s); then the ordinary answer wait takes over.
  • The refusal baseline is taken in SendLootPickup, the one path every send goes through, own-corpse sends included.
  • Adapted to upstream's fight hold (HoldOpenCorpseForFight): no slot resend while a fight has the tick, since the client drops an item move while the character attacks. The line is attributed by its own arrival time, so the resend goes at once after the fight, and the fresh send does not inherit the refused send's fight flag.

How it was tested

Tools/RynthCore.RynthAiHostTests, dotnet run -c Release:

  • full run: 1530 tests, 1529 passed, 1 failed (map bake: 0x6346 ..., the same pre-existing failure as upstream main: 1495 tests, 1494 passed);
  • "Jump" filter: 62 tests, 62 passed.

New tests:

  • a slot-refused send is resent in about 250 ms with no try used;
  • a late line, or a player's words, is not ours;
  • a line then the server's answer at 200 ms is one move;
  • resends go on past 7.5 s and hand over after 11.5 s;
  • a busy-queue send's refusal at 700 ms is its own;
  • another item action before the line suppresses it, and so does a UseOnFor;
  • the looter's own UseOnFor ("Loot") is not stamped, so a line after it is still ours and resent;
  • an item action 1 s before a busy-queue send (2500 ms window) suppresses it too;
  • the reset clears the slot fields;
  • with Jump When Looting off, a refusal line changes nothing;
  • a refusal during a fight, driven through the real fight hold (TickCorpseOpening with Combat given the tick), is resent only after the fight, at once, with no fight flag carried;
  • an own-corpse send after an earlier refusal line is one move.

Each of these was checked to fail its test when removed: the fight gate, the setting gate, the fight-flag clear, the UseOnFor stamp, the UseOnFor "Loot" exclusion and the window-length look back.

Scope and risk

ACE-specific in its tuning. The windows and the 250 ms cadence were measured on ACE with jump-loot, so the net is gated by Jump When Looting (LootJumpEnabled, default off): with the setting off every send keeps its old wait. The refusal itself is a client chat line, not ACE-specific, so the owner may prefer to drop the settings.LootJumpEnabled condition and run the net for everyone; that is a one-condition change at the PollSlotRefusal call. The UseAudit stamps are a timestamp only and change nothing on their own. A misattributed line from an unstamped item action can put a second move of the same item in flight (not seen in tests or logs; the windows and the stamps are there to keep it rare). Files: CorpseOpenController.cs, RynthAiPlugin.cs (chat hook), UseAudit.cs, GroundLootController.cs, SalvageManager.cs, RynthAiCommands.cs, BuffManager.cs, CombatManager.cs, CombatManager.Offhand.cs, HudController.cs, MiniRemoteInventory.cs, MagToolsCommands.cs, MagToolsCommands.Extra.cs, ExpressionEngine.cs, ExpressionEngine.UbCompat.cs, RynthAiPlugin.ItemTool.cs, InventoryManager.cs, AutoVendorManager.cs, AutoTradeCommands.cs, AutoTradeManager.cs, plus tests.

🤖 Generated with Claude Code

Depends on: lootjump-no-benddown (#24) (its tests send in the air on the no-bend-down call; the resend clears its jump flags). Third of the stack: lootjump-landing-gate (#23) -> lootjump-no-benddown (#24) -> lootjump-slot-refusal (#29) -> {lootjump-merge-floor (#30), lootjump-flight-budget (#31)} (siblings, both on this branch). ## What went wrong in play The acclient holds one pending inventory request. While that slot is held it refuses any other item move with a LOCAL chat line, "You can only move or use one item at a time": nothing reaches the server, no WeenieError comes, and the engine's `MoveItemExternal` returns true regardless. RynthAi took the refused send for one in flight and waited the whole answer window (`PickupAnswerWaitMs`, 4-8 s) before it tried again, and that retry cost the item one of its 3 tries. At the jump-loot cadence the loot stalled 4-8 s at a time. ## The fix - The line is heard (`NoteSlotRefusalChat` from `OnChatWindowText`, anchored at the line start so a player quoting it does not count) and stamped with its arrival time on the loot clock. - It is taken for the current send's refusal only when it arrived within the send's window (200 ms, or 2.5 s for a send made while the motion queue was busy, because the engine's main-thread queue holds the move that long) and no other item action of this plugin went out between that same window before the send and the line. - `UseAudit.NoteItemAction` stamps those other item actions: - every `UseFor` and `UseOnFor` except the looter's own corpse opens; - the wand, weapon and offhand wields (`BuffManager`, `CombatManager`, `CombatManager.Offhand`); - the ground pickup, the give helper (`GiveItem`) and the item tool's give; - the salvage sends and panel adds (`SalvageManager`), and the meta give actions and salvage-panel add (`ExpressionEngine`); - the MagTools give, drop and dequip, and the HUD and MiniRemote item uses; - the stack merges (`MergeStackInternal` in `InventoryManager`, `ExpressionEngine.UbCompat` and `AutoVendorManager`); - the trade adds (`TradeAdd` in `MagToolsCommands.Extra`, `AutoTradeCommands` and `AutoTradeManager`). - Not stamped, as the `UseAudit` doc lists by file: - vendor buy and sell; - the salvage panel execute; - the pack-to-pack moves and stack splits (`MoveItemInternal`, `PutItemInContainer`, `SplitStackInternal`) in the buff, combat, ammo, offhand, meta, inventory, vendor and trade code; - the legacy swap wields; - the dashboard's panel drag (`PanelDragWithLastItem`, `InstrumentDashboard`). - Item actions of other plugins (RynthLua, RynthSort and the rest) are not seen at all: each plugin compiles its own copy of `UseAudit.cs`, so a stamp there lands on that plugin's clock, not RynthAi's. - The send is repeated 250 ms after it, without a jump, never counted as one of the 3 tries or as a too-busy free retry, for up to 11.5 s from the item's first slot refusal (the engine clears a held slot after 10 s); then the ordinary answer wait takes over. - The refusal baseline is taken in `SendLootPickup`, the one path every send goes through, own-corpse sends included. - Adapted to upstream's fight hold (`HoldOpenCorpseForFight`): no slot resend while a fight has the tick, since the client drops an item move while the character attacks. The line is attributed by its own arrival time, so the resend goes at once after the fight, and the fresh send does not inherit the refused send's fight flag. ## How it was tested `Tools/RynthCore.RynthAiHostTests`, `dotnet run -c Release`: - full run: 1530 tests, 1529 passed, 1 failed (`map bake: 0x6346 ...`, the same pre-existing failure as upstream main: 1495 tests, 1494 passed); - `"Jump"` filter: 62 tests, 62 passed. New tests: - a slot-refused send is resent in about 250 ms with no try used; - a late line, or a player's words, is not ours; - a line then the server's answer at 200 ms is one move; - resends go on past 7.5 s and hand over after 11.5 s; - a busy-queue send's refusal at 700 ms is its own; - another item action before the line suppresses it, and so does a `UseOnFor`; - the looter's own `UseOnFor` ("Loot") is not stamped, so a line after it is still ours and resent; - an item action 1 s before a busy-queue send (2500 ms window) suppresses it too; - the reset clears the slot fields; - with Jump When Looting off, a refusal line changes nothing; - a refusal during a fight, driven through the real fight hold (`TickCorpseOpening` with Combat given the tick), is resent only after the fight, at once, with no fight flag carried; - an own-corpse send after an earlier refusal line is one move. Each of these was checked to fail its test when removed: the fight gate, the setting gate, the fight-flag clear, the `UseOnFor` stamp, the `UseOnFor` "Loot" exclusion and the window-length look back. ## Scope and risk ACE-specific in its tuning. The windows and the 250 ms cadence were measured on ACE with jump-loot, so the net is gated by Jump When Looting (`LootJumpEnabled`, default off): with the setting off every send keeps its old wait. The refusal itself is a client chat line, not ACE-specific, so the owner may prefer to drop the `settings.LootJumpEnabled` condition and run the net for everyone; that is a one-condition change at the `PollSlotRefusal` call. The `UseAudit` stamps are a timestamp only and change nothing on their own. A misattributed line from an unstamped item action can put a second move of the same item in flight (not seen in tests or logs; the windows and the stamps are there to keep it rare). Files: `CorpseOpenController.cs`, `RynthAiPlugin.cs` (chat hook), `UseAudit.cs`, `GroundLootController.cs`, `SalvageManager.cs`, `RynthAiCommands.cs`, `BuffManager.cs`, `CombatManager.cs`, `CombatManager.Offhand.cs`, `HudController.cs`, `MiniRemoteInventory.cs`, `MagToolsCommands.cs`, `MagToolsCommands.Extra.cs`, `ExpressionEngine.cs`, `ExpressionEngine.UbCompat.cs`, `RynthAiPlugin.ItemTool.cs`, `InventoryManager.cs`, `AutoVendorManager.cs`, `AutoTradeCommands.cs`, `AutoTradeManager.cs`, plus tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ACE refuses a cast, a swing, a shot, a kit, food or a potion while the
character is in the air (Player_Magic/Melee/Missile, Healer, Food:
IsJumping -> YouCantDoThatWhileInTheAir, 0x4EB). Nothing held combat or
buffs for a loot jump, so an attack or heal sent during the pickup's jump
was refused, and a refused attack was judged a no-damage miss.

ActionPacer now keeps a loot-jump air hold (NoteLootJump /
LootJumpAirborne / ForgetLootJump), with the landing check the stuck-cast
jump already used (height back from JumpLandMinMs, JumpLandMaxMs at most,
so a missed landing cannot stall anything). CombatManager.Think checks it
right before the attack send (target, approach and stance go on; nothing
is stamped, counted or judged for a held tick); MayStart holds "Buff"
starts (buffs, heals, kits, potions, the emergency step). "Loot" and doors
are never held: ACE takes a pickup and a corpse use in the air. The hold
ends at death, portal space and logout.

Belt and braces: a cast answered UseDone 0x4EB, and a swing or shot
followed by WeenieError 0x4EB, is not judged as a no-damage attack.

No second tap jump while the last one is still in the air: the move
arrives in the air anyway, and ACE HandleActionJump has no ground check
(an air jump only costs stamina). A jump the client refused is not noted.

The hold is only ever set by a loot jump, which needs Jump When Looting
(LootJumpEnabled, default off). The 0x4EB handling reacts only to the
server's own in-the-air refusal.

Host tests: no second jump while in the air, a fresh one after the
landing; the jump holds buffs and emergency heals but never loot, until
the landing or the cap; portal space and a death drop the hold; Think
sends no cast in the air and casts on the landing or at the cap; a swing
refused in the air is not a miss.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With jump-loot on ACE the server answers a pickup made in the air with no
pickup motion (Player_Inventory.GetPickupMotion returns Invalid under
allow_jump_loot), so EnqueuePickupDone has no Return to play and the
character is not busy. The looter still treated the answer like a normal
one: it held the answer to the 500 ms PickupAnswerMinMs floor, then held
the corpse open until the motion queue went still (the jump's own take-off
and landing) or for PickupSettleMs, and queued the next item as if behind
a Return. In play that is about 2 s of bend-down wait per pickup that the
server never played.

A jump send is now believed on arrival when the item is seen in a pack
(the server's own answer about that object, which also frees the client's
one request slot). A merge keeps the floor: a merged-away object can leave
the slot held. A pickup whose jump went out with that very send, or that
was sent while still in the air from the last loot jump, and whose item
was off the corpse sooner than PickupAnswerMinMs, settles at its confirm:
the corpse completes and the next pickup or open goes at once, in the air.
For the jump's flight (JumpLandMaxMs from the jump itself, read through
the new ActionPacer.LootJumpAgeMs) a busy motion queue does not hold the
next pickup. A jump pickup answered after a bend-down's time keeps the
Return wait, and its confirm ends any earlier flight window.

The call can be wrong (a fast real bend-down can be 0.25-0.4 s): a move
sent on it refused as "too busy" (0x1D, or ACE's 0x1D plus code-0
save-failed pair), or the next corpse's open sent on it answered UseDone
0x1D, ends the window and turns the call off for 5 min. Any other fast
refusal does not. Dropping the corpse claim ends the window.

Only jump sends take any of this, so it needs Jump When Looting
(LootJumpEnabled, default off). A send with no jump keeps the floor and
the Return wait unchanged.

Host tests: next corpse opened at the confirm with the air queue busy or
idle; next item sent in the air with no second jump, a fresh jump after
the landing; a slow answer waits its Return and ends the flight window;
a jump answer at 150 ms is confirmed then; a jump merge, a no-jump send
and a weak sign keep the floor; no-jump and resent fast answers wait
their Return; a too-busy move or open turns the call off, a code-0
refusal does not; the reset ends the window; one move in flight, the next
on the answer tick; the window is anchored to the jump, not the send.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The acclient holds one pending inventory request. While it is held, it
refuses any other item move with a LOCAL chat line ("You can only move or
use one item at a time"): nothing reaches the server, no WeenieError
comes, and the engine's MoveItemExternal returns true regardless. The
looter took that send for one in flight and waited the whole answer
window (PickupAnswerWaitMs, 4-8 s) before trying again, and the retry
cost the item one of its 3 tries. At the jump-loot cadence this stalled
the loot 4-8 s at a time.

The line is now heard (NoteSlotRefusalChat, anchored at the line start,
stamped with its arrival time on the loot clock) and attributed to the
current send when it arrived within the send's window (200 ms, or 2.5 s
for a send made while the motion queue was busy, since the engine's main
thread queue holds the move that long) and no other item action of this
plugin went out between that same window before the send and the line
(UseAudit.LastItemActionAt). The send is then repeated 250 ms after it,
without a jump, never counted as one of the 3 tries or as a too-busy free
retry, for up to 11.5 s from the item's first slot refusal (the engine
clears a held slot after 10 s); then the ordinary answer wait takes over.
The refusal baseline is taken in SendLootPickup, the one path every send
goes through, own-corpse sends included.

Item actions are stamped at every UseFor and UseOnFor except the
looter's own, the wand, weapon and offhand wields, the ground pickup, the
give helper and the item tool's give, the salvage sends and panel adds,
the meta give actions and salvage-panel add, the MagTools give, drop and
dequip, the HUD and MiniRemote uses, the stack merges and the trade adds.
Not stamped: vendor buy and sell, the salvage panel execute, pack-to-pack
moves and stack splits, the legacy swap wields and the dashboard's panel
drag (the UseAudit doc names the files). Other plugins' item actions are
not seen: each plugin compiles its own copy of UseAudit.

Adapted to upstream's fight hold: no slot resend while a fight has the
tick (the client drops an item move while the character attacks); the
line is attributed by its arrival time, so the resend goes at once after
the fight, and the fresh send does not inherit the fight flag.

Gated by Jump When Looting (LootJumpEnabled, default off): the net was
measured and tuned on ACE's jump-loot cadence. With the setting off every
send keeps its old wait. The UseAudit stamps are a timestamp only.

Host tests: a slot-refused send is resent in about 250 ms with no try
used; a late line or a player's words are not ours; a line then the
server's answer at 200 ms is one move; resends go on past 7.5 s and hand
over after 11.5 s; a busy-queue send's refusal at 700 ms is its own;
another item action before the line, a UseOnFor included, suppresses it,
and so does one 1 s before a busy-queue send; the reset clears the slot
fields; the looter's own UseOnFor is not stamped, so a line after it is
still ours; with the setting off nothing changes; a refusal during a fight
(driven through the real fight hold) is resent only after it; an
own-corpse send after an earlier refusal line is one move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This pull request has changes conflicting with the target branch.
  • Plugins/RynthCore.Plugin.RynthAi/CorpseOpenController.cs
  • Plugins/RynthCore.Plugin.RynthAi/MiniRemote/MiniRemoteInventory.cs
  • Plugins/RynthCore.Plugin.RynthAi/RynthAiPlugin.cs
  • Plugins/Shared/ActionPacer.cs
  • Tools/RynthCore.RynthAiHostTests/Tests/CombatHookTests.cs
  • Tools/RynthCore.RynthAiHostTests/Tests/LootJumpTests.cs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u lootjump-slot-refusal:AwfulWaffle-lootjump-slot-refusal
git switch AwfulWaffle-lootjump-slot-refusal

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff AwfulWaffle-lootjump-slot-refusal
git switch AwfulWaffle-lootjump-slot-refusal
git rebase main
git switch main
git merge --ff-only AwfulWaffle-lootjump-slot-refusal
git switch AwfulWaffle-lootjump-slot-refusal
git rebase main
git switch main
git merge --no-ff AwfulWaffle-lootjump-slot-refusal
git switch main
git merge --squash AwfulWaffle-lootjump-slot-refusal
git switch main
git merge --ff-only AwfulWaffle-lootjump-slot-refusal
git switch main
git merge AwfulWaffle-lootjump-slot-refusal
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rynth/RynthSuite!29
No description provided.