YouGroove Posted September 8, 2011 Share Posted September 8, 2011 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 ! Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Canardia Posted September 8, 2011 Share Posted September 8, 2011 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). Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
paramecij Posted September 8, 2011 Share Posted September 8, 2011 The ray hits the animated mesh accurately as it's currently displayed, regardles of it's collision (physics) shape.. raycasts work only on renderable meshes, while physics collisions work with static shapes only.. Quote Link to comment Share on other sites More sharing options...
Josh Posted September 9, 2011 Share Posted September 9, 2011 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. Quote 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 More sharing options...
Roland Posted September 9, 2011 Share Posted September 9, 2011 Thanks Josh for that recommendation. I will soon be into character animation and IK for my game. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
YouGroove Posted September 9, 2011 Author Share Posted September 9, 2011 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. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted September 9, 2011 Share Posted September 9, 2011 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. Quote 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 More sharing options...
Paul Posted October 1, 2011 Share Posted October 1, 2011 while physics collisions work with static shapes only.. How would you get the effect of physic collisions on animated characters? Quote Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit Link to comment Share on other sites More sharing options...
Josh Posted October 1, 2011 Share Posted October 1, 2011 How would you get the effect of physic collisions on animated characters? Use the character controller. Quote 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 More sharing options...
Paul Posted October 1, 2011 Share Posted October 1, 2011 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. Quote Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit Link to comment Share on other sites More sharing options...
Rick Posted October 1, 2011 Share Posted October 1, 2011 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"? Quote Link to comment Share on other sites More sharing options...
Josh Posted October 1, 2011 Share Posted October 1, 2011 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. Quote 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 More sharing options...
Paul Posted October 1, 2011 Share Posted October 1, 2011 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? Quote Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit Link to comment Share on other sites More sharing options...
tournamentdan Posted October 1, 2011 Share Posted October 1, 2011 How would you get the effect of physic collisions on animated characters? I think you are talking about rag doll physics. Is this what you are saying? Do you mean if your sword hit a animated characters head, the head would then react to the blow? Quote Link to comment Share on other sites More sharing options...
Josh Posted October 2, 2011 Share Posted October 2, 2011 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. Quote 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 More sharing options...
Recommended Posts
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.