Spatial Culling
Spatial Culling is an optimisation used to avoid rolling back every rollback component in the world every time a new rollback is triggered. When creating a new UGSPendingRollback type, overriding UGSPendingRollback::FilterPotentialRollbackComponents
will allow you to define custom logic on which rollback components to include. The default implementation will include all components so it is important that this is implemented.
Each rollback proxy also records each of their tracked components bounds every frame. This can be used to calculate a composite bounding box for all of the actors bounds between the time of rewind and the current simulation frame. If your test hits this bounding box, where the test is for example the path of a projectile, you know that there is a chance that the projectile could have hit and therefore a rollback is required.
You can see in this Visual Log that there are 3 bounding boxes for 3 separate characters. One is the instigator which is ignored so it is drawn in black. The other two are characters that can potentially be hit so are drawn in orange and the collision is also shown. The left character is hit so the complex collision is tested against but as the right character was not hit by the trace, the complex collision was never needed.
Below is an example of how linear projectiles are culled by intersecting the trace against each of the rollback target bounds. If the trace intersects, it means the projectile could potentially hit the target and the rollback logic should be executed.