godot icon indicating copy to clipboard operation
godot copied to clipboard

Area2D causes huge frame spikes and stutter, attributed to "setup/solve constraints"

Open djrain opened this issue 1 year ago • 0 comments

Tested versions

Reproduced in 4.3 stable, 4.2.2. stable (haven't tested other versions)

System information

macOS, Windows

Issue description

We noticed our game having serious intermittent stutters in Godot 4.3. They were seemingly random, and checking the profiler I saw large spikes usually in Physics2D category "setup constraints" and occasionally in "solve constraints". I reproduced the issue in a small project consisting of just one Area2D moving around a bunch of other Area2Ds:

https://github.com/user-attachments/assets/02d3a9b7-70d3-4aa5-a5bb-b0a18828192b

and here's one of the biggest spikes I've seen (this time in Godot 4.2.2)

Screenshot 2024-10-01 at 3 08 17 PM

Steps to reproduce

run MRP, start profiler and check "Physics2D" to see the graph. Within a few minutes you should see some large frame spikes that coincide with the FPS dropping.

Minimal reproduction project (MRP)

physics-2d-stutter.zip

djrain avatar Oct 01 '24 22:10 djrain