Godot native collision detection vs custom quadtree implementation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bean-bon

A bit of a technical question. I’m messing around trying to build 3d rts / tower-defense like game and I was wondering how effective is collision detection in godot.

In my particular case I’m thinking of checking a good number of collisions (mostly circles / spheres) against a large number of objects (think tower attack range / aoe effect against enemy). Would it be worth while to consider building a custom quadtree implementation to handle enemy positions / collision check. One major aspect for this would be utilizing Vector2 and handling everything on a 2D plane (for most part the Y element is irrelevant, specially for range/collision detection, in my use case).

Would I be loosing out to built in detection due to Vector3 to Vector2 translation (to simplify data structure) or could I potentially see some improvement ?

The way I see it is as a trade off where I forgo “easy solution” (quadtrees seem an interesting concept to code up) for ponteitally tiny gain in performance but also freeing up physics / collision for other use cases.