![]() |
| [[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]] |
|
|
#1 |
|
New Member
Join Date: Mar 2009
Posts: 18
|
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 |
|
|
|
|
|
#2 |
|
Member
Join Date: Sep 2007
Posts: 96
|
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
|
|
|
|
|
|
#3 |
|
Member
Join Date: May 2009
Location: palo Alto, CA
Posts: 92
|
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.
|
|
|
|
|
|
#4 |
|
DevMaster Staff
Join Date: Sep 2008
Location: Left Of Albakurky
Posts: 734
|
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! |
|
|
|
|
|
#5 |
|
New Member
Join Date: Mar 2009
Posts: 18
|
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 |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Jan 2007
Location: Finland
Posts: 356
|
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 |
|
|
|
|
|
#7 | |
|
Senior Member
Join Date: Oct 2007
Posts: 471
|
Quote:
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. |
|
|
|
|
|
|
#8 | |
|
DevMaster Staff
Join Date: Sep 2008
Location: Left Of Albakurky
Posts: 734
|
Quote:
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! |
|
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Mar 2006
Location: perth
Posts: 887
|
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." |
|
|
|
|
|
#10 | |
|
Member
Join Date: May 2009
Location: palo Alto, CA
Posts: 92
|
Quote:
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. |
|
|
|
|
|
|
#11 |
|
Member
Join Date: Sep 2007
Posts: 96
|
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
|
|
|
|
|
|
#12 |
|
Senior Member
Join Date: Mar 2006
Location: perth
Posts: 887
|
Yeh, Tyree is right. keep it simple in always works.
___________________________________________
Do you say-> "C plus plus" or "C increment." |
|
|
|
|
|
#13 |
|
DevMaster Staff
Join Date: Sep 2008
Location: Left Of Albakurky
Posts: 734
|
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! |
|
|
|
|
|
#14 |
|
Senior Member
Join Date: Mar 2006
Location: perth
Posts: 887
|
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." |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|