Branch: feat/worldgen-sensed-tier. Two independent review lenses converged on this. Not adversarially verified; the numbers below are derived from code reading, not measured on a server.
Two halves of one problem:
Records never shrink. CellDescribeSystem.Records has exactly one eviction trigger, SensedCellComponent's ComponentShutdown, and that never fires during a round: WorldControllerSystem only does RemCompDeferred<LoadedChunkComponent> on unload and nothing anywhere deletes a WorldChunkComponent entity. So the trigger is effectively dead code until round restart and the dictionary grows monotonically with described area.
The contact scan walks all of it. SensedContactsSystem.CollectVisible iterates _describe.Records.Values in full for every console poll, with no spatial index, rejecting most entries on map or range. Cost is consoles x total-records, twice a second per client, and it is worst late in a long round at peak population.
Raising sensed_range to 3072 and flooring contact visibility at that range both increase how much this matters.
Before building an index, measure. Now that the source model is settled (presence-only, no sensor sources), instrument SensedMetrics.Records and read the real steady-state count off a running server. Removing ghosts, mechs, dragons and hardsuit helmets as describe sources may have cut this dramatically, and the 10^4-10^5 estimate came from the old inflated source set.
If it is real: bucket records by (map, chunk) when created in Describe, and in CollectVisible iterate only chunk coords within radar.MaxRange of the console.
Related: this index is the same structure that would let describe regions be decoupled from load chunks (see the cell-size issue), so the two should probably be designed together.
Branch:
feat/worldgen-sensed-tier. Two independent review lenses converged on this. Not adversarially verified; the numbers below are derived from code reading, not measured on a server.Two halves of one problem:
Records never shrink.
CellDescribeSystem.Recordshas exactly one eviction trigger,SensedCellComponent'sComponentShutdown, and that never fires during a round:WorldControllerSystemonly doesRemCompDeferred<LoadedChunkComponent>on unload and nothing anywhere deletes aWorldChunkComponententity. So the trigger is effectively dead code until round restart and the dictionary grows monotonically with described area.The contact scan walks all of it.
SensedContactsSystem.CollectVisibleiterates_describe.Records.Valuesin full for every console poll, with no spatial index, rejecting most entries on map or range. Cost is consoles x total-records, twice a second per client, and it is worst late in a long round at peak population.Raising
sensed_rangeto 3072 and flooring contact visibility at that range both increase how much this matters.Before building an index, measure. Now that the source model is settled (presence-only, no sensor sources), instrument
SensedMetrics.Recordsand read the real steady-state count off a running server. Removing ghosts, mechs, dragons and hardsuit helmets as describe sources may have cut this dramatically, and the 10^4-10^5 estimate came from the old inflated source set.If it is real: bucket records by
(map, chunk)when created inDescribe, and inCollectVisibleiterate only chunk coords withinradar.MaxRangeof the console.Related: this index is the same structure that would let describe regions be decoupled from load chunks (see the cell-size issue), so the two should probably be designed together.