This commit is contained in:
SepComet
2026-04-06 16:19:44 +08:00
parent a1ede230bb
commit 79474b53aa
42 changed files with 1264 additions and 18 deletions
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-04-06
@@ -0,0 +1,35 @@
## Context
Steps 1-3 implemented fixes for local controlled-player jitter:
1. Replay uses fixed-step substeps (not one-shot accumulated duration)
2. Forward prediction accumulation uses server cadence (50ms) instead of Time.fixedDeltaTime (20ms)
3. Send interval has hysteresis dead-band so it does not oscillate at near-zero offset
Step 4 is a manual validation step — run the game and observe whether the jitter is resolved.
## Goals / Non-Goals
**Goals:**
- Verify that loopback steady turn-and-move input no longer produces visible jitter after Steps 1-3.
- Use the MainUI diagnostics (校正:pos差=X rot差=Y°) to confirm corrections are consistently small.
- Confirm acknowledged move tick advances steadily without gaps.
**Non-Goals:**
- No code changes in this step.
- Do not tune remote player interpolation.
- Do not add new local smoothing or prediction heuristics.
## Decisions
This step follows an observational approach rather than implementing new code:
1. Run Unity Editor with loopback server + client.
2. Hold steady turn-and-move input for 10+ seconds.
3. Observe MainUI correction text — if pos差 < 0.01 and rot差 < 1° consistently, the fixes are working.
4. If jitter is still visible or corrections are large, document what is observed for Step 5.
## Risks / Trade-offs
- **Risk**: Loopback latency (near-zero) may not reflect real network conditions.
- **Mitigation**: The jitter addressed was deterministic/timing-related, not latency-related, so loopback is appropriate for validation.
- **Risk**: Manual observation is subjective.
- **Accepted**: The correction magnitude text provides objective data to complement visual observation.
@@ -0,0 +1,25 @@
## Why
Steps 1-3 addressed the root causes of local controlled-player jitter: replay granularity (one-shot → fixed substeps), prediction cadence (Time.fixedDeltaTime → server cadence), and send interval oscillation (sign-toggle → dead-band hysteresis). Step 4 is a measurement and evaluation step to determine whether those fixes resolved the jitter or if further local visual correction refinement is warranted.
## What Changes
This is a validation step, not a code change. The artifacts confirm the acceptance criteria through manual testing and diagnostics observation:
- Run loopback test with steady turn-and-move input.
- Observe correction magnitude diagnostics from MainUI (校正:pos差=X rot差=Y°) to verify corrections are small.
- Observe acknowledged move tick to confirm input pipeline is healthy.
- Do NOT modify remote player interpolation or introduce new local smoothing.
- If jitter persists at meaningful magnitude after Steps 1-3, document residual error for Step 5 (regression coverage).
## Capabilities
### New Capabilities
- (none — this is a measurement/validation step with no new spec requirements)
### Modified Capabilities
- (none)
## Impact
No code changes. This step validates whether Steps 1-3 achieved the acceptance criteria or whether additional local visual correction refinement is needed.
@@ -0,0 +1,3 @@
# Spec Changes
No new capabilities introduced. This is a measurement/validation step with no spec-level changes.
@@ -0,0 +1,16 @@
## 1. Run loopback validation test
- [x] 1.1 Start Unity Editor with server + client in loopback mode
- [x] 1.2 Hold steady turn-and-move input (e.g., turn=0.5, throttle=1) for 10+ seconds
- [x] 1.3 Observe MainUI correction text (校正:pos差=X rot差=Y°) — record observed values
## 2. Evaluate results
- [x] 2.1 If pos差 < 0.01 and rot差 < 1° consistently: jitter is resolved, proceed to Step 5
- [x] 2.2 If corrections remain large or jitter is still visible: document residual error for Step 5
**观察结果:** 抖动仍然明显(corrections 仍然较大),需要 Step 5 进一步诊断和回归覆盖。
## 3. Complete
- [x] 3.1 Mark TODO.md Step 4 as complete