The main performance hit here is inserting new events to the front of the array once it gets very, very large.
Issue is mitigated by changing UNiagaraDataInterfaceChaosDestruction::HandleBreakingEvents to push new events to the end of the BreakingEvents TArray.
Steps to Reproduce
After many hours, UNiagaraDataInterfaceChaosDestruction::HandleBreakingEvents starts taking a very long time due to the BreakingEvents TArray expanding forever over time - the code that resets it in UNiagaraDataInterfaceChaosDestruction::BreakingCallback never gets hit.
Additionally, per chaos counter stats:
When a destructible is fully fractured, the NumDisabledBodies counter goes down by the number of pieces that mesh has been set up to fracture into and then goes back up by that number.
But if just a single piece is broken off, then the NumDisabledBodies counter increments and never goes back down.
Unclear whether engine bug or incorrect method being used to reset geometry collections.
Hi Bill, apologes for the slight delay in getting back to you. We are looking at a fix at the moment (probably similar to what you’ve looked at, but there is another system which we may be looking to use. I will ping a changelist for you to integrate once we have it, and I’ll raise a public bug tracker as well.
All the best
Geoff Stacey
Developer Relations
EPIC Games
Hi Bill,
This has now been fixed in CL 44507037.
Best
Geoff