Jump to content

Collision on animated characters :


YouGroove
 Share

Recommended Posts

I have a simple question , caus i don't have started to look at it :

 

How does work collision on animated characters with a ray detection (firing weapons etc ...) ?

Does the ray collides with a general collision body shape for the character ?

Or it is accurate collision against polygons whatever the frames playing ?

Or is it ray against Oriented Bounding Box on each limb of the animated character ?

 

Depending of the possibility i'll make some RPG system using precise hits, or simple general character attacks on bouding boxes for example !

Stop toying and make games

Link to comment
Share on other sites

EntityPick(mesh) gets you the mesh which was hit, then you can get the recursive parent with GetMeshModel(mesh) (custom function), and you know who was hit, and you know also where he was hit (the mesh, and even the point of the mesh).

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Create a skeleton for the character using simple shapes. These are sometimes called "hitboxes", and you'll sometimes see a lot of hilarious gamers criticize a game with phrases like "omg teh COD engine sux, the hitboxes are no good" (when they can't hit anything aiming with their console controllers).

 

Anyways, your thigh object should be parented to the thigh bone, forearm to the forearm bone, etc., so that they move with the skeleton's animation and form a very low-detail approximation of the shape of the body. These meshes are used for picking. Even if the engine did vertex weighting on the CPU, you would still want to use hitboxes because it's so much faster to test a ray against simple meshes rather than a mesh with thousands of triangles.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Ok, so i see how it can be done, and it's a common way of doing , and sure it can be lot more time faster than the real mesh with 10 000 polys.

So we have t owrite some little collision editor tools to attach the different meshes e created (boxes, spheres or custom low poly mesh) to the good appropriate bones ?

( I mean : attaching, orienting, putting some offset )

 

I think Plugin system in LE3 will help us to bring such collision editor with default primitives that we could use for collision on limbs.

- create box collision

- size box collision

- create cylinder collision

- reesize cylinder

- attach collision shape to a bone

 

For now, i'll stay with simple collision approximation, and for an RPG it will be stay global like a lot of RPG.

Stop toying and make games

Link to comment
Share on other sites

All you have to do is create the hitbox skeleton in a modeling program, use the same names as the bones, and then load it in code and use FindChild() to parent each hitbox to the appropriate bone.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 3 weeks later...

Use the character controller.

Isn't that a cylinder shape though? What I mean is having a physic body collide with an animated character's body part, like their head or leg.

Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit

Link to comment
Share on other sites

Parent physics bodies to the body part you want. Make a small circle one for the head and parent it to one of the bones in the head so it moves when that bone moves. This will give you a way to tell if there was a collision but won't give physics on the mesh if you are animating that part, but I assume you just want to know which part was "hit"?

Link to comment
Share on other sites

Isn't that a cylinder shape though? What I mean is having a physic body collide with an animated character's body part, like their head or leg.

I have never seen a game that used that level of detail in character physics.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I have never seen a game that used that level of detail in character physics.

What do games with realistic projectile physics (such as bullet drop, bullet travel time, ricochet, etc) use?

Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit

Link to comment
Share on other sites

What do games with realistic projectile physics (such as bullet drop, bullet travel time, ricochet, etc) use?

They don't actually use physics, they just do a raycast in the manner I first described.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...