Crash during seamless travel when using Mover

Hello !

We are currently working on a single player project using Mover to move our characters.

Unfortunately we are encountering issue when changing level.

We are currently using Seamless traveling as our mean to change level and keeping different actors during this transition such as our player character. When seamless travelling this way, we encounter a crash in the update of the UNetworkPhysicsComponent (UpdateAsyncComponent) where the PhysicsObject is completely erroneous and especially the Solver. This issue arrise both in build and in editor, with the setting net.AllowPIESeamlessTravel = 1 being enabled for the PIE.

We think the reason is because the PhysicScene is destroyed during the seamless travel, but the component isn’t cleaned-up. Does Mover support the seamless travel ? Is this a known issue and do you have an idea of how it circumvent or fix the issue ?

[Attachment Removed]

Steps to Reproduce[Attachment Removed]

Hi,

I don’t believe we’ve encountered this issue before, as I’m not sure how much testing we’ve done for seamlessly travelling with Mover. That being said, I wasn’t able to reproduce this issue myself, so to get a better idea of the problem, I have a couple of questions.

First, could you provide some more information on how your mover character is set up?

Next, you mentioned that you’re using seamless travel to keep the player character through the transition. Could you share exactly what you’re doing in your project’s GetSeamlessTravelActorList functions (on the game mode and player controller)?

Finally, if you’re able to reproduce this in one of the test maps from the Mover Examples Content plugin, that would be very helpful in further debugging the issue.

Thanks,

Alex

[Attachment Removed]

Hello again !

What type of information would you need for the Character Mover setup ? We currently are using the PhysicsMover and the UNetworkPhysicsComponent.

As for the content of GetSeamlessTravelActorList :

- In the GameMode, We start by calling the Super, then add the PlayerCharacter, the PlayerController and the PlayerCameraManager to the list

- In the PlayerController we didn’t override the function.

And we tried to reproduce the issue in a separate project without success. Though we found that in our current project, deactivating the NetworkPrediction seems to fix the issue (Meaning we can seamless travel), but breaks the Mover.

We also ran Address Sanitizer in the Editor and found that there’s a Heap-Buffer-Overflow in the function Chaos::FChaosMarshallingManager::AddSimCallbackInputData_External which is the last line of the crash callstack :

AddressSanitizer: heap-buffer-overflow on address 0x11fae8■■■5c0 at pc 0x7ff83a329d7b bp 0x000dccd6d8d0 sp 0x000dccd6d8d8

READ of size 8 at 0x11fae8■■■5c0 thread T0

#0 0x7ff83a329d7a in Chaos::FChaosMarshallingManager::AddSimCallbackInputData_External

After digging a bit deeper, the address in question is the Solver->ProducerData of the MarshallingManager.

[Attachment Removed]

Hello, I’m Markus from the chaos physics team. We have not approached seamless travel with the UNetworkPhysicsComponent or the physics-based character yet so there might be more than one issue in that area.

I will try to reproduce your issue and see if I can give you a fix / workaround to unblock you.

I’ll also add seamless travel to my todo list and will try to get that supported with the NetworkPhysicsComponent for UE 5.8

[Attachment Removed]

Hello again, I have now reproduced the issue locally. For context, with async physics we have ISimCallbackObjects that tick on the physics thread and they also handle sending data between game thread and physics thread safely via “AsyncInput”. These ISimCallbackObjects does not have any logic to support being part of a seamless travel, they are expected to be destroyed either along with the owner of it or when the solver is destroyed.

But when setting the physics-based character to do a seamless travel there are at least two ISimCallbackObjects inside the character logic that are kept alive while the physics solver gets destroyed during the travel process.

The logic will then try to access this ISimCallbackObject which results in a crash.

In a simple example I made to repro it I could work around the crash by overriding OnRegister() and OnUnregister() inside UNetworkPhysicsComponent and calling the same logic as in InitializeComponent() and UninitializeComponent() to delete the ISimCallbackObject and then create it again after the travel, under the condition that HasBeenInitialized() was true since the original initialization should happen in InitializeComponent.

The physics-based character itself has a NetworkPhysicsComponent and it also has its own ISimCallbackObject inside UChaosMoverSubsystem called UE::ChaosMover::FAsyncCallback.

It’s being created in UChaosMoverSubsystem::OnWorldBeginPlay() and destroyed in UChaosMoverSubsystem::Deinitialize(), these logic in there would also need to be made to run before and after a travel, for example via OnRegister and OnUnregister or via other fitting callbacks.

You could probably use the delegates FWorldDelegates::OnSeamlessTravelStart and FWorldDelegates::OnGameInstanceWorldChanged also to delete and create the ISimCallbackObject.

I’d recommend not to use Seamless Travel with the physics-based character for now, but if you need to use it then you need to locally make the above changes to the engine, though I can’t guarantee that they will work in 5.6 or that something else doesn’t pops up and causes issues along the way.

[Attachment Removed]

Hello !

Thanks for the explanation, we were able to circumvent the issue by Unregistering the UMoverNetworkPhysicsLiaisonComponentBase from the MoverManager. We then destroy this component and start the seamless travel. After the seamless travel, we initialize once again the component and register it back in the MoverManager.

We also fixed another issue during level transition by adding a UPROPERTY(Transient) on the field : MovementBaseDependency in the MoverComponent.

[Attachment Removed]

Good that you found a workaround for the issue!

I’ve now made the NetworkPhysicsComponent not crash (and also work with networking) after Seamless Travel for UE 5.8 and we will be scheduling work to make the physics-based character work properly with seamless travel also.

[Attachment Removed]