Skip to content

Add client presented terrain read API#119

Merged
ogyrec-o merged 1 commit into
mainfrom
feat/issue-386-client-presented-terrain-api
May 27, 2026
Merged

Add client presented terrain read API#119
ogyrec-o merged 1 commit into
mainfrom
feat/issue-386-client-presented-terrain-api

Conversation

@ogyrec-o

Copy link
Copy Markdown
Member

Summary

Adds a client-presented terrain read to ClientCameraHitProvider.

Why

frevenengine/freven-engine#386 exposed that gameplay code needs to validate and retarget client-side interactions against the same presented terrain stream that the engine uses for prediction/reconciliation.

The previous API exposed only:

  • authoritative terrain reads
  • predicted terrain reads

That forced Vanilla to build a separate thread_local pending terrain bridge to cover dependent clicks like LMB -> RMB. That is the wrong ownership boundary: the engine owns action_seq, predicted edits, ActionResult reconciliation, and WorldDelta close.

What changed

  • Adds ClientCameraHitProvider::presented_block_id_at(owner, pos).
  • Provides a source-compatible default implementation that delegates to predicted_block_id_at.
  • Documents the intended semantics: implementations may compose authoritative terrain with owner-local predicted edits still pending reconciliation.

Boundaries

  • no engine source changes
  • no Vanilla source changes
  • no Boot changes
  • no protocol changes
  • no server authority weakening
  • no client prediction as authority

Validation

  • cargo +stable fmt --all
  • cargo +stable fmt --all -- --check
  • cargo +stable test --locked -p freven_block_api
  • cargo +stable test --locked --workspace
  • cargo +stable clippy --locked --workspace --all-targets -- -D warnings
  • git --no-pager diff --check

Related:

@ogyrec-o ogyrec-o self-assigned this May 27, 2026
@ogyrec-o ogyrec-o merged commit 9b5ec44 into main May 27, 2026
1 check passed
@ogyrec-o ogyrec-o deleted the feat/issue-386-client-presented-terrain-api branch May 27, 2026 14:30
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