Skip to content

Commit d7995ef

Browse files
authoredMay 28, 2021
Merge pull request godotengine#26 from Shatur95/player_proto
Minor improvements
2 parents 3f02478 + 54f340e commit d7995ef

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed
 

‎modules/network_synchronizer/networked_controller.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ void ServerController::calculates_player_tick_rate(real_t p_delta) {
10361036
#ifdef DEBUG_ENABLED
10371037
const bool debug = ProjectSettings::get_singleton()->get_setting("NetworkSynchronizer/debug_server_speedup");
10381038
if (debug) {
1039-
print_line("Network poorness: " + rtos(net_poorness) + " optimal frame delay: " + itos(optimal_frame_delay) + " Deviation: " + rtos(deviation_receive_time));
1039+
print_line("Network poorness: " + rtos(net_poorness) + ", optimal frame delay: " + itos(optimal_frame_delay) + ", deviation: " + rtos(deviation_receive_time) + ", current frame delay: " + itos(consecutive_inputs));
10401040
}
10411041
#endif
10421042
}
@@ -1463,7 +1463,7 @@ void DollController::receive_batch(const Vector<uint8_t> &p_data) {
14631463
#ifdef DEBUG_ENABLED
14641464
const bool debug = ProjectSettings::get_singleton()->get_setting("NetworkSynchronizer/debug_doll_speedup");
14651465
if (debug) {
1466-
print_line("Net poorness: " + rtos(net_poorness) + " Optimal stored epochs: " + rtos(optimal_frame_delay) + " Deviation: " + rtos(deviation_receive_time));
1466+
print_line("Network poorness: " + rtos(net_poorness) + ", optimal stored epochs: " + rtos(optimal_frame_delay) + ", deviation: " + rtos(deviation_receive_time));
14671467
}
14681468
#endif
14691469
}

‎modules/network_synchronizer/networked_controller.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class NetworkedController : public Node {
156156
/// This margin of error is called `optimal_frame_delay` and it changes
157157
/// depending on the connection health:
158158
/// it can go from `min_frames_delay` to `max_frames_delay`.
159-
int min_frames_delay = 1;
159+
int min_frames_delay = 2;
160160
int max_frames_delay = 6;
161161

162162
/// Rate at which the tick speed changes, so the `optimal_frame_delay` is
@@ -183,7 +183,7 @@ class NetworkedController : public Node {
183183
/// This margin of error is called `optimal_frame_delay` and it changes
184184
/// depending on the connection health:
185185
/// it can go from `doll_min_frames_delay` to `doll_max_frames_delay`.
186-
int doll_min_frames_delay = 1;
186+
int doll_min_frames_delay = 2;
187187
int doll_max_frames_delay = 5;
188188

189189
/// Max speedup / slowdown the doll can apply to recover its epoch buffer size.

‎modules/network_synchronizer/scene_synchronizer.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,12 @@ void ClientSynchronizer::process() {
20032003
const real_t delta = scene_synchronizer->get_physics_process_delta_time();
20042004
const real_t iteration_per_second = Engine::get_singleton()->get_iterations_per_second();
20052005

2006+
#ifdef DEBUG_ENABLED
2007+
if (unlikely(Engine::get_singleton()->get_frames_per_second() < iteration_per_second)) {
2008+
WARN_PRINT("Current FPS is " + itos(Engine::get_singleton()->get_frames_per_second()) + ", but the minimum required FPS is " + itos(iteration_per_second) + ", the client is unable to generate enough inputs for the server.");
2009+
}
2010+
#endif
2011+
20062012
NetworkedController *controller = static_cast<NetworkedController *>(player_controller_node_data->node);
20072013
PlayerController *player_controller = controller->get_player_controller();
20082014

0 commit comments

Comments
 (0)