| |
|
|
||||
![]() |
||||||
| |
|
|||||
|
BSP Collision Detection As Used In MDK2 and NeverWinter Nights Potential Inaccuracy
and Beveling
As mentioned
previously, our technique (and similar techniques that simulate the
object as a point) are subject to a certain degree of inaccuracy. This
is illustrated in the adjacent figure. Two spheres, A and B, collide
with the geometry below them. Using the center of each sphere is its
reference point, the environment's geometry is offset outward as represented
by the dotted lines. The center of each sphere rebounds off these offset
planes. As sphere A moves along its trajectory, the collision occurs
before its perimeter contacts the surface. For comparison, sphere B
will rebound with an appropriate impact point and direction of deflection.
Most of
the time, the protrusion of solid cells is tolerable, but the error
starts to increase dramatically as the angle between adjacent planes
approaches 180 degrees. We reduce this problem by beveling the solid
cells of the BSP tree. This is achieved simply by inserting additional
nodes at the bottom of the tree. When the planes are offset during a
collision query, the solid cell no longer protrudes as far as it did
without the extra nodes.
Performance Overhead
We compare 3 methods of collision detection: regular BSP collision (labeled Ray), spherical offset, and cylindrical offset. Each method received the same input parameters, including the player's current position and desired new position for that frame. Nothing but BSP traversal code contributed to the times. Testing was done on a Pentium 3, 400MHz. Our results show that plane shifting collision detection can be 2.5 to 3.5 times more expensive. Putting these results in context, at 30 FPS, each frame allows 33000 microseconds. We felt an additional 20 to 50 microseconds for a character's collision detection was worth the flexibility of allowing different sized characters and objects in our game. We also noticed that the performance did not vary that much from one frame to the next. In a 3D interactive application, a good frame rate must be maintained at all times - not just in the "average" case.
The BSP
compiler required non-self-intersecting borderless 2-manifold geometry
as input. 3DS Max doesn't automatically place modeling constraints on
the content. Therefore, extra work was required for the artists to get
the models to comply with our requirements.
NWN uses a similar art production pipeline to MDK2. Similar to the BSP modifier, there is a modifier that computes bounding box hierarchy information. Future Games in general could start doing more with being able to manipulate physical objects in the environment. I'd like the ability to rearrange some of the objects while playing a game so I can make myself a better camping spot to get more kills with my AWP. As I confessed, our BSP production wasn't perfect. I'd like to improve this while still allowing the artists to model as they do now. They appreciated being able to use 3DS Max. I would want to continue to let them make non-convex geometry, but have some better tools to find and possibly fix the problems that can occur. The single big mesh approach from MDK2 was more work and was very unforgiving when errors did occur. It would be better to allow for multiple objects or meshes and let them interpenetrate with each other. I've already started testing an extension to the BSP collision algorithm with general motion. It works, but more testing is required to measure performance gains over more accurate techniques. Although there can be some inaccuracy, the algorithm may be appropriate when there are many objects, they are fast moving, or when they are of lower priority. For any
references and follow up to this presentation, please see the web page: ________________________________________________________ |
||||||||||||||||||||||||||||||||||
|
|