Skip to content

Commit 43fe946

Browse files
committed
The dynamic scaling can't be added inside the snapshot apply. The virtual latency must be increased and decreased according to the connection quality.
1 parent 4aefada commit 43fe946

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

core/peer_networked_controller.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,6 @@ void DollController::on_snapshot_applied(
17091709
ENSURE_MSG(input_count > 0, "This function is not supposed to work with 0 inputs. Report this bug.")
17101710

17111711
// 3. Fetch the best input to start processing.
1712-
// TODO consider to scale this dynamically to slowly catchup with the server, as too drastic change may result in a less stable simulation.
17131712
const int optimal_input_count = p_frame_count_to_rewind + optimal_queued_inputs;
17141713

17151714
// The lag compensation algorithm offsets the available
@@ -1721,10 +1720,10 @@ void DollController::on_snapshot_applied(
17211720
// It has less inputs than the optimal input count defined.
17221721
// In this case the offset, mention above, is going to be positive;
17231722
// making sure the available frames_input are used at the end of the processing
1724-
// so the `optimal_queued_inputs` is left at the endo of the rewinding.
1723+
// so the `optimal_queued_inputs` is left at the end of the rewinding.
17251724
const int missing_inputs = optimal_input_count - input_count;
1726-
17271725
queued_instant_offset = missing_inputs;
1726+
17281727
} else {
17291728
// It has more inputs than the optimal input count defined.
17301729
// In this case the offset is negative, meaning it throws away all the

0 commit comments

Comments
 (0)