From 0ffeabd4ed54f6cc721337f2df418ef37285b989 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 7 Mar 2026 23:02:25 -0800 Subject: [PATCH] Revert "Further reduce tile streaming aggressiveness" This reverts commit f681a8b3611811cde3e9e111edbc311a6e97fde0. --- include/rendering/terrain_manager.hpp | 2 +- src/core/application.cpp | 4 ++-- src/rendering/terrain_manager.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/rendering/terrain_manager.hpp b/include/rendering/terrain_manager.hpp index 58138ea4..2a746d3e 100644 --- a/include/rendering/terrain_manager.hpp +++ b/include/rendering/terrain_manager.hpp @@ -344,7 +344,7 @@ private: // Streaming parameters bool streamingEnabled = true; - int loadRadius = 3; // Load tiles within this radius (7x7 circular ~29 tiles) + int loadRadius = 4; // Load tiles within this radius (9x9 grid = 81 tiles) int unloadRadius = 7; // Unload tiles beyond this radius float updateInterval = 0.033f; // Check streaming every 33ms (~30 fps) float timeSinceLastUpdate = 0.0f; diff --git a/src/core/application.cpp b/src/core/application.cpp index 65220f79..f9ac557c 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -1108,7 +1108,7 @@ void Application::update(float deltaTime) { // Taxi flights move fast (32 u/s) — load further ahead so terrain is ready // before the camera arrives. Keep updates frequent to spot new tiles early. renderer->getTerrainManager()->setUpdateInterval(onTaxi ? 0.033f : 0.033f); - renderer->getTerrainManager()->setLoadRadius(onTaxi ? 5 : 3); + renderer->getTerrainManager()->setLoadRadius(onTaxi ? 6 : 4); renderer->getTerrainManager()->setUnloadRadius(onTaxi ? 9 : 7); renderer->getTerrainManager()->setTaxiStreamingMode(onTaxi); } @@ -4041,7 +4041,7 @@ void Application::loadOnlineWorldTerrain(uint32_t mapId, float x, float y, float // Use a small radius for the initial load (just immediate tiles), // then restore the full radius after entering the game. // This matches WoW's behavior: load quickly, stream the rest in-game. - const int savedLoadRadius = 3; + const int savedLoadRadius = 4; terrainMgr->setLoadRadius(1); terrainMgr->setUnloadRadius(7); diff --git a/src/rendering/terrain_manager.cpp b/src/rendering/terrain_manager.cpp index 9f0dc95b..e186ed96 100644 --- a/src/rendering/terrain_manager.cpp +++ b/src/rendering/terrain_manager.cpp @@ -816,7 +816,7 @@ bool TerrainManager::advanceFinalization(FinalizingTile& ft) { } bool allDone = terrainRenderer->loadTerrainIncremental( pending->mesh, pending->terrain.textures, x, y, - ft.terrainChunkNext, 8); + ft.terrainChunkNext, 16); if (!allDone) { return false; // More chunks remain — yield to time budget } @@ -858,7 +858,7 @@ bool TerrainManager::advanceFinalization(FinalizingTile& ft) { std::lock_guard lk(queueMutex); workersIdle = loadQueue.empty() && readyQueue.empty(); } - const size_t kModelsPerStep = 2; + const size_t kModelsPerStep = workersIdle ? 6 : 4; size_t uploaded = 0; while (ft.m2ModelIndex < pending->m2Models.size() && uploaded < kModelsPerStep) { auto& m2Ready = pending->m2Models[ft.m2ModelIndex]; @@ -925,7 +925,7 @@ bool TerrainManager::advanceFinalization(FinalizingTile& ft) { std::lock_guard lk(queueMutex); wmoWorkersIdle = loadQueue.empty() && readyQueue.empty(); } - const size_t kWmosPerStep = 1; + const size_t kWmosPerStep = wmoWorkersIdle ? 2 : 1; size_t uploaded = 0; while (ft.wmoModelIndex < pending->wmoModels.size() && uploaded < kWmosPerStep) { auto& wmoReady = pending->wmoModels[ft.wmoModelIndex]; @@ -1006,7 +1006,7 @@ bool TerrainManager::advanceFinalization(FinalizingTile& ft) { if (m2Renderer && ft.wmoDoodadIndex < pending->wmoDoodads.size()) { // Set pre-decoded BLP cache for doodad M2 textures m2Renderer->setPredecodedBLPCache(&pending->preloadedM2Textures); - constexpr size_t kDoodadsPerStep = 2; + constexpr size_t kDoodadsPerStep = 4; size_t uploaded = 0; while (ft.wmoDoodadIndex < pending->wmoDoodads.size() && uploaded < kDoodadsPerStep) { auto& doodad = pending->wmoDoodads[ft.wmoDoodadIndex];