• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Theory] Manual attacks

Status
Not open for further replies.
Level 24
Joined
Oct 12, 2008
Messages
1,783
Im thinking of how to sensibly and efficiently set up a system for a manual hack and slash.

Here are some things to consider.
- It is universal, all units in the game will use this instead of their "auto attack"
- It has to support varied attack speeds, ranges and attack modifiers

The current idea is as follows.
- The dummy ability the manual swing is based on is channel with an infinitely long channel duration.
- Upon casting, the unit's animation speed is scaled to it's damage point. Therefore the swing animation will play once.
- Periodic checks for what time frame a swinging unit is in, interrupt the channel (thus ending the swing) if unit has reached the end frame of its swing (ie. damage point).

Thoughts?
Am I grossly overthinking this?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
It is impossible to micro units like this. It raises huge usability concerns.

Also animations are generally not deterministic anyway, the important thing is timing from when the ability is cast to the time the damage is dealt. The animations are just eye candy and have no real effect on combat results.
 
Level 12
Joined
Nov 3, 2013
Messages
989
With press and release you can at least mimic movement and attacking like in diablo style arpgs.

However I think you need those static objects (whatever they're called) to detect cursor movement without continuously pressing left or right mouse button. (talking about how you hold down a key while moving the cursor to change target for movement or attacking)
 
Level 24
Joined
Oct 12, 2008
Messages
1,783
It is impossible to micro units like this. It raises huge usability concerns.

Also animations are generally not deterministic anyway, the important thing is timing from when the ability is cast to the time the damage is dealt. The animations are just eye candy and have no real effect on combat results.

I should have clarified that you control a single unit, hence micro is a non issue.
By extension, the swing animation clarity is relevant as stepping out of a swing to avoid does become a concern, which can only be done if the animation does sync with the damage point.

one thing you might need to do is make the enemies neutral.

How is this relevant?

With press and release you can at least mimic movement and attacking like in diablo style arpgs.

However I think you need those static objects (whatever they're called) to detect cursor movement without continuously pressing left or right mouse button. (talking about how you hold down a key while moving the cursor to change target for movement or attacking)

Im not planning to mimic "diablo" in any form. Hence there isn't a need to copy it's controls.


I think everyone is missing the point.
It's about how more efficiently can I set up a manual attack (with support for varied attack speeds, ranges, swing arcs, attack procs) and if my current method is overly complicated.
Im asking about the mechanical method, of whether there are large exploitable holes in the current system and can it be simplified.
 
Level 12
Joined
Nov 3, 2013
Messages
989
I should have clarified that you control a single unit, hence micro is a non issue.
By extension, the swing animation clarity is relevant as stepping out of a swing to avoid does become a concern, which can only be done if the animation does sync with the damage point.

No, you're wrong. What DSG said is true. Generally animations and what is actually happening are usually separate.

Otherwise you'd be limited by fps as an example.
 
Level 12
Joined
Nov 3, 2013
Messages
989
DSG already said it.

the important thing is timing from when the ability is cast to the time the damage is dealt.



And since all you've mentioned is how you'd play the attack animations there's nothing to go on.
 
Level 24
Joined
Oct 12, 2008
Messages
1,783
DSG already said it.

Which has little relevance. You cant simply say X doesn't work and offer no solution, although I cant force one out of you either.

And since all you've mentioned is how you'd play the attack animations there's nothing to go on.

Oh really?
In the first post the following was mentioned
- How the dummy swing would be set up.
- How the swing's length is calculated
- How the damage point and the subsequent swing end would occur
 
Level 12
Joined
Nov 3, 2013
Messages
989
Oh really?
In the first post the following was mentioned
- How the dummy swing would be set up.

Not much to choose from so this is negligible. Imo just using smart order or a skill based of rally would be the most simple and work decent for how I'd assume you'd want to make the hack and slash. (use actual mouse button press instead of using a skill and then a target)

- How the swing's length is calculated
- How the damage point and the subsequent swing end would occur

Because, like DSG already mentioned, animation doesn't have anything to do with this - it's just the way it's being shown. In reality what you should be checking for is the unit position and target point and then compare stats and do the attack roll (check for evasion, dodge, crit etc) against all units within the strike zone.

If I'd somehow be really far off with my assumptions then there's mostly your lack of real information about your thoughts for the actual mechanics to blame, which is what has been implied a few times by now.
 
Level 24
Joined
Oct 12, 2008
Messages
1,783
Because, like DSG already mentioned, animation doesn't have anything to do with this - it's just the way it's being shown. In reality what you should be checking for is the unit position and target point and then compare stats and do the attack roll (check for evasion, dodge, crit etc) against all units within the strike zone.

My bad, I was under the assumption that reader would know this.
What I was trying to say is that since animations do not play in sync with the actual game time, how do I make sure they do.
 
Level 12
Joined
Nov 3, 2013
Messages
989
My bad, I was under the assumption that reader would know this.
What I was trying to say is that since animations do not play in sync with the actual game time, how do I make sure they do.

I think there's some kind of miss understanding but nvm that, what I think could be an answer to what you're asking is that you need to know how long the animations are ahead of time to make them fit.

To do that I would store reals that would represent how long each animation is inside a hashtable with the keys unit type and then an index representing which animation.

So lets say you have a unit using blademaster model and that attack 1 is the first animation then it would be SaveReal(udg_hash, UnitType, 0, 1.167)

If you want each animation on each model to share the same animation time for each attack (assuming they have the same attackspeed) then you'd check which attack animation will be played and change the units animation speed to fit in accordingly. I.E. you want normal animation to last for 1 second then if blademaster use attack one you would set his animation speed to ~117%.

You also might not want the damage point and entire animation to end at the same time and other stuff so you got to work a bit more on it but this is how I'd probably approach it at least.
 
Level 24
Joined
Oct 12, 2008
Messages
1,783
I think there's some kind of miss understanding but nvm that, what I think could be an answer to what you're asking is that you need to know how long the animations are ahead of time to make them fit.

To do that I would store reals that would represent how long each animation is inside a hashtable with the keys unit type and then an index representing which animation.

So lets say you have a unit using blademaster model and that attack 1 is the first animation then it would be SaveReal(udg_hash, UnitType, 0, 1.167)

If you want each animation on each model to share the same animation time for each attack (assuming they have the same attackspeed) then you'd check which attack animation will be played and change the units animation speed to fit in accordingly. I.E. you want normal animation to last for 1 second then if blademaster use attack one you would set his animation speed to ~117%.

This is very obvious, I already know all of this.
What Im trying to say is, since you claim that syncing animations with damage points is flawed, what is the solution?
I do not need you to repeat what I already know and already am using.

You also might not want the damage point and entire animation to end at the same time and other stuff so you got to work a bit more on it but this is how I'd probably approach it at least.

That doesn't help. You give no explanation why this problem exists and how to fix it.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Synching attack animation and collision detection would be impossible if you intend to make a system out of it because you don't have a way to detect where the weapon's damage point is. I'm saying this within the context of the "weapon swinging" idea. However, you can just settle for faking it, you need to tweak the model so that the attack animation will have a determinable attack point(I meant determinable using timing on code), but that would require you to make a custom model or edit an existing model for use with the system.
 
Level 12
Joined
Nov 3, 2013
Messages
989
It's about how more efficiently can I set up a manual attack (with support for varied attack speeds, ranges, swing arcs, attack procs) and if my current method is overly complicated.
Im asking about the mechanical method, of whether there are large exploitable holes in the current system and can it be simplified.

This made me give you that example which you followed up with saying it's very obvious, so I'm really confused with what you're actually asking and doubt you even know yourself.

This is very obvious, I already know all of this.
What Im trying to say is, since you claim that syncing animations with damage points is flawed, what is the solution?
I do not need you to repeat what I already know and already am using.



That doesn't help. You give no explanation why this problem exists and how to fix it.

What has been said is that animation and what is actually happening is separate. That doesn't mean they're not in sync though.

From what I gather is that you fail to understand that animations come secondary, it's (obviously) supposed to show what is actually happening and in an RTS engine where every move is sent to the host and then back to the client it might not be as obvious since it doesn't predict calculations to minimize the delay between player input and character actions.

What normally happens is that you do the calculations and then they are confirmed but since wc3 is an RTS that isn't the case.

basically I'm just saying the same thing in different ways since it doesn't appear that it's getting to you. And if you are getting what I'm saying then I don't understand what your actual question is, to me that would mean that you already know what to do and how and that this thread is pointless but I have to assume it isn't until you say so.

Synching attack animation and collision detection would be impossible if you intend to make a system out of it because you don't have a way to detect where the weapon's damage point is. I'm saying this within the context of the "weapon swinging" idea. However, you can just settle for faking it, you need to tweak the model so that the attack animation will have a determinable attack point(I meant determinable using timing on code), but that would require you to make a custom model or edit an existing model for use with the system.

In essence what's been said basically give you the above, although I think I've read some thread about how you could use an attachment and know it's location to have collision detection on attacks or something like it.
 
Level 24
Joined
Oct 12, 2008
Messages
1,783
However, you can just settle for faking it, you need to tweak the model so that the attack animation will have a determinable attack point(I meant determinable using timing on code), but that would require you to make a custom model or edit an existing model for use with the system.

That's the original plan. I assumed people reading would know this, since as you said, there is no innate way to detect the end of an animation swing.

This made me give you that example which you followed up with saying it's very obvious, so I'm really confused with what you're actually asking and doubt you even know yourself.

Im asking because you said the following.

No, you're wrong. What DSG said is true. Generally animations and what is actually happening are usually separate.

Hence I assume you actually know something I don't.

From what I gather is that you fail to understand that animations come secondary, it's (obviously) supposed to show what is actually happening and in an RTS engine where every move is sent to the host and then back to the client it might not be as obvious since it doesn't predict calculations to minimize the delay between player input and character actions.

I am aware of that.

basically I'm just saying the same thing in different ways since it doesn't appear that it's getting to you. And if you are getting what I'm saying then I don't understand what your actual question is, to me that would mean that you already know what to do and how and that this thread is pointless but I have to assume it isn't until you say so.

My question is simple.
You said that my method was wrong, so Im asking you how do I make it right?

So far, everything you've said doesn't change anything in regards to the original plan. It still functions with all that taken into account.
 
Level 12
Joined
Nov 3, 2013
Messages
989
My question is simple.
You said that my method was wrong, so Im asking you how do I make it right?

So far, everything you've said doesn't change anything in regards to the original plan. It still functions with all that taken into account.

Ok so this is the actual miss understanding this thread has been reeking about, look, your statement was wrong (that it's animation that decides when a unit begins an attack and when it finishes) and your response where moving out of the way with an animation meant that you'd have moved out of the way.

Yes it's most likely going to be true, that if you can see your character move out of the way then you've moved out of the way, but it's not that you can see the movement animation being played that decides if you've actually moved... (obviously wc3 doesn't do prediction calculations so when you can see that your statement is wrong will probably never happen which makes what was said not so relevant)

It's perhaps partially my bad that I just said "you're wrong" and then proceeded like you'd know in what way I mean't that you were wrong. (as in that your statement wasn't correct even if what you would do would work)
 
Level 24
Joined
Oct 12, 2008
Messages
1,783
Ok so this is the actual miss understanding this thread has been reeking about, look, your statement was wrong (that it's animation that decides when a unit begins an attack and when it finishes) and your response where moving out of the way with an animation meant that you'd have moved out of the way.

Yes it's most likely going to be true, that if you can see your character move out of the way then you've moved out of the way, but it's not that you can see the movement animation being played that decides if you've actually moved... (obviously wc3 doesn't do prediction calculations so when you can see that your statement is wrong will probably never happen which makes what was said not so relevant)

Consider it my fault for wording the question poorly.
Basically, I assumed that by saying "sync the animations" it would be the understood as scaling the animation speeds to the swing speed and not using the actual animations as the determining factor when starting and ending an action.

Seems in the end, the whole thing was a misunderstanding.
Well, thanks for taking the time anyway.
 
Status
Not open for further replies.
Top