animdata.d2 and in-game animation speed doesn't match

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

Post Reply
mofr
Posts: 11
Joined: Mon Feb 27, 2017 3:28 am

animdata.d2 and in-game animation speed doesn't match

Post by mofr » Tue Mar 07, 2017 4:50 pm

Hello!

I'm trying to calculate actual frame rates of cof animations.
Animation speed of objects (FrameDel from objects.txt), monsters NU are ok and looks similar to diablo 2.
BUT some animations, mostly it's run or walk are definitely too fast, almost twice as faster then in diablo 2.
Some of the most evident examples are: BARN1SS.cof, GCWLHTH.cof.

Also I've tried Dr.Tester (version 0.20l) and get the same results.

What game logic I'm missing? May be it's somehow affected by current character speed (however barbarian town animations speed is fine)?
Diablo 2 reimplementation on Unity https://github.com/mofr/Diablerie

User avatar
Eimernase
Junior Member
Paladin
Posts: 210
Joined: Tue Nov 30, 2004 7:13 pm
Location: Germany

Re: animdata.d2 and in-game animation speed doesn't match

Post by Eimernase » Thu Mar 09, 2017 2:49 am

Did you tried to lower them in Animdata.d2?
That should work.

mofr
Posts: 11
Joined: Mon Feb 27, 2017 3:28 am

Re: animdata.d2 and in-game animation speed doesn't match

Post by mofr » Thu Mar 09, 2017 5:25 am

Eimernase, I'm didn't mention that I'm using fully original diablo 2 resources without any modifications. And trying to find out how the game actually calculates animation speed.
Currently what I see that some of the animdata.d2 values are used as it is, but others are definitely modified/multiplied by the game.
I need it for my diablo 2 clone game implementation.
Diablo 2 reimplementation on Unity https://github.com/mofr/Diablerie

User avatar
Eimernase
Junior Member
Paladin
Posts: 210
Joined: Tue Nov 30, 2004 7:13 pm
Location: Germany

Re: animdata.d2 and in-game animation speed doesn't match

Post by Eimernase » Thu Mar 09, 2017 11:50 am

Mabey look in Monstats.txt for Velocitiy.
That controls also the walk speed (run too, but only if there is a RN-Animation)

mofr
Posts: 11
Joined: Mon Feb 27, 2017 3:28 am

Re: animdata.d2 and in-game animation speed doesn't match

Post by mofr » Thu Mar 09, 2017 2:11 pm

Monstats.txt contains creature speed in tiles per second. In my particular case, Kashya moving with 3 cells per second speed around the world, and i'm pretty happy with this value. However her legs are jiggling so fast :)
According to the animdata.d2, Kashya in WL-mode should be animated at 25 fps (speed value is 256 for RCWLHTH.cof).
But visually it's not correct, my personal feeling is that in diablo 2 real animation speed is around 128. Same story for barbarian and others.
Diablo 2 reimplementation on Unity https://github.com/mofr/Diablerie

mofr
Posts: 11
Joined: Mon Feb 27, 2017 3:28 am

Re: animdata.d2 and in-game animation speed doesn't match

Post by mofr » Mon Mar 13, 2017 6:32 am

In order to show what I'm talking about:


Look at the paladin run animation speed. All creatures here animated at animdata.d2 speed.
Sorry for such a short video, I can record a longer one later.
Diablo 2 reimplementation on Unity https://github.com/mofr/Diablerie

User avatar
devurandom
Forum Regular
Angel
Posts: 774
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: animdata.d2 and in-game animation speed doesn't match

Post by devurandom » Mon Mar 13, 2017 7:12 am

seems like its supposed to be 25 FPS in singleplayer mode, and variable framerate in multiplayer mode > ~2000 FPS

diablo II ingame command
/fps
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

mofr
Posts: 11
Joined: Mon Feb 27, 2017 3:28 am

Re: animdata.d2 and in-game animation speed doesn't match

Post by mofr » Mon Mar 13, 2017 12:24 pm

Sorry, I didn't understand. I'm talking about character animation speed. Not the whole game frame rate.
My goal is to find exact animation frame duration calculation formula.

Let's assume BANU1SS.cof file, looking into the animdata.d2 hashmap tells that animation speed is 96 (in 25 / 256th of fps). The barbarian neutral mode animation speed is 96 * 25 / 256 = 9.375 frames per second. And it looks really nice, not too fast, not too slow.
Ok, let's take BARN1SS.cof, animdata.d2 speed is 216, which results in 21 FPS, and it looks way TOO fast. Note that both animations are 8-frames-length.

So, I think that original game have a bit more complex animation speed calculation based on animdata.d2 values. Mostly it is ok, however some RN (and may be some other modes) animations are definitely too fast if use them as it is.

Sorry for not being able to disassemble the game by myself, I hope that someone already knows the answer.
Diablo 2 reimplementation on Unity https://github.com/mofr/Diablerie

User avatar
Eimernase
Junior Member
Paladin
Posts: 210
Joined: Tue Nov 30, 2004 7:13 pm
Location: Germany

Re: animdata.d2 and in-game animation speed doesn't match

Post by Eimernase » Mon Mar 13, 2017 1:37 pm

I'm sure there isnt any other place for formula that handle unit-animationspeed outside of animdata or velocity in monstats.

Post Reply

Return to “General Mod Making”