|
Title: Suggestions for dealing with Melee Combat? Post by: Tony Coculuzzi on May 01, 2013, 04:32:09 AM Hey guys. So I'm trying to tackle melee combat in a game I'm working on, but I feel like the way I'm going about it is archaic and clunky. Right now, I have a collider attached to the character's weapon that will call the enemy's onHit function when it hits them.
Is there a better way to do this? I'm looking for any suggestions and articles on handling melee combat in 3D. Title: Re: Suggestions for dealing with Melee Combat? Post by: Impmaster on May 01, 2013, 04:50:29 AM Which part feels clunky? Does it feel too mmo ish?
Title: Re: Suggestions for dealing with Melee Combat? Post by: Tony Coculuzzi on May 01, 2013, 05:18:24 AM I feel like it's too dependant on the animations. I want to look into different ways of handling melee so I can pick the one that I feel is the best suited for this project.
Title: Re: Suggestions for dealing with Melee Combat? Post by: biomechanic on May 01, 2013, 08:22:15 AM Quote the best suited for this project Hard to say not knowing what the project is. The way you do it now is, like you say, animation dependent, but there's nothing clunky about that.If you want something more "arcadey", you could on attack spawn a static collider covering the area you want affected. Or make it slightly smaller and with it sweep the area you want. Title: Re: Suggestions for dealing with Melee Combat? Post by: Catguy on May 01, 2013, 08:27:34 AM Quote the best suited for this project Hard to say not knowing what the project is. The way you do it now is, like you say, animation dependent, but there's nothing clunky about that.If you want something more "arcadey", you could on attack spawn a static collider covering the area you want affected. Or make it slightly smaller and with it sweep the area you want. This is how most fighting games do it, isn't it? Spawning a hitbox for the attack that animates? All of my little game design experiments have used this method and it feels great. Title: Re: Suggestions for dealing with Melee Combat? Post by: Tony Coculuzzi on May 01, 2013, 09:32:55 AM Quote the best suited for this project Hard to say not knowing what the project is. The way you do it now is, like you say, animation dependent, but there's nothing clunky about that.If you want something more "arcadey", you could on attack spawn a static collider covering the area you want affected. Or make it slightly smaller and with it sweep the area you want. This is how most fighting games do it, isn't it? Spawning a hitbox for the attack that animates? All of my little game design experiments have used this method and it feels great. Hmm, I was considering doing it this way. I've done this for other projects and it worked well enough I guess. I appreciate your feedback! To be clear, my project is an isometric(ish) arena fighting games. No targeting, you move with an analog stick and attack in the direction you're facing. Title: Re: Suggestions for dealing with Melee Combat? Post by: Gimym JIMBERT on May 01, 2013, 09:40:54 AM I have look at it a bit as one of the next thing to implement.
1. simple hitscan with a ray, you animate but it only look for one frame in front of the character. 2. simple hitbox trigger, there is a trigger box just in front of the character it register all enemy in contact, send a onhit event on damage frame. Hit box can be small and localized or big and encompassing the whole character, or take a shape corresponding to weapon's reach/travel. 3. Maybe the hitscan is animated with a from and to point gizmo. 4. The trigger box follow animated point. So it's always some permutation of 3 parameters 1. hitscan (raycast) or collision volume (hitbox trigger). Trigger has the advantage on certain engine to come with a onEnter and onExit so if a collision occur on multiple frame it can register only once. Hitscan is cool for dealing with damage based on reach like the tip of the sword (intead of using multiple collision box). 2. It occurs on multiple frame or not 3. It is animated and can follow (or not) visual animation. Title: Re: Suggestions for dealing with Melee Combat? Post by: Tony Coculuzzi on May 01, 2013, 11:35:58 AM I have look at it a bit as one of the next thing to implement. 1. simple hitscan with a ray, you animate but it only look for one frame in front of the character. 2. simple hitbox trigger, there is a trigger box just in front of the character it register all enemy in contact, send a onhit event on damage frame. Hit box can be small and localized or big and encompassing the whole character, or take a shape corresponding to weapon's reach/travel. 3. Maybe the hitscan is animated with a from and to point gizmo. 4. The trigger box follow animated point. So it's always some permutation of 3 parameters 1. hitscan (raycast) or collision volume (hitbox trigger). Trigger has the advantage on certain engine to come with a onEnter and onExit so if a collision occur on multiple frame it can register only once. Hitscan is cool for dealing with damage based on reach like the tip of the sword (intead of using multiple collision box). 2. It occurs on multiple frame or not 3. It is animated and can follow (or not) visual animation. I hadn't considered the fact that raycasts can return the distance the ray has traveled to hit the target. That could make for some interesting mechanics. It seems like these would be my options though, so I guess I'll try them all out and see which one best suits me needs. Title: Re: Suggestions for dealing with Melee Combat? Post by: Gimym JIMBERT on May 01, 2013, 12:57:11 PM BTW just thought you can just mix them up, maybe stab is raycast, maybe hold is fixed trigger and melee is animated collision.
And different type of collision box: offensive, damage, invincible, intangible, special, grab, inert ... Title: Re: Suggestions for dealing with Melee Combat? Post by: Tony Coculuzzi on May 02, 2013, 04:11:01 AM I think that's what I'll do, probably the most logical way to go about it considering different types of attacks should be dealt with differently. Awesome stuff, thanks man.
|