Collision Pairs: optimizing performance of bullet hell / enemy hell games

Hey Alex!

I’ve really enjoyed this info, after first coming across your comments here:

I am genuinely struggling to solve this myself at the moment. I must be misunderstanding something, so if you could run me through some tips I would be very grateful.

I have a simple Node3D with a single Area3D that is on an “Enemy” layer and checking the “Player Mask”
I currently suffer insane FPS drops because of 30k collision pairs. Disabling the collision shape immediately drops it down to 50.
My question is, how is it possible those are all collision paired? Surely they shouldn’t be checking for each other?

What’s more I’ve only got a On Body Entered check, while these offending nodes only have an Area (That way it only ever can trigger on the player. I am not checking for groups.)

I liked your idea of the collision shapes disabling or enabling themselves based on distance. However, adding that check (I was trying to put it in the physics process of the offending node) immediately drops the FPS down again as it seems the hundreds of nodes are constantly checking if the player is in range.

Again, I’m a little stumped. I feel like I am overlooking something very silly. Any advice would be very welcome. Thanks for listening to my ramble haha.

EDIT:
It’s not the simple enemy’s interacting with each other it seems, but rather something interacting with all the enemies. Ended up remaking the main scene bit by bit, and all my previous fixes (thanks to your post) must’ve helped tons as I was able to reduce the collision pairs to around 900-1000 in a fresh scene.

I think I’ve got compounded issues which can make it hard to detangle it and point to the source.

Thanks again, your post has been very informative.

1 Like