Advertisement

Beat Em Up collision detection

Started by November 24, 2001 08:54 AM
2 comments, last by Hamster 23 years, 2 months ago
Hello, I''ve been trying to program a close range fighting game, but am having problems with the collision detection. My latest idea is that I could try and map cylinders/boxes/spheres to the bones and joints of each character to move with the sketleton, but setting this up looks like a lot of hard work (I''d probably have to program a plugin for my modeller etc, in the longrun), so if this isn''t the accepted tecnique and anyone can suggest one, please let me know. Thanks for the help, John Also: Is there any special technique employed in beat-em-ups when throwing an opponent? Punches and kicks seem ok, but throwing looks quite complicated to set up.
There is absolutely nothing wrong with your theory here, so do have confidence to proceed with it.

It shouldn''t be too hard to attach various geometric collision primitives to the bones in your modelling package, either along with the skin or on the same bones but in a seperate file.

Ultimately you''re just looking for a means of recognising that they are what they are, and not part of the skin. You''ll want to export them in an optimium format (just the plain bounding data) and like a skin vertex, you''ll obviously have to know which bone each bounding volume is attached to.

The key focus of your plug-in development will then resolve down to adding extra functionality necessary (if any) in attaching bounding volumes to bones, perhaps tagging it as necessary to signal that it''s not part of the skin and finally...export.

Throwing is perhaps much more simple than other moves. It''s simply a replay of two animations. You need to determine if the throw is possible and ensure that the characters are in the correct positions to initiate the anim and simply replay the ''throwing'' and ''being thrown'' animations on the respective characters.

The difficult part of throwing...if your characters are of different sizes, then it''s common to have problems positioning hands (for the grapple) prior and during the throw. The throw animations need to match the hand positions up with every character you''ll fight against, or have a different animation of the same throw for each different opponent (a perfectly acceptable solution).

However, you can also solve this by putting grip points for each hand on various frames of animation (again something you need to add to your plug ins to define) and use IK to make the hands attach properly. They are basically targets for the hands to attach to. This is more complicated but basically saves on animation work and the potential memory footprint. It does mean extra work in you animation engine though.
Advertisement
Thanks very much for the reply, it was a great help.
--John
freakchild''s reply has some great advice, in my opinion. I''ve started developing a hand-to-hand combat framework for our NetImmerse-based game---using a hierarchy of simple bounding boxes that are tied to the skeleton. I would recommend that you manually place the bounding objects rather than generate them automatically using (say) an OBB (Oriented Bounding Box) or AABB (Axis-Aligned Bounding Box) tree algorithm. I learned the hard way. NetImmerse does automatically generate the OBB tree and I was hoping to use it. Mistake. An automatically-generated tree can easily produce more bounding spheres/boxes than you really need, and the quality/placement of those boxes is often questionable. This would not only slow down your code, but also would probably make it more difficult to produce consistent results if a move it executed at slightly different positions relative to the other character. You may only need, say 2 bounding objects on the torso (head, pelvis), one for each leg, and one or two for each arm. Use as few as possible (obvious? perhaps). And since your using just a few, then boxes would fit the geometry better.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement