Requesting a Way to Opt Out of Overlap Updates when Changing Collision Responses

When changing the collision settings of an object by calling the various collision response setting functions, it will always result in an overlap update. Calling UPrimitiveComponent::SetCollisionResponseToChannel calls UPrimitiveComponent::OnComponentCollisionSettingsChanged, with the update overlaps parameter always defaulting to true. We have situations where we want to change a component’s collision channel response during BeginPlay based on some designer-accessible settings, and this results in an unavoidable overlap update that we don’t need. As an optimization, I was planning to change four UPrimitiveComponent functions (SetCollisionResponseToChannel, SetCollisionResponseToChannels, SetCollisionResponseToAllChannels, and SetCollisionEnabled) to mimic SetCollisionProfileName, which allows you to pass in an optional bUpdateOverlaps parameter that defaults to true, which gets passed to OnComponentCollisionSettingsChanged. This way we could opt out of unnecessary overlap updates, but it wouldn’t affect any existing calls of these functions. Is this something that you would consider implementing?

Thank you.

Hi Elias,

Apologies for the delay in responding to this ticket, we had a company wide shutdown for 2 weeks and have been catching up!

I will reach out to the dev side to see if there is a workaround for this. You’ve mentioned this as a potential optimization, can I find out what sort of timings are you seeing for this?

Is this only for development - it sounds like this will be locked down when the game is released?

Best

Geoff Stacey

Developer Relations

EPIC Games

Hey Geoff,

Thanks for your response, no worries about the delay. Yes we do intend to use this as an optimization, mainly when actors stream in through world partition. The timings can vary since the amount of time it takes to update overlaps varies. In a fairly bad case, for a frame where 20 actors are being added to the world and having their BeginPlay called, UpdateOverlaps is being called over 100 times. The total time for those actors’ BeginPlay is 8 milliseconds and the total time taken by updating overlaps is 3.3 milliseconds, so it’s almost half.

This wouldn’t just be for development. I’ll try to give an example of where this would impact us: we have a component that lets an actor be interacted with. To allow interaction to happen, the actor’s mesh components need to block a certain collision channel. We have too many actors that are interactable to manually check collision on all of them, so in the interact component’s BeginPlay it sets the collision response to that certain channel on all of the owning actor’s mesh components. In this example, it’s going to call UpdateOverlaps on every component that has its collision setting changed, even though it’s streaming in and the overlap update is unnecessary. It also doesn’t matter what is set for the actor’s UpdateOverlapsMethodDuringLevelStreaming setting, which we have set to NeverUpdate for most actors.

Thanks,

Elias

Hello,

Just following up to see if there was any response from the devs on this.

Thanks

Apologies Elias, I’ll follow this up and get back to you today or tomorrow!