Reduce initial load to radius 1 (~5 tiles) for fast game entry

Was waiting for all ~50 tiles (radius 4) to fully prepare + finalize
before entering the game. Now loads only the immediate surrounding tiles
during the loading screen, then restores the full radius for in-game
streaming. setLoadRadius just sets an int — actual loading happens lazily
via background workers during the game loop.
This commit is contained in:
Kelsi 2026-03-07 12:39:38 -08:00
parent 25bb63c50a
commit 71e8ed5b7d

View file

@ -3925,6 +3925,13 @@ void Application::loadOnlineWorldTerrain(uint32_t mapId, float x, float y, float
auto* terrainMgr = renderer->getTerrainManager(); auto* terrainMgr = renderer->getTerrainManager();
auto* camera = renderer->getCamera(); auto* camera = renderer->getCamera();
// 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 = 4;
terrainMgr->setLoadRadius(1);
terrainMgr->setUnloadRadius(7);
// Trigger tile streaming for surrounding area // Trigger tile streaming for surrounding area
terrainMgr->update(*camera, 1.0f); terrainMgr->update(*camera, 1.0f);
@ -4016,6 +4023,9 @@ void Application::loadOnlineWorldTerrain(uint32_t mapId, float x, float y, float
LOG_INFO("Online terrain streaming complete: ", terrainMgr->getLoadedTileCount(), " tiles loaded"); LOG_INFO("Online terrain streaming complete: ", terrainMgr->getLoadedTileCount(), " tiles loaded");
// Restore full load radius — remaining tiles stream in-game
terrainMgr->setLoadRadius(savedLoadRadius);
// Load/precompute collision cache // Load/precompute collision cache
if (renderer->getWMORenderer()) { if (renderer->getWMORenderer()) {
showProgress("Building collision cache...", 0.88f); showProgress("Building collision cache...", 0.88f);