Advertisement

Square bounding box or circle?

Started by August 10, 2003 07:38 PM
3 comments, last by Sfpiano 21 years, 5 months ago
I''m currently working on a 2D RTS game, and I was wondering what the difference is in using a square bouding box, compared to a circle bounding ''box'' for unit selection. My original thought was to go with a square, but the games I''ve seen use circles.
//------------------------------------------------------------------------------------------------------The great logician Bertrand Russell once claimed that he could prove anything if given that 1+1=1. So one day, some fool asked him, "Ok. Prove that you're the Pope." He thought for a while and proclaimed, "I am one. The Pope is one. Therefore, the Pope and I are one."
I am not a programmer but after years in the industry I can come up with a couple of suggestions that should keep you going until someone more qualified comes along.

1. (Possible but not likely) - Circles are for some reason quicker to calculate (the edge always being the same distance from the "centre").
2 (More likely) - A circular bounding box fits all sprite rotations of a unit batter than a square.

Dan Marchant
Obscure Productions
Game Development & Design consultant
Dan Marchant - Business Development Consultant
www.obscure.co.uk
Advertisement
Also, spheres (or more often cylinders) have nice properties from a physics point of view: they slide elegantly against each other and the environment, where boxes slide jaggedly, and is easily blocked.

Allan
------------------------------ BOOMZAPTry our latest game, Jewels of Cleopatra
Circle/sphere collision is the simplest, and fastest type of collision to do. It also makes colliding with something feel smooth as you move around it.
EDIT: I've been beaten! bleh

[edited by - LockePick on August 10, 2003 10:36:24 PM]
_______________________________________Pixelante Game Studios - Fowl Language
If you''re just drawing a primitive around a unit and it has nothing to do with collision detection, then it''s really arbitrary what shape you use to indicate a highlighted unit.

For fun, you could try drawing an Octagon around the units.

   __ /    \|  D:  | \ __ / 
william bubel

This topic is closed to new replies.

Advertisement