Jump to content
  • Advertisement

Archived

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

Sfpiano

Square bounding box or circle?

This topic is 5460 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
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
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!