feat: scene ghosting, as the client streams a zone's scenes

The client keeps the scene under the player loaded, the scenes the zone
file's transitions connect to it, and the global scene
(Zone::StreamScenesAroundPosition 0x0108a3f0, TerrainManager::GetSceneAtPos
0x01069010, the connected scenes at 0x01066500; transitions naming a
missing scene dropped as Zone::FixupInvalidTransitions 0x010842e0 does).

- ZoneScenes (dCommon): the terrain's scene map lookup and the scene graph,
  shared by the world server and the dashboard.
- Objects remember the scene they were placed in (spawners pass theirs on).
- ghosting_scenes=1 (world config, off by default): players get the objects
  of their loaded scenes instead of the ones within the ghosting distances;
  objects from no scene go by the scene under them. Zones without a scene
  map keep distance ghosting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 22:02:20 -05:00
parent a979ae1658
commit 83b87744c1
20 changed files with 363 additions and 19 deletions

View File

@@ -62,6 +62,7 @@ public:
void CheckGhosting(Entity* entity);
Entity* GetGhostCandidate(LWOOBJID id) const;
bool GetGhostingEnabled() const;
bool GetSceneGhosting() const { return m_SceneGhosting; }
void ScheduleForKill(Entity* entity);
@@ -109,6 +110,9 @@ private:
float m_GhostDistanceMinSqaured = 100 * 100;
float m_GhostDistanceMaxSquared = 150 * 150;
bool m_GhostingEnabled = true;
// ghosting_scenes: players get the objects of the scenes their client keeps loaded (ZoneScenes) instead of the
// ones within the ghosting distances
bool m_SceneGhosting = false;
std::stack<uint16_t> m_LostNetworkIds;