Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / 3d Fighting Game Combat...theory

Author
Message
Ninjazz
18
Years of Service
User Offline
Joined: 21st Dec 2007
Location:
Posted: 18th May 2010 10:04
Alright, I've been looking over the forums trying to find relevant information for my project, but have unfortunately not been quite finding what I seek.

Here's what I'm looking at, in a nutshell. It's a simple 3d beat-em-up game, the part where I'm having issues is the combat collision detection part. I have a theory on how to do it, but wanted some other people's input and/or suggestions. (As I'm not very good at DBPro all of this is a bit difficult for me.)

So the theory is this: If I want my character to throw a punch or a kick, I have the player hit the appropriate button, then use limbs with the model's punch animation to throw the punch, checking for collision on the limbs. (this possible?) If there's a collision between the enemy and the limb, then the punch connects, do the damage, etc. But if not, then basically nothing happens.

What I want to know is, is this viable? Is there another way anyone would suggest for this kind of combat? I thought about just making it so that while you are punching if you collide with an enemy they get damaged (much simpler), but then that messes things up if you are fighting multiple enemies or if one runs up behind you you'd only have to punch when they do and if there's a collision they'd still get hit. (lame.) So there's my 3d Beat-em-Up combat theory...

(PS. Sorry if this is in the wrong thread, I wasn't sure about posting it here or in Newcomers, etc.)

The difference between a boy and a man: The boy thinks he is a man, the man wishes he were a boy again.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th May 2010 10:57
I've thought about this a bit over the years, and this is how I would do it...

Firstly, each limb on the fighter would need a radius, and a database of which limbs are connected to which, standardised of course, so you always know which limb the right fist is.

Imagine the right arm, shoulder limb, elbow limb, to wrist limb and hopefully an extra limb right in the middle of the fist. The shoulder to elbow would taper down, as the radius on the shoulder will be bigger than the elbow, which would be bigger than the wrist again. By giving these limbs a radius you can guage the radius with interpolation - so you would be able to work out the position and size of the limb at a given Y height.

If someone is kicking, then their foot limbs could be checked with the interpolated radius and position to detect a hit - but it would be fairly accurate, more than adequate for collision detection. So if you imagine the fist is actually a disc with a set radius, heading towards these other discs made by interpolating the limb positions and sizes for the fists Y height.

Each fighter would need it's key limbs specified with a radius, but then it can all be contolled with animation, animate a cool kick, and a cool kick you will have - connected very accurately with the opponents.

This technique has quite a convenient benefit, in that you will know which hand or foot hits which limb - and could have different animations, but the nature of this technique means that even if the enemy hunches over after a shot in the pills - you could knee him in the face. Makes for a very dynamic fight engine, and all for the cost of some interpolation and distance checks. It would probably be advised to have some extra limbs, to ensure that the right areas of the body can be padded out etc. But say you add a limb for a nose - if you detect a hit on that, you could shift that limb and affect the shape of the nose - actually break it right there, dynamically in front of you. Same goes for eyes and jaws and stuff - change the texture to suit a blackened eye, distort limbs by offsetting or rotating them to show broken noses and jaws.

Could get violent!


Health, Ammo, and bacon and eggs!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th May 2010 16:03
Can't you just use the LIMB COLLISION command?

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2026-07-25 23:50:33
Your offset time is: 2026-07-25 23:50:33