Mele Combat

Everything about development and the OpenMW source code.
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Mele Combat

Post by gus »

Hi,

I'm considering taking the mele combat task, but before, I have a few questions (and if in the end I do not do the implementation, this might be still of some use to the one doing it)

I think the CharacterController needs to keep state of the upper body state separately. For this, I propose a new enum like this :

Code: Select all

enum UpperBodyCharacterState {
    UpperCharState_Nothing,
    UpperCharState_EquipingWeap,
    UpperCharState_UnEquipingWeap,
    UpperCharState_Slash,
    UpperCharState_Chop,
    UpperCharState_Thrust,
    UpperCharState_EquipingSpell,
    UpperCharState_UnEquipingSpell
};
Do you think that would be sufficient? Maybe we need to add also Slash_min and Slash_max.
I am also wondering how to change this state. Do you think a new function in Class would be ok?
And if so, what do you think is best:
*upperBodyAction(someAction)
*changeUpperBodyState(someState)
?

Also, when you look at the animations list of NPCs (http://preik.net/morrowind/animationgroups.html), there is these animations:
Large Follow Start
Large Follow Stop
Medium Follow Start
Medium Follow Stop
Small Follow Start
Small Follow Stop
Does anyone knows what these are?

There are some info about it here: http://www.gameskyrim.com/morrowind-npc ... 80-25.html but I'm don't really understand yet.
Tarius
Posts: 574
Joined: 24 Oct 2011, 19:29

Re: Mele Combat

Post by Tarius »

Just to note: http://www.gameskyrim.com/morrowind-npc ... 80-25.html
That link is to a spammer/scam site or whatever that went and copied stuff from legitimate sites. Bethesda doesnt seem to do much about em though.
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Mele Combat

Post by gus »

Well, that's the only one which appeared on google...
User avatar
TorbenC
Posts: 146
Joined: 26 Aug 2012, 23:13

Re: Mele Combat

Post by TorbenC »

gus wrote:Well, that's the only one which appeared on google...
It is called web scraping.

Honestly, it's annoying but as said earlier unless Bethesda decides to actually take action, nothing will happen.
qqqbbb
Posts: 19
Joined: 29 Aug 2012, 14:18

Re: Mele Combat

Post by qqqbbb »

Bethesda can not do anything about http://www.gameskyrim.com. The site is registered in China.
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Mele Combat

Post by gus »

Okay I came up with a theory about these animations. Imagine you are using a one hand weapon. There are different type of anim if you keep mouse button pressed or not.

Edit:the WeaponOneHand: chop animations has the following notes (in this order I think):
Start
Min Attack
Max Attack
Min Hit
Hit
Large Follow Start
Large Follow Stop
Medium Follow Start
Medium Follow Stop
Small Follow Start
Small Follow Stop
First case, you don't keep your mouse button pressed.
*start at "weaponOneHand chop start"
*when "min attack" note is reached, skip part of the anim between "min attack" and "min hit"
*when "hit" note is reached, check hit collisions and skip part of the anim and go to the "Small Follow Start" note.

If you keep the button pressed:
*start at weaponOneHand chop start
*reach "min attack" note, button still pressed, do nothing.
*reach "max attack" note: stop playing the anim until player release mouse button
*button released: play the animation in reverse mode until you reach "min hit"
*play animation normally until reaching "hit" note
*play Large Follow Start
*end at Large Follow Stop

If you release the button midair:
*start at weaponOneHand chop start
*reach "min attack" note, button still pressed, do nothing.
*button released: play the animation in reverse mode until you reach "min hit"
*play animation normally until reaching "hit" note
*play Large Follow Start or Medium Follow Start depending of how long button was pressed
*end at Large/Medium Follow Stop


Does it sound crazy? (especially the part play in reverse mode)

Edit: for NPc animations notes: see here:http://preik.net/morrowind/animationgroups.html


Edit2:
16:34] <KittyCat> what I imagine is that when the attack button is pressed and a weapon is ready, you play
[16:34] <KittyCat> "<weapon type>: <attack type> start"
[16:34] <KittyCat> to
[16:34] <KittyCat> "<weapon type>: <attack type> max attack"
[16:34] <KittyCat> on the upper body, with no looping and no auto-disable
[16:35] <KittyCat> when the attack button is released, you figure out how far along the animation you are to determine whether you do a small, medium, or large hit
[16:35] <KittyCat> then you disable that attack animation, and play the appropriate next one
[16:36] <KittyCat> which one that is depends on what the animation notes actually refer to, and to do that, you'll need to look at the actual animations at those note times
[16:39] == pi03k [~[email protected]] has joined #openmw
[16:41] <KittyCat> though if I had to guess, I'd say the farther along you are between start -> max attack, the more you play of max attack -> hit
[16:42] <KittyCat> basically, if you're doing a min attack (button is released when you reach 'min attack'), you play starting at 'min hit' to 'hit'
[16:43] <KittyCat> of if you're doing a max attack (button is released when you're at 'max attack'), you play starting at 'max attack' to 'hit'
[16:43] <KittyCat> if you're 25% of the way between min attack and max attack, you start 75% of the way between max attack and min hit
[16:44] <KittyCat> then when you reach 'hit', you do the damage and play the appropriate follow-up.
[16:46] <KittyCat> but again, that's just a guess. it's difficult to say without knowing what the animations actually look like at these times
[16:47] == fusion44 [~[email protected]] has quit [Remote host closed the connection]
[16:47] == fusion44 [~[email protected]] has joined #openmw
[16:55] <KittyCat> so basically:
[16:55] <KittyCat> when the attack button is pressed, play 'start' to 'min attack'.
[16:55] <KittyCat> then when that's finished, if the attack button is not still held play 'min hit' to 'hit'.
[16:56] <KittyCat> otherwise, play 'min attack' to 'max attack' for as long as the button is held

Edit: after checking on OpenMW, Chris seems to be right.
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Mele Combat

Post by gus »

Question to Chris: how can I get the duration between to animation key? (like the duration between "Start" and "Hit" in "WeaponOneHand: chop" for example)
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: Mele Combat

Post by Chris »

gus wrote:Question to Chris: how can I get the duration between to animation key? (like the duration between "Start" and "Hit" in "WeaponOneHand: chop" for example)
The exact duration? There isn't a way right now. What do you need it for?

You can use Animation::getInfo to get how far in-between the start and stop keys (as specified to the play() method) you currently are for a given animation group. So if you play "weapononehand" from "start" to "hit", then getInfo will tell you how much it has played between the "weapononehand: start" and "weapononehand: hit" keys; e.g. 0.0 is at 'start', 1.0 is at 'hit', 0.5 is half way in-between.
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Mele Combat

Post by gus »

You can use Animation::getInfo to get how far in-between the start and stop keys (as specified to the play() method) you currently are for a given animation group. So if you play "weapononehand" from "start" to "hit", then getInfo will tell you how much it has played between the "weapononehand: start" and "weapononehand: hit" keys; e.g. 0.0 is at 'start', 1.0 is at 'hit', 0.5 is half way in-between.
That should do as well, thanks!
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Mele Combat

Post by gus »

There *seems* to be a bug in Animation::getInfo: it seems to return false when the unequip animation is playing (while it return true when the equip animation is playing). Other animations like weapononehand: large follow seems to be affected. Any idea?

Besides, is there any way to change animation speed per group? For instance I need to modify the speed of the chop animation for each type of weapon, but it should not change the speed of the walk animation.
Post Reply