gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > BSP help please

#118802 - iainprice - Fri Feb 16, 2007 10:39 pm

I have done quite a lot of coding... collision detection, sliding plane collisions etc but they are all too slow. Maths is easy. I want to do BSP but am having a lot of problems. Has anyone clever got a spare hour to knock up a simple ds program that converts a list of quad polys to a bsp tree. Then a ds program to display that tree.

Any help is really appreciated because I have lot of documentation from the net but I can't convert it to nds... or at least make it display sensible results...

#118804 - sajiimori - Fri Feb 16, 2007 10:50 pm

An hour? Hah... hahah. No, BSP collision takes a while to get right. But it is very fast, and worth the effort.

Check out the Quake 1 tools for an example. He builds a few precalculated trees with the planes shifted for specific sizes of objects. That way all the collision tests can use rays at runtime instead of boxes.

I do the plane shifting at runtime for arbitrary object sizes. It's not that much more expensive, and it saves memory by having only one BSP tree.

Two books that helped me were: "Collision Detection in Interactive 3D Environments" by Gino Van Den Bergen and "Real-Time Collision Detection" by Christer Ericson.

There are a lot more issues that only become apparent upon trying to use BSP collision in a real game. Let me know if you have any questions!