Hi, I’m using the DOTS (Rival) Platformer sample character controller as a starting point for my project.
I use around 1000 individual character controller entities active simultaneously. I set the CollisionFilter in the Physics Shape component of my Character Prefab to not collide with other copies of itself. The Rival character controller is such a marvel of ingenuity that I can pull off over 1000 of these entities running at the same time with well over 60 fps on a modern gaming laptop.
However, I notice a drop to less than 10 fps when the entities overlap at the same position. This is unexpected to me because it runs fine when they don’t overlap, and this tells me it has something to do with the collision system even though the CollisionFilter was set to ignore copies of itself. I know the CollisionFilter I set up (referenced above) is working on some level though, because the entities can pass right through each other otherwise and don’t collide.
The profiler shows that the item taking up the most CPU usage during the entity overlap is the Burst-compiled PlatformerCharacterPhysicsUpdateSystem with the PlatformerCharacterPhysicUpdateJob. I’ve been digging into the function over the past couple days trying to troubleshoot why the Job takes so long when these entities are overlapping, but my troubleshooting takes me into the base Rival Character Controller code which I’m hesitant to modify.
I noticed that disabling Detect Movement Collisions and Decollide From Overlap in the Platform Character Authoring component help improve performance slightly (up to +5 fps), but still less than expected, and then also the entities go through walls which is undesired so this probably isn't the solution.
Is this a bug, or is there a setting in the Platform Character Authoring I can change to prevent the slowdown?
I can provide steps to recreate the issue from the if needed.
Tagging @fresh portal because he's the beast who created Rival.