Skip to content

[Core] Raise MaxTerrainGridCells so Sekhemas floors load again - #9

Open
yokkenUA wants to merge 1 commit into
Gordin:mainfrom
yokkenUA:fix/sekhema-terrain-cell-cap
Open

yokkenUA wants to merge 1 commit into
Gordin:mainfrom
yokkenUA:fix/sekhema-terrain-cell-cap

Conversation

@yokkenUA

@yokkenUA yokkenUA commented Sep 5, 2026

Copy link
Copy Markdown

TryGetTerrainDimensions rejects an area whose grid exceeds MaxTerrainGridCells, and rejection zeroes GridWalkableData, GridHeightData and TgtTilesLocations together -- so Radar loses both the area map and every POI, with nothing on screen to say why.

A Trial of the Sekhemas floor holds every room of the floor at once and is far past the old 25M limit. Measured live on Sanctum_1_Foyer_3:

TotalTiles 220 x 294
grid 5060 x 6762 = 34,215,720 cells -> rejected at 25M
BytesPerRow 2530 (2 cells per byte)
walkable data 17.1 MB -> fits the 50MB cap
radar image 34.2 Mpx -> fits the 200Mpx cap

so this cap was the only thing rejecting it. With it raised, the same floor reports walkableMapDimension 5060x6762 and draws normally.

100M is not arbitrary: GridWalkableData packs 2 cells per byte, so 100M cells is exactly the 50MB ReadStdVector cap, past which the read fails anyway. That makes the two limits agree instead of the smaller one silently shadowing the larger. The guard still does its job -- a shifted TerrainMetadata offset yields values orders of magnitude beyond this.

This is the same area an earlier fix had already had to make room for (e7a7910, which raised the ReadStdVector cap 16MB -> 50MB).

TryGetTerrainDimensions rejects an area whose grid exceeds
MaxTerrainGridCells, and rejection zeroes GridWalkableData,
GridHeightData and TgtTilesLocations together -- so Radar loses both the
area map and every POI, with nothing on screen to say why.

A Trial of the Sekhemas floor holds every room of the floor at once and
is far past the old 25M limit. Measured live on Sanctum_1_Foyer_3:

  TotalTiles      220 x 294
  grid            5060 x 6762  = 34,215,720 cells   -> rejected at 25M
  BytesPerRow     2530                              (2 cells per byte)
  walkable data   17.1 MB                           -> fits the 50MB cap
  radar image     34.2 Mpx                          -> fits the 200Mpx cap

so this cap was the only thing rejecting it. With it raised, the same
floor reports walkableMapDimension 5060x6762 and draws normally.

100M is not arbitrary: GridWalkableData packs 2 cells per byte, so 100M
cells is exactly the 50MB ReadStdVector cap, past which the read fails
anyway. That makes the two limits agree instead of the smaller one
silently shadowing the larger. The guard still does its job -- a shifted
TerrainMetadata offset yields values orders of magnitude beyond this.

This is the same area an earlier fix had already had to make room for
(e7a7910, which raised the ReadStdVector cap 16MB -> 50MB).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant