CollisionHandlerQueue or CollisionHandlerEvent

Seems I have to decide between the two.
My scenario … In my game there are spaceships (into) and projectiles (from). Nothing else. Spaceships can’t collide with each other, only projectiles and ships.

Until now I used CollisionHandlerEvent. The good part was that ships and ships wouldn’t trigger a collision. The problem was that often ships would overlap. That means that when a missile would spawn it would immediately collide. Two collisions in the same moment I suppose, missile with ship that spawned it and missile with target ship. In that case things would often crash when I requested a tag via

node.getTag("tagname")

At least that’s my theory. On the first collide (missile with target?) the getTag would still work, then the projectile would be removed. The second collision happening at the same moment (missile with ship that spawned it) would cause the crash becaue the node that has the tag is no longer there.

I prefer using CollisionHandlerEvent but then I had to solve the above problem and I don’t see how.

Besides that it happened quite often that the rocket would simply move through a target without triggering a collision. Why that happens I have no idea. If two missiles would arrive at the same frame I would understand but not like this.

So that’s why I am think of using CollisionHandlerQueue. Problem is that now I got all those ship-ship collisions. I would like to have a cheap check for ship-ship collisions and then only trigger a collision handling function if that is NOT the case (ship-missile).

What would such a cheap check be? I thought about comparing the names of the collision geometry nodes, because thats the same for all missiles (render/shot3d/ShotCNode) or ships (render/shipname.egg/ShipModelCNode).

Or, I would set a tag on all nodes and check those for equality.

Ideas?

just check if that tag still exist with hasTag().

that’d be sphere/box vs sphere collision. Box vs (box, segment, line) aren’t implemented yet.

I’ve done them all there :
panda3d.org/forums/viewtopic … 1845#61845