From 4aa2b4f249a3710938ecfef2383af52b95bdb2e7 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 10 Feb 2026 20:01:32 -0800 Subject: [PATCH] Tighten fidget discovery to exclude combat animations Previous criteria caught combat animations with grunts instead of subtle fidgets. Now using strict filtering and comprehensive logging to identify real fidgets. Changes: - Duration: 500-1200ms (very short movements only) - Movement: <0.01 speed (nearly stationary) - Exclude: IDs 2-3 (specials), 16-21 (combat/attack range) - Added candidate logging: shows ALL potential fidgets for debugging - Removed upper ID limit to catch fidgets at any position --- src/rendering/renderer.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/rendering/renderer.cpp b/src/rendering/renderer.cpp index cd5fad6d..856f372c 100644 --- a/src/rendering/renderer.cpp +++ b/src/rendering/renderer.cpp @@ -716,14 +716,24 @@ void Renderer::setMounted(uint32_t mountInstId, uint32_t mountDisplayId, float h // Discover idle fidget animations (head turn, tail swish, weight shift) mountAnims_.fidgets.clear(); core::Logger::getInstance().info("Scanning for fidget animations in ", sequences.size(), " sequences"); + + // Log ALL non-looping, short, stationary animations to help identify fidgets for (const auto& seq : sequences) { bool isLoop = (seq.flags & 0x01) == 0; - // Relaxed criteria: non-looping, 500-3000ms, stationary, ID 1-20 - if (!isLoop && seq.duration >= 500 && seq.duration <= 3000 && - std::abs(seq.movingSpeed) < 0.1f && seq.id >= 1 && seq.id <= 20) { - // Likely a fidget: non-looping, short, stationary, low ID + if (!isLoop && seq.duration >= 400 && seq.duration <= 2000 && std::abs(seq.movingSpeed) < 0.05f) { + core::Logger::getInstance().info(" Candidate: id=", seq.id, " dur=", seq.duration, "ms speed=", seq.movingSpeed, " flags=0x", std::hex, seq.flags, std::dec); + } + } + + // Conservative selection: very short, very stationary, exclude known combat IDs + for (const auto& seq : sequences) { + bool isLoop = (seq.flags & 0x01) == 0; + // Strict: 500-1200ms, nearly stationary, exclude combat range (16-21) and specials (2-3) + if (!isLoop && seq.duration >= 500 && seq.duration <= 1200 && + std::abs(seq.movingSpeed) < 0.01f && + seq.id != 2 && seq.id != 3 && (seq.id < 16 || seq.id > 21)) { mountAnims_.fidgets.push_back(seq.id); - core::Logger::getInstance().info(" Found fidget: id=", seq.id, " duration=", seq.duration, "ms"); + core::Logger::getInstance().info(" >> Selected fidget: id=", seq.id); } }