Terrain: stream the 3x3 blocks around the player
CMapOutdoor keeps the 3x3 terrain blocks around the player loaded and reloads them on a block change; we loaded only the warp block, so the map ended at its edge. Stitch the set into one TerrainHeightmap, fix the attr.atr cell mapping, and reload terrain, areadata and water per block from CPythonBackground::Update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
29f33b289a
commit
47e867252f
@@ -1674,3 +1674,25 @@ All four issues reproduced on desktop too (`--phone ... --phase select|game --pr
|
||||
- Desktop ctest 59/59. Device (OnePlus PJZ110): select screen shows the warrior and ninja in
|
||||
their intro idle with heads; the game preview shows full-geometry trees and no terrain seam.
|
||||
The preview player stands inside a pine, so its head was not visible in the game shot.
|
||||
|
||||
### 2026-10-13 Terrain: load the 3x3 blocks around the player
|
||||
|
||||
On the real server (Android, "AVA2 General" at 412,760) the terrain stopped at a block edge,
|
||||
with empty sky beyond it. `CPythonBackground::LoadMap` loaded only the block under the warp
|
||||
point and never loaded another one. The original `CMapOutdoor::Update`/`LoadTerrain`
|
||||
(`LOAD_SIZE_WIDTH` 1) keeps the 3x3 terrains and areas around the player's terrain coordinate,
|
||||
clamped to `MapSize`, and reloads them when that coordinate changes.
|
||||
|
||||
- `TerrainHeightmap::LoadBlockDirs` stitches up to 3x3 blocks into one heightmap:
|
||||
- heights are (128n+3)², tiles (256n+2)², attr 256n²; neighbours share their border samples;
|
||||
- the patch grid is 8 patches per block, and the quadtree is built over the patch ranges;
|
||||
- patches of blocks with no `height.raw` are skipped.
|
||||
The active-terrain pointer stays the same, so height, attribute and actor queries work as before.
|
||||
- `GetAttrAtWorld` now maps attr.atr the way the files are laid out: 256 cells of 100 per block,
|
||||
starting at the block origin (raw index 1). Before, the 256 cells were stretched over the
|
||||
130-cell bordered height grid.
|
||||
- `CPythonBackground::Update(x, y, z)` takes map x, map y and height (as `app_update_game` passes
|
||||
them; the app_loop call had y and z swapped). When the terrain coordinate changes it reloads
|
||||
the set: terrain, every block's `areadata.txt`, and one water surface per block. The object
|
||||
loading centre now uses map y instead of height.
|
||||
- Desktop ctest 59/59 (background_test checks a 2x2 stitch: heights, attributes, and Update with no block change).
|
||||
|
||||
Reference in New Issue
Block a user