Use Bullet primitives for hitbox detection

Scripting questions, discussions, etc
5 posts Page 1 of 1
shoiko
Posts: 6
Joined: Tue Dec 22, 2015 6:21 pm
by shoiko » Tue Dec 22, 2015 7:06 pm
Today, Torque's way of doing hitboxes suck. I mean, look at this:

http://torque-3d.readthedocs.org/en/lat ... erview.jpg

That's exactly the same way i use to do hitbox on the old Quake 1 engine and QuakeC. You have a big bounding box and you separate that into smaller pieces. Valve's way of doing hitboxes is much more efficient without wasting performance:

http://vignette4.wikia.nocookie.net/csw ... update.png

Where is most of the hitbox detection code in? Is it shoehorned into the player class in C++? Or is it spread over the physics abstractions? How are collision messages passed from client to server?
chriscalef
Posts: 333
Joined: Mon Feb 09, 2015 7:48 pm
by chriscalef » Tue Dec 22, 2015 9:02 pm
If you're already planning on having ragdolls, then it makes the most sense IMHO to raycast for the physics bodies making up your ragdoll. I do this in PhysX, but bullet would be similar. I can't speak for stock Torque on the subject, however.

This also brings up an issue of whether you have physics bodies on your characters all the time, or only instantiate them when they die. I use the former method, but might be forced to implement more restrictive rules when I start having very high numbers of characters in the scene, such as only instantiating physics bodies on characters within a certain distance of the player, or in the camera view area if zoomed.

I'm sure it will take lots of trial and error to get it fully optimized, but so far at least I've found physx raycasts to be a quite inexpensive way to obtain not only a hit body, but the exact position, direction, surface normal and velocity of the projectile.
Duion
Posts: 833
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Tue Dec 22, 2015 9:53 pm
You could integrate that old hitbox resource into Torque3D, many people would thank you for that.
MilkywayM16
Posts: 38
Joined: Sat Oct 03, 2015 7:26 am
by MilkywayM16 » Thu Dec 31, 2015 11:19 pm
A similar discussion came up very recently in this thread: viewtopic.php?f=11&t=415

Long story short, wait for the entity component system or implement the old hitbox resource code.
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Fri Jan 01, 2016 12:02 am
It's definitely possible, in physx i create kinematic actors from the bones exactly the same as you would for a ragdoll, that runs from the animations and when you do need a ragdoll just change the actors to dynamic. Would work perfectly with bullet too. Just make sure the projectile class is using physics for raycasting AND filter out the actual character controller for that raycast.
5 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest