Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pausing the game spams NOTIFICATION_RESET_PHYSICS_INTERPOLATION warnings for each hidden node #101665

Closed
TranquilMarmot opened this issue Jan 17, 2025 · 5 comments · Fixed by #101794
Assignees
Milestone

Comments

@TranquilMarmot
Copy link

TranquilMarmot commented Jan 17, 2025

Tested versions

Reproducible in 4.4-beta1 (previous versions did not have physics interpolation)

System information

Godot v4.4.beta1 - macOS Sequoia (15.2.0) - Multi-window, 1 monitor - Metal (Forward+) - integrated Apple M4 Pro (Apple9) - Apple M4 Pro (14 threads)

Issue description

When pausing the game, the debug logs get spammed with warnings.

When pausing some scenes in my game, >500 of these warnings are printed to the console every time.

Having hidden children of physics objects is an extremely common use case so this warning seems very odd.

For example, I have a PhysicalBoneSimulator for my characters that I keep hidden in the editor because it's very visually noisy. Now, when I pause the game, 3 warnings get printed for every bone unless I un-hide them.

Steps to reproduce

Turn on physics interpolation.

Every time the game is paused with get_tree().paused = true, a NOTIFICATION_RESET_PHYSICS_INTERPOLATION only works with unhidden nodes warning will be printed for each hidden node and for each child of that hidden node.

In this example scene (see MRP):

Image

The following warnings get printed every time the game is paused:

W 0:00:01:0149   pause_listener.gd:7 @ _unhandled_input(): [Physics interpolation] NOTIFICATION_RESET_PHYSICS_INTERPOLATION only works with unhidden nodes: "/root/Root/HiddenRigidBody3D/MeshInstance3D".
  <C++ Source>   scene/3d/visual_instance_3d.cpp:121 @ _notification()
  <Stack Trace>  pause_listener.gd:7 @ _unhandled_input()

W 0:00:01:0149   pause_listener.gd:7 @ _unhandled_input(): [Physics interpolation] NOTIFICATION_RESET_PHYSICS_INTERPOLATION only works with unhidden nodes: "/root/Root/HiddenRigidBody3D/MeshInstance3D".
  <C++ Source>   scene/3d/visual_instance_3d.cpp:121 @ _notification()
  <Stack Trace>  pause_listener.gd:7 @ _unhandled_input()


W 0:00:01:0149   pause_listener.gd:7 @ _unhandled_input(): [Physics interpolation] NOTIFICATION_RESET_PHYSICS_INTERPOLATION only works with unhidden nodes: "/root/Root/HiddenRigidBody3D/MeshInstance3D".
  <C++ Source>   scene/3d/visual_instance_3d.cpp:121 @ _notification()
  <Stack Trace>  pause_listener.gd:7 @ _unhandled_input()

W 0:00:01:0149   pause_listener.gd:7 @ _unhandled_input(): [Physics interpolation] NOTIFICATION_RESET_PHYSICS_INTERPOLATION only works with unhidden nodes: "/root/Root/HiddenRigidBody3D/MeshInstance3D".
  <C++ Source>   scene/3d/visual_instance_3d.cpp:121 @ _notification()
  <Stack Trace>  pause_listener.gd:7 @ _unhandled_input()

Minimal reproduction project (MRP)

https://github.com/TranquilMarmot/ResetPhysicsInterpolationSpam

  • Open project
  • Run scene
  • Hit Escape key to pause/unpause
  • See warnings in debug console
@Kalamster
Copy link

For me, the warning is also triggered by pausing in the new game mode in Beta1. I get several thousand of these warnings in a minute or so because of a high number of hidden CSG nodes I use for prototyping, but keep hidden when running the game.

@rburing
Copy link
Member

rburing commented Jan 17, 2025

This is happening because we always reset physics interpolation when pausing:

godot/scene/main/node.cpp

Lines 190 to 194 in 9630d4e

case NOTIFICATION_PAUSED: {
if (is_physics_interpolated_and_enabled() && is_inside_tree()) {
reset_physics_interpolation();
}
} break;

I agree we should suppress/avoid the warning in this case, when it's not caused by user error. I'm not sure where is the best place to do it. cc @lawnjelly

@lawnjelly
Copy link
Member

lawnjelly commented Jan 19, 2025

These warnings don't seem present in 3.x, it looks like @rburing added them in #92391.

I don't know if these existed historically in 3.x and were since were removed, or if they never existed there.

It looks like you could:

  • Remove the warning.
  • Add a if (_is_vi_visible() in the NOTIFICATION_PAUSED for 4.x.

But I'm not sure it needs a warning (hence not being one in 3.x) - there are other scenarios where it might be unwanted, such as turning off and on interpolation globally, or recursive resets.

Additionally for physics interpolation warnings in general it is better to use PHYSICS_INTERPOLATION_NODE_WARNING and PHYSICS_INTERPOLATION_WARNING macros, as these are anti-spamming.

They also don't call GLOBAL_GET("debug/settings/physics_interpolation/enable_warnings") all the time, as this could be an expensive call. It is far cheaper to check the condition before checking the GLOBAL, and the GLOBAL is only checked every 15 seconds or so. If it was to be checked all the time by some alternative method, it should be cached.

@rburing
Copy link
Member

rburing commented Jan 19, 2025

@lawnjelly The warnings existed historically in a4c0e2e and were removed in 5162efb. I'll remove them then :-)

@lawnjelly
Copy link
Member

Ah that sounds sensible. 👍
Maybe I noticed them being spammy in 3.x for similarish reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Bad
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants