The Daily Click ::. Forums ::. Klik Coding Help ::. Hit boxes for fighting type games(Smash bros/Devil May Cry specifically)
 

Post Reply  Post Oekaki 
 

Posted By Message

JetpackLover



Registered
  01/03/2007
Points
  212
2nd October, 2007 at 12:28:21 -

I'm working on a little test for a fighting type platformer like DMC/Smash, and I am wondering how do you make hit boxes. I have animations already, but I don't know how to set them up right. SO far I have drawn out the way I want to do it, but the coding(MMF2) is confusing me. How do I make the hit boxes move fluidly when I have to have them always in a certain position? (Thats just one of my problems with this) And I don't know how to float them or move them properly.

Anyone up to the task of explaining how basic hit/defense boxes are done? Even a basic way of doing it is good, I just need to know some way of making it happen.

Here is a illustrative example of how I assume it should be done(please help me)

http://img219.imageshack.us/img219/9541/hitboxexampleyx7.png


 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


Hotspot Jones



Registered
  22/09/2007
Points
  7
2nd October, 2007 at 14:38:44 -

Hm...I'm not sure if this helps, but I did something like this for a game.

I had a character with a pick-axe, and when he struck the ground it cracked open. What I did was, I made a "pick-axe object", and used this:

+Upon pressing "Shift"
-Set position of "pick-axe object" to [location of the pickaxe point in relation to main character].
-Set position of "pick-axe object" to 0,0

...so that, when Shift was pressed, the pick-axe point appeared (and if anything was under it, stuff would happen), and then disappeared back to a place off-map. It worked just fine.

SOOOOO...here's an idea (and maybe there's a better way to do it): Instead of trying to "move" your hit boxes, set them to their intended position on the animated character individually as it moves. For example:

+Troll animation is "Standing"
-Set position of "fist" to [wherever the fist is]

+Troll animation is "Punching"
+"Punching" in frame 1
-Set position fo "fist" to [wherever the fist is in Punching frame 1]

+Troll animation is "Punching"
+"Punching" in frame 2
[etc.]

You can do it for every frame, or just your key frames, and I THINK it should work. And if your "fist" overlaps with their "body", then you do the damage animations and set the damage, or whatever. I think this is how Mugen does it too.

Defense works the same way.

+Troll is "Defending"
-Set position of "Blocking fist" to [wherever the arms or whatever is]

Mind you, I haven't tested this (except as mentioned above), so I can't give you details about speed or whatever. Maybe you or someone else can use this as a jumping off point, though.

HSJ

 
n/a

Wicked Studios



Registered
  25/10/2004
Points
  460
2nd October, 2007 at 21:29:55 -

I've actually thought of something like this before, but never really followed through on it. In the animation editor set the action point on the fists/feet or wherever you want your attack to land, then make a condition

Always > Set position of hitbox to (0,0) of player

and make it relative to the action point. That way it will always be on the fists or feet when it needs to be. Then when your character plays an attacking animation and the hitbox is overlapping an enemies hit detection zone or w/e you're doing it as, it will do the damage and whatnot. Hope this helps!

 
"Actually sir, we found a tiny unicorn in your exhaust. It was jumping around poking holes in your gas tank." "Oh thank you I did not know that. A tiny unicorn? Wow."

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
2nd October, 2007 at 23:59:44 -

Wicked Studio's method is the best way to do it, in my opinion. Do what he says and your game should work fine.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

TinaPetersen



Registered
  01/10/2007
Points
  251
3rd October, 2007 at 01:43:28 -

Yup frame by frame movement of hitboxes seems the only way to go right now.

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
3rd October, 2007 at 12:35:11 -

Well, I had once tried to make an attack/damage zone type of thing that was based off of the collision box method here: http://www.total-klik.net/feature.asp?id=3

It was so that you could make a separate overlay for each frame of the areas that could deal and take damage for each player and enemy. It sort of worked, but there were some complications when the player would have his attack zone overlapping an enemy's attack zone at the same time their damage zones overlapped (both would end up taking damage).
Thus, I don't know if it'd be much help to you (as I never worked out that issue), and it may be a bit too meticulous for your needs, but if you can understand the theory behind it, perhaps you can do something with it.
http://www.geocities.com/f4fth/collision-map-example.zip

(Just make sure you understand the collision box tutorial first).

 
Go Moon!

TinaPetersen



Registered
  01/10/2007
Points
  251
4th October, 2007 at 00:34:58 -

Well i just remember i once used the multiple path function.. 1 path for each animation however it takes a long time to sync it perfectly

 
n/a

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
15th October, 2007 at 14:18:35 -

I also think that Wicked Studio's method should work fine.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
15th October, 2007 at 14:18:49 -

I also think that Wicked Studio's method should work fine.

Dammit, posted twice...

Image Edited by the Author.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!
   

Post Reply



 



Advertisement

Worth A Click