DevMaster.net Forums
[[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]]

Go Back   DevMaster.net Forums > Programming & Development > Math & Physics
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 10-29-2009, 05:53 AM   #1
rajesh kumar
New Member
 
Join Date: Mar 2009
Posts: 18
Default Fighting

Hi to all,
Any one know how to do fighting in 3D(Detecting collisions for punch and kick).My entities having bounding box for each bone and also have overall one.
If anyone knows any pointers towards this please help me.




Thanking You
Rajesh
rajesh kumar is offline   Reply With Quote
Old 10-29-2009, 09:00 AM   #2
tyree
Member
 
Join Date: Sep 2007
Posts: 96
Default Re: Fighting

thats the only way I know to do it. you may not need one for every bone but you have the general idea right for fighting games
tyree is offline   Reply With Quote
Old 10-29-2009, 12:58 PM   #3
SyntaxError
Member
 
Join Date: May 2009
Location: palo Alto, CA
Posts: 92
Default Re: Fighting

One way to do it is to model your characters with sphere's and/or ellipsoids since it's relatively easy to calculate collisions using those. You can also apply a hierarchy of bounding spheres to group sections of the body. I'm not sure how useful bounding boxes are since it's hard to make them AABB in the case of moving characters, but I can't say for sure without a better description of what you are doing.
SyntaxError is offline   Reply With Quote
Old 10-29-2009, 01:25 PM   #4
alphadog
DevMaster Staff
 
Join Date: Sep 2008
Location: Left Of Albakurky
Posts: 734
Default Re: Fighting

Another option, which a lot of fighting games use, is to reduce your testing to 2D polygons, not your typical 3D bounding box.
___________________________________________
Hyperbole is, like, the absolute best, most wonderful thing ever!
alphadog is offline   Reply With Quote
Old 10-30-2009, 02:11 AM   #5
rajesh kumar
New Member
 
Join Date: Mar 2009
Posts: 18
Default Re: Fighting

Thank u guys

Alphadog
I am using third person view camera.it is possible to convert 2d polygons for checking collisions.


Using spheres for collision between two bones is ok.But how to detect direction of the object hit.Example(object is standing and facing north direction i am punching the object from south direction(behind)).

Please help
rajesh kumar is offline   Reply With Quote
Old 10-30-2009, 05:30 AM   #6
Sol_HSA
Senior Member
 
Sol_HSA's Avatar
 
Join Date: Jan 2007
Location: Finland
Posts: 356
Default Re: Fighting

Could be done in even simpler way. Check collisions by distance and attack style (i.e. kick reaches further than hit). With a little tweaking (and lots of flashy graphics), you can get away with almost anything..
___________________________________________
http://iki.fi/sol - my schtuphh
Sol_HSA is offline   Reply With Quote
Old 10-30-2009, 06:08 AM   #7
fireside
Senior Member
 
Join Date: Oct 2007
Posts: 471
Default Re: Fighting

Quote:
Could be done in even simpler way. Check collisions by distance and attack style (i.e. kick reaches further than hit). With a little tweaking (and lots of flashy graphics), you can get away with almost anything..

I haven't played a lot of these games, but the ones I did seemed to use this style. It was a matter of timing. If the character was in the forward part of the swing, you need to be in a block. If he was in the rearward part of the swing then you need to punch in order to score. I guess it would depend if you were using preset animations or physics based. Physics based might get pretty complicated. Nothing has to be that perfect because it's happening pretty fast. Personally, I think having some type of rules that the player can understand would be more important.
___________________________________________
http://fireside7games.com/

Last edited by fireside : 10-30-2009 at 06:19 AM.
fireside is offline   Reply With Quote
Old 10-30-2009, 07:02 AM   #8
alphadog
DevMaster Staff
 
Join Date: Sep 2008
Location: Left Of Albakurky
Posts: 734
Default Re: Fighting

Quote:
Originally Posted by rajesh kumar
I am using third person view camera.it is possible to convert 2d polygons for checking collisions.

Yes, it is possible. Games like Street Fighter and Doom operate this way. You can project 3D into 2D and collision test from that. There are a lot of tuotrials on the net on this.

