Archived

This topic is now archived and is closed to further replies.

Sfpiano

Square bounding box or circle?

Recommended Posts

Sfpiano    126
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.

Share this post


Link to post
Share on other sites
Obscure    175
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

Share this post


Link to post
Share on other sites
__ODIN__    479
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

Share this post


Link to post
Share on other sites
LockePick    707
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]

Share this post


Link to post
Share on other sites
Inmate2993    222
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: |
\ __ /

Share this post


Link to post
Share on other sites