Game Development Community

Best Method of Collision Detection?

by Nathan · in Torque Game Engine · 02/23/2008 (4:57 pm) · 3 replies

Is this considered the best method of detecting bullet collisions?

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6538

Or is there a better way? I'm messing around with a FPS game with sniper rifles, so accurate collisions would be nice.

Thanks,
Nathan

#1
02/23/2008 (9:46 pm)
That's the resource I used for hitboxes, and it's worked quite well for me since 1.3 (using 1.5.2/TGEA now). I can't speak for the general community consensus, I just personally think it's the best straight-forward hitbox resource on the site. As you can see from the resource page, it's pretty simple to apply to your code manually.

Be aware that these instructions don't include adding support for actually using the hitbox ID for anything in particular; all this does is have the raycast return the hitbox # when it hits a Player object; you'll still need to have the projectile feed this data back to its onCollision call in order to use it for anything.

Projectile uses castRay to check if it's hit something each tick, until it finally does collide with an object. At this point you'll want to make sure that object is a Player, and add the hitbox # to the set of parameters which get sent to the script call of projectile::onCollision.

Also, remember to make sure your hitboxes are animating with the bones correctly or you'll get some pretty odd results.
#2
02/23/2008 (11:42 pm)
I also think this resource is the best for hitbxes. There are others, but less flexible, or far more complicated.

Plus, you can add this resource into other classes besides Player. I haven't looked into other resources to see if this is the case with them as well, but either way, it's a bonus.
#3
02/24/2008 (4:35 pm)
Looks like that's what I'll be using then :-)

Thanks,
Nathan