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

Game grinds to a hault / bug in physics / crash in parry2d qbvh #961

Closed
MaxCWhitehead opened this issue Apr 6, 2024 · 3 comments
Closed
Assignees
Labels
kind:bug Something isn't working

Comments

@MaxCWhitehead
Copy link
Collaborator

Description

I was having some issues crashing in parry2d QBVH, sometimes a crash and sometimes game grinding to hault or hanging. Did some research and not the only ones hitting this - updated parry2d for a fix. Some additional context here: #960

Thought that fixed it but I repro'd the slowdown again. I saw thousands of move_vertical and other operations update_kinematics inside a frame in puffin data. Not totally sure if should read too much into puffin in an error state, but just taking note. Going to try to repro with debugger attached and gather more info.

To Reproduce

(May be able to repro in local play, but these are the conditions I encountered it in).

  1. Start two jumpy clients
  2. Start online game
  3. Play game as normal on one client, kill other player, interact with items, etc.
  4. Observe either a crash, or FPS slowing down rapidly until totally frozen.

Expected Behavior

No response

Additional Context

No response

Log Messages

No response

@MaxCWhitehead MaxCWhitehead added the kind:bug Something isn't working label Apr 6, 2024
@MaxCWhitehead MaxCWhitehead self-assigned this Apr 6, 2024
@MaxCWhitehead
Copy link
Collaborator Author

Even if not a full death spiral, physics perf seems to also sometimes degrade over time. Likely due to BVH becoming inbalanced / degenerating based on notes relating to issues / fix in parry2d repo.

image

@MaxCWhitehead
Copy link
Collaborator Author

MaxCWhitehead commented Apr 6, 2024

Sounds like the fix upstream was actually to just rebuild the BVH after it gets unbalanced enough, instead of crashing. So there is still a bug at large in parry2d causing degenerate tree, which makes sense why the issue moved from a crash to just being slow...

EDIT: But this is still much worse than rebuilding BVH every frame, as if it doesn't degenerate far enough to trigger rebuild, perf tanks.

@MaxCWhitehead
Copy link
Collaborator Author

Mitigated by #962, will keep an eye on upstream to see if we can remove this down the line. Will open an issue describing this problem in parry2d, as the other handful of issues were closed with recent fix, but it still seems to be a big problem.

github-merge-queue bot pushed a commit that referenced this issue Apr 6, 2024
…every frame (#962)

See #961 for context. There's a bug in parry2d involving incremental
update failing to balance broadphase BVH. Fully rebuilding BVH avoids
this issue, and we can get away with it due to few bodies in our game.
This was our previous behavior before supporting dynamic bodies and
relying on incremental update in physics pipeline, which turns out to be
broken.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant