diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 2f091ae2b4..3d02427c59 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -1452,6 +1452,10 @@ bool NetPlayClient::GetNetPads(const int pad_nb, const bool batching, GCPadStatu if (m_host_input_authority && !m_local_player->IsHost()) { + // CoreTiming acts funny and causes what looks like frame skip if + // we toggle the emulation speed too quickly, so to prevent this + // we wait until the buffer has been over for at least 1 second. + const bool buffer_over_target = m_pad_buffer[pad_nb].Size() > m_target_buffer_size + 1; if (!buffer_over_target) m_buffer_under_target_last = std::chrono::steady_clock::now(); diff --git a/Source/Core/Core/NetPlayClient.h b/Source/Core/Core/NetPlayClient.h index 1b0601452a..5287d95ef5 100644 --- a/Source/Core/Core/NetPlayClient.h +++ b/Source/Core/Core/NetPlayClient.h @@ -157,6 +157,10 @@ protected: Common::Flag m_is_running{false}; Common::Flag m_do_loop{true}; + // In non-host input authority mode, this is how many packets each client should + // try to keep in-flight to the other clients. In host input authority mode, this is how + // many incoming input packets need to be queued up before the client starts + // speeding up the game to drain the buffer. unsigned int m_target_buffer_size = 20; bool m_host_input_authority = false;