Difference between revisions of "Animation"

From Basin Wiki
Jump to navigation Jump to search
m (moved D2 Animdata to Animdata)
(more text to introduce sub pages)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Animation nav}}
 
Parts of Animdata.d2 referenced by monstats.txt
 
Parts of Animdata.d2 referenced by monstats.txt
 +
 +
This file has data on how to play the animations of players and monsters in normal gameplay. The game engine keeps track of all units, their current animation, and controls the transition between animations. Generally, animations play until they complete but there are special rules for certain types of animations. For example, idle and run animations can be interrupted at any time by an action while a GetHit animation can preempt other animations.<br>
 +
 +
This process governs how responsive characters will be during gameplay. Faster hit recovery animations will allow you to run or strike back sooner. Faster attacks allow you to deal more damage over time or strike more evasively. The information here gives the baseline speeds and are modified by skills and stats on equipment.
  
 
'''Code''' - identifies a collection of animations<br>
 
'''Code''' - identifies a collection of animations<br>
Line 6: Line 11:
 
'''FramesPerDirection''' - number of frames in the animation<br>
 
'''FramesPerDirection''' - number of frames in the animation<br>
 
'''AnimationSpeed''' - how quickly to advance through the animation (in 256ths of a frame)<br>
 
'''AnimationSpeed''' - how quickly to advance through the animation (in 256ths of a frame)<br>
'''StartingFrame''' - frame number to start at<br>
+
'''StartingFrame''' - frame number to start the counter at<br>
 
'''ActionFlagFrames''' - frame numbers that have an action flag set<br>
 
'''ActionFlagFrames''' - frame numbers that have an action flag set<br>
 +
 +
FramesPerDirection denotes the number of frames in the animation. The place in the animation is tracked by an animation counter where every frame has a set of 256 counts where it is the displayed frame. The currently active frame can be found by dividing the counter by 256 and taking the integer portion of the result. The game updates at a rate of 25 times per second.
 +
 +
Every game update cycle, animation counters are incremented a certain amount. The standard amount is AnimationSpeed of the active animation. Having an AnimationSpeed of 256 will advance the counter to the next frame every game cycle while an AnimationSpeed of 128 will require two game cycles to advance the counter to indicate the next frame.
 +
 +
The animations are categorized by unit code, animation mode, and type of weapon held by the unit. The unit code denotes the type of unit, whether it be one of the player character types or a monster. The animation mode corresponds with the type of action the unit is performing. wclass corresponds weapon class of the equipped weapons. Without a weapon, the wclass is HTH. The base item class can be found in weapons.txt and dual wielding has its own type depending on the items equipped in each hand.
 +
 +
Codes for player classes<br>
 +
[[#AI|AI]] Assassin<br>
 +
[[#AM|AM]] Amazon<br>
 +
[[#BA|BA]] Barbarian<br>
 +
[[#DZ|DZ]] Druid<br>
 +
[[#NE|NE]] Necromancer<br>
 +
[[#PA|PA]] Paladin<br>
 +
[[#SO|SO]] Sorceress<br>
 +
 +
Modes<br>
 +
DT - Death<br>
 +
NU - Neutral<br>
 +
WL - Walk<br>
 +
RN - Run<br>
 +
GH - Get Hit<br>
 +
TN - Town Neutral<br>
 +
TW - Town Walk<br>
 +
A1 - Attack 1<br>
 +
A2 - Attack 2<br>
 +
BL - Block<br>
 +
SC - Spell cast<br>
 +
TH - Throw<br>
 +
KK - Kick<br>
 +
DD - Dead<br>
 +
S1 S2 S3 S4 - Sequence/skill specific<br>
 +
 +
Weapon classes<br>
 +
HTH - Hand to Hand<br>
 +
1HS - One handed swing<br>
 +
2HS - Two handed swing<br>
 +
1HT - One handed thrust<br>
 +
2HT - Two handed thrust<br>
 +
HT1 - One hand-to-hand<br>
 +
HT2 - Two hand-to-hand<br>
 +
BOW - Bow<br>
 +
XBW - Crossbow<br>
 +
STF - Staff<br>
 +
1JS = left hand swing, right hand stab<br>
 +
1JT = both hand stab<br>
 +
1SS = both hand swing<br>
 +
1ST = left hand stab, right hand swing<br>
 +
 +
There are stats in the game that affect the speed of animations. The standard rate is the AnimationSpeed of the animation. Modifications to the rate are added together as percentage modifications. The general process is as follows:
 +
 +
Add the rate modifiers together. Speed increases are positive while speed decreases are negative.<br>
 +
The sum of rate modifiers is limited to being between -85 and +75<br>
 +
AnimRate = AnimationSpeed * (100 + Sum of rate modifiers) / 100<br>
 +
AnimRate is used to increment the animation counter
 +
 +
The mathematics of percentage modifiers means that a having a skill that increases attack speed by 40% gives an AnimRate that is 140% of AnimationSpeed. Having a slows target by 40% gives an AnimRate that is 60% of AnimationSpeed.
 +
 +
Stats that apply animation speed changes are limited to specific types of animations rather than all animations.<br>
 +
 +
Skills such as [[Fanaticism]], [[Burst of Speed]], [[Frenzy]], and [[Werewolf]] provide attack animation speed increases. The [[Holy Freeze]] aura and the [[Decrepify]] curse apply attack animation speed decreases.
 +
 +
[[Slows Target]] slows the speed of attack animations and movement speed based on the value of the stat.
 +
 +
Chilling applies a -50 to the attack animation rate. This is capped by chill effectiveness stat.
 +
 +
[[Freezes Target|Freeze target]]
 +
[[Freeze length]]
 +
[[Half Freeze Duration|Half Freeze]]
 +
[[Cannot be Frozen|Not Frozen]]
 +
Freezing keeps the current animation from advancing.
 +
 +
Getting stunned cancels the current action/animation and puts them into a neutral animation. [[Stun length]]
 +
 +
[[Walk/run speed|Walk/run]]
 +
[[Faster Run/Walk]]
 +
The animation is scaled depending on how far a character moves per update cycle.
 +
 +
[[Hit recovery]]
 +
[[Faster Hit Recovery]] is a stat found on gear that increases the speed of get hit animations. It is subject to a diminishing returns formula. [[Knockback]] puts the affected unit into a get hit animation.
 +
 +
[[Attack speed]]
 +
[[Weapon speed]] is a property of weapons equipped. Some weapon types are inherently faster or slower than others.
 +
 +
[[Increased Attack Speed]] is a stat found on gear that increases the speed of attack animations. It is subject to diminishing returns formula.
 +
 +
[[Block rate]]
 +
[[Faster Block Rate]] is a stat found on gear that increases the speed of block animations. It is subject to diminishing returns formula.
 +
 +
[[Cast rate]]
 +
[[Faster Cast Rate]] is a stat found on gear that increases the speed of casting animations. It is subject to diminishing returns formula.
  
 
===10===
 
===10===
Line 6,093: Line 6,189:
 
| ZZ || NU || HTH || 10 || 104 || 0
 
| ZZ || NU || HTH || 10 || 104 || 0
 
|}
 
|}
 
 
 
[[Category:Diablo II]]
 

Latest revision as of 20:41, 26 November 2021