Description

ChaosCacheManager (CCM) is not reproducing Collision events the second time (and onwards) we record a Geometry Collection (GC) breaking session. Particles set to track Collision Events correctly follow the position of the Collision events when the GC is physically simulated, and still work once recorded the first time around, but once we record the destruction event with CCM a second time and Play it, no Collision Event is fired and those particles do not show. Please check the Repro project and the repro steps for more information on the matter.
I've tried to follow the code up and it looks like the events are being recorded the first time, but when recording the second time they are not added. I'll attach the call stack for the particular code that do the recording. I've also attached a few relevant imagery to the case, please refer to it for further context.

Test results:
UE version Error is reproduced
Vanilla 5.0.3 Yes
Vanilla 5.1.1 Yes
Vanilla 5.2.1 Yes
Vanilla 5.3.2 Yes
Vanilla 5.4.4 Yes
Vanilla 5.5.4 Yes
Perforce 5.6 (latest) Yes

Steps to Reproduce

I'll attach a repro project to speed up the reproduction process, since the setup is a bit long.
Using the repro project, the ReproMap3 level should open up.
Select ChaosCacheManager0 (CCM0) and confirm it's CacheMode is in RECORD.
Confirm GC_Cube has all Notify Events enabled (Collision, Trail, Break, Globals, etc.)
Open up ProjectSettings>Physics>SolverOptions: and confirm Generate Collision Data, Generate Trailing Data, Generate Break Data, are all enabled
Play-In-Editor (PIE) (ALT+P) to enable the GC_Cube to hit the floor and shatter - notice the different particles that spawn at the position of each kind of event (Break, Trail, Collision)
Select CCM0 and set CacheMode to Play.
PIE and notice the particles that spawn when running from the CCM recording: Break and Collision particles show (Trail particles do not).
Set CCM0 to RECORD again.
PIE and let the GC_Cube hit the floor and shatter - all particles show up.
Set CCM0 to Play again.
PIE and notice only the Break particles show up, both Collision and Trail particles do not.

Expected result: Collision particles should show up once we are playing the CCM recorded session, regardless of how many recording sessions we had
Actual result: Collision particles do not show up the second time we record the GC being broken.

Callstack

> UnrealEditor-ChaosCaching.dll!UChaosCache::FlushPendingFrames_MainPass<0>(TQueue<FPendingFrameWrite,0> & InPendingWrites, bool bCanSimpleCopyChannelData) Line 188 C++
UnrealEditor-ChaosCaching.dll!UChaosCache::FlushPendingFrames() Line 358 C++
UnrealEditor-ChaosCaching.dll!??R<lambda_1>@?1??FlushAllCacheWrites@UChaosCacheCollection@@QEAAXXZ@QEBA@H@Z(int InIndex) Line 113 C++
[Inline Frame] UnrealEditor-ChaosCaching.dll!UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::FFunctionRefStoragePolicy,void __cdecl(int)>::operator()(int <Params_0>) Line 470 C++
[Inline Frame] UnrealEditor-ChaosCaching.dll!ParallelForImpl::CallBody(const TFunctionRef<void __cdecl(int)> &) Line 80 C++
UnrealEditor-ChaosCaching.dll!??$ParallelForInternal@V?$TFunctionRef@$$A6AXH@Z@@V<lambda_1>@?1??ParallelFor@@YAXHV1@W4EParallelForFlags@@@Z@$$T@ParallelForImpl@@YAXPEB_WHHV?$TFunctionRef@$$A6AXH@Z@@V<lambda_1>@?1??ParallelFor@@YAXH1W4EParallelForFlags@@@Z@2AEBV?$TArrayView@$$TH@@@Z(const wchar_t * DebugName, int Num, int MinBatchSize, TFunctionRef<void _cdecl(int)> Body, ParallelFor::_l2::<lambda_1> CurrentThreadWorkToDoBeforeHelping, EParallelForFlags Flags, const TArrayView<std::nullptr_t,int> & Contexts) Line 143 C++
[Inline Frame] UnrealEditor-ChaosCaching.dll!ParallelFor(int) Line 511 C++
UnrealEditor-ChaosCaching.dll!UChaosCacheCollection::FlushAllCacheWrites() Line 107 C++
UnrealEditor-Engine.dll!FActorTickFunction::ExecuteTick(float DeltaTime, ELevelTick TickType, ENamedThreads::Type CurrentThread, const TRefCountPtr<FBaseGraphTask> & MyCompletionGraphEvent) Line 284 C++
[Inline Frame] UnrealEditor-Engine.dll!FTickFunctionTask::DoTask(ENamedThreads::Type CurrentThread, const TRefCountPtr<FBaseGraphTask> &) Line 306 C++
UnrealEditor-Engine.dll!TGraphTask<FTickFunctionTask>::ExecuteTask() Line 634 C++
UnrealEditor-Core.dll!UE::Tasks::Private::FTaskBase::TryExecuteTask() Line 504 C++
[Inline Frame] UnrealEditor-Core.dll!FBaseGraphTask::Execute(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> &) Line 482 C++
UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 779 C++
UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 668 C++
[Inline Frame] UnrealEditor-Core.dll!FTaskGraphCompatibilityImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type) Line 1453 C++
UnrealEditor-Core.dll!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete(const TArray<TRefCountPtr<FBaseGraphTask>,TSizedInlineAllocator<4,32,TSizedDefaultAllocator<32>>> & Tasks, ENamedThreads::Type CurrentThreadIfKnown) Line 1526 C++
UnrealEditor-Engine.dll!FTickTaskSequencer::ReleaseTickGroup(ETickingGroup WorldTickGroup, bool bBlockTillComplete) Line 815 C++
UnrealEditor-Engine.dll!FTickTaskManager::RunTickGroup(ETickingGroup Group, bool bBlockTillComplete) Line 1866 C++
UnrealEditor-Engine.dll!UWorld::RunTickGroup(ETickingGroup Group, bool bBlockTillComplete) Line 774 C++
UnrealEditor-Engine.dll!UWorld::Tick(ELevelTick TickType, float DeltaSeconds) Line 1496 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 2140 C++
UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 550 C++
UnrealEditor.exe!FEngineLoop::Tick() Line 5877 C++
[Inline Frame] UnrealEditor.exe!EngineTick() Line 69 C++
UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 188 C++
UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 266 C++
UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 317 C++
[External Code]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-263043 in the post.

1
Login to Vote

Unresolved
ComponentUE - Simulation - Physics
Affects Versions5.5.4
Target Fix5.7
CreatedMar 28, 2025
UpdatedApr 9, 2025
View Jira Issue