Map blocks missing around the camera right after teleport or respawn #11

Closed
opened 2026-11-07 18:27:41 +00:00 by claude · 1 comment
Member

During testing, a server-side teleport of the avatar 15 blocks underground showed sky and black holes for a few seconds while the client fetched blocks around the new camera position. Investigate pre-emerging and forcing block sends (or fading to black) on teleport, respawn and join.

During testing, a server-side teleport of the avatar 15 blocks underground showed sky and black holes for a few seconds while the client fetched blocks around the new camera position. Investigate pre-emerging and forcing block sends (or fading to black) on teleport, respawn and join.
claude added this to the v0.2 Core Feel milestone 2026-11-07 18:27:41 +00:00
claude added the
type
bug
priority
medium
area/camera-controls
labels 2026-11-07 18:27:41 +00:00
eric added this to the Strata Roadmap project 2026-11-07 18:36:27 +00:00
eric moved this to To Do in Strata Roadmap on 2026-11-07 18:37:23 +00:00
eric closed this issue 2026-11-07 18:51:21 +00:00
Author
Member

Fixed in e118e36.

What changed

  • New strata.teleport(name, pos) in strata_player:
    1. Covers the screen with a full-screen black HUD image ([fill, z_index 1000).
    2. Emerges strata.view_area(pos): ±30 × ±20 nodes on the plane and wall layer, and in z from the camera (plane − 24) to the wall layer.
    3. Moves the existing avatar (zeroing velocity and the fall-damage tracker), or spawns one.
    4. Pushes every visible mapblock to the client with player:send_mapblock (about 60 blocks, sent once per teleport).
    5. Holds black for 0.3 s, then fades in over 0.3 s. A newer teleport cancels a fade that's still running.
  • Join and respawn both use it now. Respawn used to skip emerging altogether. strata.place_avatar is kept as an alias.

Tested (headless, 20/20 pass): view_area covers the camera and a 16:9 screen at the configured FOV. prepare_view emerges an unloaded destination 15 nodes underground at x=640, with every corner of the view generated. send_view_blocks sends the plane, wall and camera blocks and stays under 80 blocks. Teleporting an offline player returns false.

Needs a manual check: whether the client still shows holes after the fade. This can't be verified headless. If it does, raise FADE_HOLD.
Follow-up: the engine's /teleport moves the hidden player body, not the avatar. That belongs in #10 (lock out engine features), which could route it through strata.teleport.

Fixed in e118e36. **What changed** - New `strata.teleport(name, pos)` in `strata_player`: 1. Covers the screen with a full-screen black HUD image (`[fill`, z_index 1000). 2. Emerges `strata.view_area(pos)`: ±30 × ±20 nodes on the plane and wall layer, and in z from the camera (plane − 24) to the wall layer. 3. Moves the existing avatar (zeroing velocity and the fall-damage tracker), or spawns one. 4. Pushes every visible mapblock to the client with `player:send_mapblock` (about 60 blocks, sent once per teleport). 5. Holds black for 0.3 s, then fades in over 0.3 s. A newer teleport cancels a fade that's still running. - Join and respawn both use it now. Respawn used to skip emerging altogether. `strata.place_avatar` is kept as an alias. **Tested** (headless, 20/20 pass): `view_area` covers the camera and a 16:9 screen at the configured FOV. `prepare_view` emerges an unloaded destination 15 nodes underground at x=640, with every corner of the view generated. `send_view_blocks` sends the plane, wall and camera blocks and stays under 80 blocks. Teleporting an offline player returns false. **Needs a manual check**: whether the client still shows holes after the fade. This can't be verified headless. If it does, raise `FADE_HOLD`. **Follow-up**: the engine's `/teleport` moves the hidden player body, not the avatar. That belongs in #10 (lock out engine features), which could route it through `strata.teleport`.
eric moved this to Done in Strata Roadmap on 2026-11-07 18:52:01 +00:00
Sign in to join this conversation.