Chaos number of iterations poisoned by geometry collection

Hello,

We have observed some weird behavior with suspension constraints in 5.7, tracking it down it seem to be caused by FPBDConstraintGroupSolver::ApplyPositionConstraints looping many more times than set in Project Settings (8 in this case), we were seeing values of 127 (for all iteration counts) which is the max for FIterationSettings8.

Tracking down where this came from it seemed to be from a Geometry Collection which had its bad settings merged in. In the function UGeometryCollectionComponent::RegisterAndInitializePhysicsProxy we pull out the *SolverIterations values from the BodyInstance, in 5.7 these functions have been modified to return -1 when not overriden, the problem is that the destination storage for these values (FSimulationParameters in GeometryCollectionSimulationCoreTypes.h) has a type of uint8 so it gets set to 255, and later when merged in it gets clamped to 127 and starts causing issues with our simulation and worse performance.

We locally fixed this by changing the types to signed in FSimulationParameters since it seems most other locations use signed values and represents default (use Project Settings) as -1.

Best regards,

Robin Krokfors

Steps to Reproduce

  1. Create new Empty Project
  2. Create a cube and fracture it
  3. Hit play and check number of iterations in FPBDConstraintGroupSolver::Apply*Constraints functions are set to 127 for island groups with the GC particle

Hi Robin,

Thank you for raising this. We are in the process of submitting a fix already, I’ll ping back here when we have the CL for you to get.

Best

Geoff Stacey

Developer Relations

EPIC Games