Archived

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

Roquqkie

Hand 2 Hand fighting

Recommended Posts

Hi Im currently working on a 3d fighting game where the players are using swords, knifes, daggers and axes. I just have one problem... How should I program this hand to hand weapon? How can I test for collision with a sword? Please any sourcecode or articles would be great. Btw. I''m very good at math so don''t get scared by using advanced math to solve this problem Best regards Roquqkie

Share this post


Link to post
Share on other sites
You can probably fake a sword collision by testing for a line-segment collision. It''s not too inaccurate, and it''ll let you collide-test it against some fairly complex geometry (i.e. a person) with little performance hit.

Decide what the sword needs to collide with (in terms of a person). Bounding boxes might suffice; I suggest many for a single person.

To determine whether swords collide with EACH OTHER will be a bit more tricky, since they no longer have volume, and could easily pass through each other in a single timestep. Look for information about "Plucker coordinates"; it''s an alternative coordinate system that can be used to easily manipulate lines and determine whether one line is on the "other side" of another line from where it was before.



Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites
If you sweep the line from one position to another you get a plane segment - two of these can esily be tested for collisions (intersection). You shouldn''t use normal collision detection - this is normally not detailed as it doesn''t matter, but for your game I guess you need to know whichpart of the body is hit, and how deeply.
How are you implementing physics/control for your fighters? ie how do they stand up without falling, or know how to move their arms to attack?





Read about my game, project #1
NEW (13th August): A new screenshot is up, plus diaries for week #3


John 3:16

Share this post


Link to post
Share on other sites