Throttle player equipment compositing and spawning to fix walking stutter

Defer equipment texture compositing to a queue processed max 1 per frame
instead of compositing immediately on callback (each compositeWithRegions
call does file I/O + CPU blit + GPU upload on the main thread). Reduce
MAX_SPAWNS_PER_FRAME from 96 to 8 and increase inspect rate limit from
0.75s to 2s. Demote noisy per-frame logs to DEBUG level.
This commit is contained in:
Kelsi 2026-02-16 00:51:59 -08:00
parent d87a86e35c
commit 35034ca544
3 changed files with 23 additions and 7 deletions

View file

@ -314,8 +314,8 @@ void GameHandler::update(float deltaTime) {
if (guid != 0 && guid != playerGuid && entityManager.hasEntity(guid)) {
auto pkt = InspectPacket::build(guid);
socket->send(pkt);
inspectRateLimit_ = 0.75f; // keep it gentle
LOG_INFO("Sent CMSG_INSPECT for player 0x", std::hex, guid, std::dec);
inspectRateLimit_ = 2.0f; // throttle to avoid compositing stutter
LOG_DEBUG("Sent CMSG_INSPECT for player 0x", std::hex, guid, std::dec);
}
}
@ -4040,7 +4040,7 @@ void GameHandler::handleDestroyObject(network::Packet& packet) {
LOG_INFO("Destroyed entity: 0x", std::hex, data.guid, std::dec,
" (", (data.isDeath ? "death" : "despawn"), ")");
} else {
LOG_WARNING("Destroy object for unknown entity: 0x", std::hex, data.guid, std::dec);
LOG_DEBUG("Destroy object for unknown entity: 0x", std::hex, data.guid, std::dec);
}
// Clean up auto-attack and target if destroyed entity was our target
@ -6033,7 +6033,7 @@ void GameHandler::updateOtherPlayerVisibleItems(uint64_t guid, const std::map<ui
// Layout not detected yet — queue this player for inspect as fallback.
if (socket && state == WorldState::IN_WORLD) {
pendingAutoInspect_.insert(guid);
LOG_INFO("Queued player 0x", std::hex, guid, std::dec, " for auto-inspect (layout not detected)");
LOG_DEBUG("Queued player 0x", std::hex, guid, std::dec, " for auto-inspect (layout not detected)");
}
return;
}