Skip to content

Allow break face drift for same target block#120

Merged
ogyrec-o merged 1 commit into
mainfrom
fix/issue-386-break-face-drift-validation
May 27, 2026
Merged

Allow break face drift for same target block#120
ogyrec-o merged 1 commit into
mainfrom
fix/issue-386-break-face-drift-validation

Conversation

@ogyrec-o

Copy link
Copy Markdown
Member

Summary

Allows terrain break validation to accept small client/server face drift when the server-authoritative ray still hits the same target block.

Why

frevenengine/freven-engine#386 rapid LMB smoke showed one remaining rollback:

  • client locally accepts a break;
  • server ray validation rejects it with FaceMismatch;
  • engine correctly rolls back the predicted visual transaction.

The rejected action still targeted the same block. The mismatch was only the voxel face reported by DDA, caused by small client/server interaction-origin drift around voxel edges.

For break actions, face is not the authoritative edit identity. Breaking clears the whole target block. The server must still validate that the authoritative ray hits the same target block, that the target is loaded/solid/breakable, and that reach/stream/sequence rules pass.

For place actions, face and hit/contact semantics remain strict because they determine support and placement position.

What changed

  • validate_break no longer rejects solely because the client-sampled face or hit point differs from the server-authoritative trace.
  • Break acceptance still requires the server-authoritative ray to hit the requested target block.
  • Accepted hit metadata remains server-authoritative via the reconstructed trace.
  • Adds regression coverage for same-target break face drift.
  • Keeps place contact-point mismatch tests strict and place-specific.

Boundaries

  • no Vanilla source changes
  • no engine source changes
  • no Boot source changes
  • no protocol changes
  • no server authority weakening
  • no client prediction as authority
  • place face/contact validation remains strict

Validation

  • cargo +stable fmt --all -- --check
  • cargo +stable test --locked -p freven_block_api terrain_interaction
  • 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 135e1a2 into main May 27, 2026
1 check passed
@ogyrec-o ogyrec-o deleted the fix/issue-386-break-face-drift-validation branch May 27, 2026 15:43
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