Collision envent's limitations

Hello,

Here’s few PStats’s screenshots :

The first peak reprent my avatar.
The second one represent the second avatar just being rendered :

Starting here, things start to slow down :
A third character being rendered:

Two additionnal characters (five in all and here it’s a disaster) :

Well, is this suppose to be a normal behaviour ?
Knowing that I’m using for each character a collisionPusher (on a collisionSphere) and collisionHandlerFloor (on a collisionRay) and each has its own bitmask. Also, there is no drastic code being applied (nothing for the pusher and just setZ for the ray) and not any huge collision mesh neither.

I didn’t go that far until here (I am supposed to add a collisionHandlerEvent to handle other collisions stuff) and there is no need too as thing are really slowing down starting the third character…

So, am I missing something ?
Is it a Panda limitation ?

Thanks for your opinion :wink:

Those collisions are way heavy. That’s not a Panda limitation, because it’s certainly possible to design lightweight collisions in Panda; but like anything else, this does require a little bit of care.

I can’t tell you what is particularly heavy about your collisions, but I suspect you’re performing tests with more geometry than you want to be. It’s possible also that you’re testing against visible geometry (which is way more expensive) instead of collision geometry. Another common mistake is to have many thousands of tiny collision polygons in the scene, instead of a few hundred large polygons.

David

I’m not showing the collisions spheres and rays.
Mmh… That might be my terrain then! I’ll go that way and will check removing the pusher and create a very low poly collision mesh with retopo and come back to you.

Thanks David :wink:

Hey :slight_smile: It’s working much more better now!

I considerably reduced my terrain’s vertices, from 10.000 to 450 (yes! That was a big terrain). I didn’t focused on that when creating it as I already asked if there was somekind of limitations (https://discourse.panda3d.org/viewtopic.php?t=7740).

So, if I understand correctly : there is no limitation fo creating a terrain but the collision mesh which belong to it must be as less vertices as possible.
Now the real art is to know how to create collisions meshes that fit the original terrain without having strange behaviours like avatar flying in the air or walking underground…

Have you looked at Octree?
github.com/treeform/eggOctree
discourse.panda3d.org/viewtopic.php?t=2502

We got levels with 1000’s of polygons working fast with it.

Tried that but it’s not working for me. I’m having this error:

And I’m not having access to that directory (As you can see, I’m on Mac). I tried to change the location of the eggoctree.py file and updating it within blender but still having this error!