Also, if you need a lot of power and/or if you also need to introduce physics, you can always use a library like SOLID, Box2D or Bullet (3D).
___________________________________________
Hyperbole is, like, the absolute best, most wonderful thing ever!
alphadog is offline   Reply With Quote
Old 10-30-2009, 08:33 AM   #9
rouncer
Senior Member
 
rouncer's Avatar
 
Join Date: Mar 2006
Location: perth
Posts: 887
Default Re: Fighting

You can figure it out yourself. collision detection is easiest with rays and bounding boxes, the box being the person and the ray being the bullet.

But fighting games are probably harder than shooting games.

What you need is per triangle per triangle detection then operate on switched on damage frames and switched off damage frames, and inert and invincible frames.
___________________________________________
Do you say-> "C plus plus" or "C increment."
rouncer is offline   Reply With Quote
Old 10-30-2009, 12:33 PM   #10
SyntaxError
Member
 
Join Date: May 2009
Location: palo Alto, CA
Posts: 92
Default Re: Fighting

Quote:
Originally Posted by rajesh kumar
Thank u guys

Using spheres for collision between two bones is ok.But how to detect direction of the object hit.Example(object is standing and facing north direction i am punching the object from south direction(behind)).

Please help

Imagine your character is constructed of spheres. For instance 4 intersecting spheres for the forearm; a couple of sphere for the upper chest so forth. You can then group those spheres into a hierarchy by body parts. For instance you can put a sphere around the forearm that contains the four other spheres. This is not a collision sphere it's simply a container for the others and is used for a rough check. In the same way you have a sphere around the entire character. You just have to make sure it's big enough so your character animations don't cause any sub-spheres to go outside of it. Doing it this way you don't use bounding boxes at all; AABB or otherwise. I use a similar system for my terrain and it works well.

Spheres are nice in 3D because it is inherently easy to calculate collisions between them. If you increase the radius of one sphere by the one you are checking it with, you now have a point sphere collision test. You can then sweep a point by some increment according to your animation to do the collision. Keep in mind that checking two moving objects is the same as holding one steady and moving the other one. It's all relative.
As for the direction of the hit, if a point hits a sphere simply generate a vector from the centre of the sphere to the contact point.

There are a lot of details to all this. Doing full 3D animated characters with real collisions is non-trivial. Check out http://www.naturalmotion.com/ for some truly impressive stuff. Good luck.
SyntaxError is offline   Reply With Quote
Old 10-31-2009, 04:44 AM   #11
tyree
Member
 
Join Date: Sep 2007
Posts: 96
Default Re: Fighting

with the facing direction why not use a one sided plane behind the character that could be used as the back of the character. and let you know when something is behind. but keep everything as simple as possible. do not get bogged down in the tech or a long programming outing that keeps extending the time it takes for you to make it. you could end up not making it because of that
tyree is offline   Reply With Quote
Old 10-31-2009, 06:37 AM   #12
rouncer
Senior Member
 
rouncer's Avatar
 
Join Date: Mar 2006
Location: perth
Posts: 887
Default Re: Fighting

Yeh, Tyree is right. keep it simple in always works.
___________________________________________
Do you say-> "C plus plus" or "C increment."
rouncer is offline   Reply With Quote
Old 11-02-2009, 09:03 AM   #13
alphadog
DevMaster Staff
 
Join Date: Sep 2008
Location: Left Of Albakurky
Posts: 734
Default Re: Fighting

It is possible to have a collision detection system that is too simple.

In a fighting game (I'm assuming a Street Fighter kind of game) having inaccurate detection can be quite detrimental because, quite frankly, the whole game is centered on collision detection. Players won't know enough to specifically point to the faulty oversimplified CD, but it will play a role in their dissatisfaction.
___________________________________________
Hyperbole is, like, the absolute best, most wonderful thing ever!
alphadog is offline   Reply With Quote
Old 11-03-2009, 02:01 AM   #14
rouncer
Senior Member
 
rouncer's Avatar
 
Join Date: Mar 2006
Location: perth
Posts: 887
Default Re: Fighting

Yeh definitely, its not quite what I meant, it still has to be passable of course.
___________________________________________
Do you say-> "C plus plus" or "C increment."
rouncer is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump


All times are GMT -7. The time now is 01:32 PM.


Powered by vBulletin
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.