WIP checkpoint: Client-side position sync + prediction/reconciliation
This commit is contained in:
@@ -73,6 +73,11 @@ func _run() -> void:
|
||||
var reconcile_handler := func(err): reconciled_this_round = true; correction_seen = err
|
||||
net.reconciled.connect(reconcile_handler)
|
||||
for i in 60:
|
||||
# Keep predicting (with no movement input) so the prediction buffer's
|
||||
# latest entry actually reflects the desynced position -- without
|
||||
# this, the buffer either empties out or keeps stale pre-desync
|
||||
# entries, and _handle_snapshot has nothing real to compare against.
|
||||
net.predict_and_send(1.0 / 30.0, 0.0, 0.0, false)
|
||||
await process_frame
|
||||
if reconciled_this_round:
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user