Re: Space Wars

From: Andrew Wilson <awilson_at_seanet.com>
Date: Mon Nov 29 1999 - 15:36:44 EST

> Remember, don't bother with checking a bounding box first. If there is
>enough CPU to do a full collision detect sometimes, then there is enough
>CPU to do it every time :-) Unless you have a way to steal CPU cycles from
>somewhere else when you need them.

        Gotta disagree here - a frame rate skip for the fraction of a second
when a bullet is right near your ship is much more desirable than a constant
framerate skip. Most of the time, if the bullet is that close, it's gonna hit
you anyway, and the hiccup won't even be noticed.

        If you *can* get the CPU to do full collision detection, more power to
you. But it's a pretty standard game programming practice to use bounding boxes
to eliminate collision checks wherever possible, to improve framerate.

        On second thought, I guess Paul was correct - you *do* have somewhere
from which to steal CPU cycles - the main drawing loop. The key is to shrink
the times when you need to steal cycles - if you *never* need to, that's great,
but if you can't get that kind of efficiency from your collision detector, then
the next best thing is to cut down on how often you need to use it via bounding
boxes/trivial rejection.

                        Drew
Received on Mon Nov 29 14:37:07 1999

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2003 - 00:32:31 EDT