Future of Chaos, PhysX and other physics engines

Good afternoon,

I know, that PhysX was deprecated by the ~UE 5.1, though even now there are a lot of leftovers of PhysX can be found in code (speaking of UE 5.6.0), including not used code, forward declarations and some actor properties which are marked [PhysX Only] (but not used). So I have couple questions related to physics engines and current plans.

  1. Are there any plans to remove PhysX leftovers completely? At least, removing forward declarations of PhysX classes allow developers to integrate PhysX 5+ (PhysX 5 has templated PxQuat<T>, while UE declared PxQuat, so basic type violated ODR). I was toying around adding PhysX as a plugin, and it immediately failed because of ODR violation. I prepared a pull request, which removes all exposed forward declarations (to make future integrations possible)
  2. I assume one of points, why PhysX had been removed, were LWC and closed-source. Since PhysX 5 supports double-precision math, as well as it’s now open-source, are there any plans to re-introduce PhysX 5 as an option alongside with Chaos?
  3. PhysicsSettingsCore.h contains bEnable2DPhysics setting (default false), which is not used anywhere in code. Is it deprecated (and should not be used), and Box2D physics engine is not available for use?
  4. There are a lot of abstraction classes/interfaces in physics code, but I see that normally code is coupled to concrete Chaos types. There are some physics engines integrations, like Jolt engine for Unreal YouTube made as a custom plugin, “stealing” shapes from PrimitiveComponents + syncing bodies back. Developers of Brickadia actually reintroduced PhysX library based on UE 5.0.3 code, upgraded engine to UE 5.1 and then updated PhysX 3 -> 5. I know that Havok is highly integrated into Engine code and requires engine source changes to be made (this allows better integration with Unreal Engine). I understand why people want to have other physics engines: because of preferences on debatable topics like XPBD vs Impulse solvers, determinism, multi-threading or performance. Are there any plans to make more abstractions and extensions points (e.g. to have another physics engine as a game/engine plugin), or engine generally moves to less abstractions and more coupling to Chaos?

There is no urgent need to integrate one of other physics engines, but it’s good to know, where Unreal Engine moves.

Best regards

Hi Bohdan,

Our physics engine is Chaos moving forward, over time some of the abstraction code will be removed as we do work in that area. Box2D isn’t supported internally, but is very mature so likely to be available for a long time (although I’d check with the creator if you need certainty).

Of course with us being open source, other creators can provide alternatives if they like, but they won’t be supported in house.

Best

Geoff Stacey

Epic Games

Not a worry at all Bohdan :slight_smile:

I’ll close this off then.

Best

Geoff

Hi Bohdan,

It does in a sense, but we don’t tend to take breaking changes outside of major versions - there is a scope for anyone who has stuck with Physx to suddenly find their game is breaking after a minor version change.

It seems like something we’d look to do in the next major version.

Best

Geoff

Hi Bohdan, apologies I’d got this the wrong way around (I’d mentally mapped this as stripping out support, not stripping out an issue as you said at the start).

This may be something we’ll do at some point in the future, but we’d approach it a bit differently.

Geoff

Great stuff Bohdan, I’ll close this off then!

Best

Geoff

Hello Geoff,

Thanks for the information!

I know about Box2D itself, but I was surprised to see Box2D project setting.

Best regards,

Bohdan

Sure

One more thing - does the pull request make sense? Or you have a bigger rework on leftover code in near future?

Best regards

Hello Geoff,

No problem! Thanks for the effort and looking forward for cool changes. Case can be closed.

Best regards