We are observing kind of a hitch on ChaosCloth initializaction in FClothingSimulation::CreateActor each time we spawn any new character actor that uses cloth.
We are also testing ChaosClothAsset approach, initialization time is pretty similar, it just moved to FClothSimulationProxy::FClothSimulationProxy.
It always happens on main thread and takes up a few ms.
What can we do in general, about cloth initialization, to make faster?
In addition to this, there’s this public issue tracker that shows Chaos Clothing CreateClothActor taking a long time with LODs and Self-Collision, and was fixed in 5.6. (Unreal Engine Issues and Bug Tracker (UE\-204424\))
If you’re looking for more immediate improvements aside from updating, reducing the cloth complexity could help.
A sure way to pin point what part of initialization is taking the most time would be to utilize a profiler like Unreal Insights. This would narrow it down to if it’s the cloth asset, simulation setup, or another area.
We have sucessfully integrated two perforce changes needed to fix mentioned issue UE-204424 (perforce main CL 38186035 and 37460700).
It introduced p.ChaosClothAsset.EnableAsyncClothInitialization, we evaluated this option and looks like it is working, most of the cloth initialization work is now done async.