Erin Catto

Game Physics/Animation

I'm writing a ragdoll editor in Unreal and I spent most of Friday trying to figure out how the Unreal skeleton editors are able to change the manipulator mode using QWER while focusing the skeleton tree panel. It is these three lines of code:

```
CommandList.MapAction(
FEditorViewportCommands::Get().FocusViewportToSelection,
FExecuteAction::CreateSP(this, &SAnimationEditorViewportTabBody::HandleFocusCamera));
```

Not intuitive at all. I wonder if Epic engineers realize this.

@slembcke it is an interesting algorithm and I look forward to testing it. The vertex methods don't follow Newton's third law, so I'm curious how that manifests.

@blackbird806 Mainly due to finite time steps and limited CPU time. These problems would still occur with infinite precision.

@apparition @morten_skaaning Ah, in that case be careful of the mass ratios. Glad you found the bullet option, it was designed for pinball games.

@morten_skaaning @apparition Box2D has a "bullet" option I would use for a pinball game. Exists in version 2. I even have a demo of this feature being used for pinball.

Reading now: "Geometric Stiffness for Real-time Constrained Multibody Dynamics".

This perfectly describes the life of a game physics programmer:
"Unfortunately, when time steps, velocities, constraint forces, or mass ratios are large, simulations can exhibit large constraint errors and become unstable."

@aras The FBX SDK using globals is a travesty. I'm really surprised Epic and Unity didn't get Autodesk to fix this. Bulk reimporting FBX files shouldn't be restricted to a single thread!

Conventional wisdom is that you need a complex and expensive direct solver to handle high mass ratios and long chains.

Box2D has an iterative SoftStep solver that uses sub-stepping and soft constraints to handle high mass ratios and long chains.

This simulation is using 4 sub-steps on 8 cores and takes roughly 0.2ms per update.

@lacyyy Yeah, I'm planning to make it freely available after the conference. Stay tuned.

@sschoener @rovarma AMD uProf has been very stable for me. UI is not as fancy and you need to adjust the BIOS to get all the stats, but it works well and has lots of data. Good info about cache misses.

I’ll be speaking about Box2D optimizations at the #GDC2025. I’ll be diving into the details of implementing fast continuous physics. This presentation has a new format I’ve developed recently. I’m really excited to share it!
schedule.gdconf.com/session/op

@pervognsen It would be really inefficient to round off the level collision.

Maybe you could figure out the collision shape using player vs AI, assuming the AI has the same collision shape.

People have been trying to create a physics interchange format for over two decades. We need to admit that physics engines are not interchangeable.

Imagine if people tried to create a cross engine script or material interchange. I don't think that will work out well.

@bnut Automatic convex decomposition would be really nice for something like this. People try this in 3D with mixed success, but maybe 2D is easier.

A convex decomposition doesn't necessarily need a separate BVH. It becomes worthwhile once the number of child shapes becomes large. In 3D it is common to have a separate BVH for a triangle mesh.

Tangent speed is a new Box2D surface property that lets you easily make conveyor belts or launch ramps like this.

youtu.be/WUxqUSk79nE

Rolling resistance using a constraint so it works on ramps.
youtube.com/watch?v=pRe6RZiJAL

@kojack Unfortunately the API wants a ground body. This has to do with how joints get tracked internally.

I could clean this up by creating a sentinel body in the world. But then people will wonder why an empty world has a body.

The mouse joint is meant for testing in the samples application, but people like to use this for their apps, so I make it available.

@scottmichaud @TomF I suppose I mainly want to show the benefit of adding more cores. For that I think some absolute time value is fine.

Certainly for coming up with a physics budget for a game, knowing the physics performance in terms of a time value is best.

For comparing things like AVX2 and SSE2, the time value is better because those shouldn't affect multithreaded scaling.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst