Collision Traverser Question [SOLVED]

I’m working on setting up some collisions in my game. My intention is to break up the level by region to reduce the number of collision checks necessary each pass. When I was thinking of how to do this, I decided I needed to have my regions overlapping slightly to make sure that potential collisions didn’t go undetected at region borders. The problem this presents is that there are times when a character may be in the overlap between two regions, and thus must be checked for collision by objects in both regions.

I had originally thought that I would just parent the objects in a given region to a particular node and feed that node to the traverser. Since a nodepath can only have one parent (I think) it doesn’t seem like this is a viable option because of those times when things are in two regions. I was thinking instead that I might make lists of ojbects that correspond to regions, since I can put a nodepath into multiple lists, and then traverse each object in the appropriate lists individually.

My question is, will doing alot of little collision checks be more wasteful of system resources than doing one big collision check? Is that something I should worry about? Is there another way to get around this problem that would be better?

lots of little and one big boil down to the same… lots and lots of colilsion checks.
the art is. to avoid all unnccessary checks.
that means. structure your nodes that as many checks as possible can be avoided.
quadtree or octree structures are very good for this purpose.
i suggest you search for treeform’s octree script. it’s very useful to create highly efficient collision geometry from real visible geometry.

Unfortunately the egg octree isn’t quite what I’m looking for, since I’m using multiple eggs to create a dynamic world instead of a static world in a single egg. You did answer my question though, so thanks. :slight_smile:

There is planty of scripts to do what you want too.

I recommend using the GeomOctree (not written by me).
1 You load your dynamic map.
2 walk your entire scene
3 put all the static goems collisions into your collision octree.
4 use your collision octree for collision form now on

github.com/treeform/eggOctree