OTCv8 / otclientv8

Clean, ready to use version of OTClientV8 - Alternative, highly optimized Tibia client
Other
254 stars 191 forks source link

Animation bugs on older protocol - 7.72 confirmed but probably many more (up until animations were changed I guess) #206

Closed Silba93 closed 2 years ago

Silba93 commented 2 years ago

Tested and confirmed on unmodified latest otcv8, clean 7.72 dat/spr and unmodified nekiro 7.72 tfs On cip client the animations are fine

Happens while idle and also while walking

2-frame animations work fine, outfits and monsters such at fire elemental 3-frame animations skip the 3rd frame entirely and only frame 1 and 2 are shown 6-frame animations do not skip any frames but animate very fast

animationscompare

Here swapped the sprites to make this more clear animations

Oen44 commented 2 years ago

My bad, will be fixed with new update. Sorry about that.

Silba93 commented 2 years ago

My bad, will be fixed with new update. Sorry about that.

Awesome thank you, I just tested this and yes all frames are now there however my rotworms are still animating way too fast. I did some more testing and here's what I found:

2-frame is a little bit slow compared to cip (bat, wasp, fire elemental etc) 3-frame is good, i can't tell the difference to cip (deathslicer, beholder) 4-frame and 6-frame animate way too fast (butterfly, slime, rotworm)

Oen44 commented 2 years ago

Frames duration in Object Builder are correct?

Silba93 commented 2 years ago

Frames duration in Object Builder are correct?

Unmodified spr/dat so I'm going to assume yes? I don't see reference to frame duration in object builder. I believe that is a feature when compiled with "enhanced animations".

Oen44 commented 2 years ago

So is there like a formula for frame duration on older protocols? Anything based on total number of frames? I have no knowledge about old Tibia so you will have to help me with all the information.

Silba93 commented 2 years ago

I'm just saying what I see, got no technical knowledge at all about this. Sorry >.<

Silba93 commented 2 years ago

So is there like a formula for frame duration on older protocols? Anything based on total number of frames? I have no knowledge about old Tibia so you will have to help me with all the information.

I think I've 'solved' it. Finally got the dev version to work so I could mess around :D

Regarding frame duration, I noticed all creature animations have the same "ticks per frame" on cip client so a 2-frame bat would complete 3 rounds of animations in the same time it takes a 6-frame rotworm to complete once. Animation speed is client side at a set speed and not based on number of frames as far as I can tell.

In OTCV8 the "ticks per frame" is in outfit.cpp line 98 ticksPerFrame = 1000 / phases which explains why:

Bats are slow (2-frame, 500ms ticksPerFrame) Beholders are ok (3-frame, 333ms ticksPerFrame) - cip client appears to be somewhere around this 300ms range Rotworms are fast (6-frame, 166ms ticksPerFrame)

I have compiled and used ticksPerFrame = 330 and it's very close but not perfect, I have tried anywhere between 300-350 and nothing seems perfect. However close enough(330) is probably acceptable.

I don't know how to implement this properly but hopefully I have enough information here so a proper fix can be implemented.

Comparisons: LEFT SIDE IS CIP RIGHT SIDE IS OTCV8 ticksPerFrame = 330 almostlol

LEFT SIDE IS CIP RIGHT SIDE IS VANILLA OTCV8 ticksPerFrame = 1000 / phases original

Oen44 commented 2 years ago

Fixed