Collisions: What do you recommend?

Blitz3D Forums/Blitz3D Programming/Collisions: What do you recommend?

Sake906(Posted 2008) [#1]
Perhaps this is a dumb question I could answer myself.

Lets imagine we have many entities from the same "type" moving around, shooting their weapons (all having the same weapon collision type, moving fast) and their owners all have hit boxes or areas that define where the damage has been taken.

These hitboxes are defined with polygon meshes: the method on which weapons collide with them is ellipsoid to polygon. This runs fine only until many of these "players" have been created and are all shooting immense amounts of bullets and executing line picks on each of those hitboxes, again using the polygon approach. Slowdown is unbearable.

Would it be really worth it to replace the polygon hitboxes with a bunch of small ellipsoid bounding spheres (no matter what system I use to identify them as a whole) no matter if there are hundreds to thousands of them?

Would this also have a great impact on speed with picking commands?

I do come here to ask because yesterday I tried having many "bouncing rockets" to also take the polygon hitboxes into account. As their number reached about fifty entities, there was a terrible slowdown until I simply disabled their collision checks with the moving "poly" hitboxes, yet still letting them collide with the ground and other ellipsoid entities around the place that were also moving. Speed increase was significant.


Naughty Alien(Posted 2008) [#2]
..use physics engine for that..its light speed..


Sake906(Posted 2008) [#3]
..uhm.. I was kind of expecting for an answer that relies on blitz3D alone, but thanks anyway :/


Naughty Alien(Posted 2008) [#4]
well..integration of existing physics engines in to B3D is really 1 minute job and its working really really fast...believe me, you dont want to use B3D picking commands..


Sake906(Posted 2008) [#5]
Not picking commands but simply collisions...

But I guess that in the end I will have to get a physics engine anyway. Any recommendations on that area?


Nate the Great(Posted 2008) [#6]
I am working on my own verlet physics engine in the bitz3d beginners area It has worked well so far It is getting faster every time I add to it :)

If you are going for speed, you could program your own in C or get devil physics engine for free.