Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


I'm faster... so how can I... ??

This topic is 6971 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know that Diablo (and probably other games) speeds up characters by removing frames from the animation. For instance, a normal fighter will have an 8 frame "quick downward chop" animation for a normal sword. If the sword has the "of Speed" suffix, 1 of the 8 frames are removed, if the sword has the "of Haste" suffix, 3 of the 8 frames are removed. Given the fact that you know the rate of the swing (the frames are timed) you can calculate how many frames you need for a certain swing speed.


Share this post

Link to post
Share on other sites
Hi, its me again (youre getting tired of putting me up arent you ?? )

OK. this one is a lttle tricky

Im doing a fighting game but where the fighters have different speed, for ex. the speed can go through 1 to 10, if its 10 the fighter will perform a kick in .3 seconds and if it is 1 it will perform in 1.3 seconds.

How to implement this is the tricky stuff. I was thinking i could create a timer everytime the kick started and then kill the timer when it ended (Win32 timers) but i think this can be slow (i think the CreateTimer of the Win32 API is a little slow and not muhc accurate...

Any other thoughts about this ???


Yours friend Akura

Share this post

Link to post
Share on other sites
Yuck! That IS a nasty way to cut animations (I don't think your art department are going to be all that thrilled about chopping away every other frame to make it move faster )!

Use high performance timers under windows to count game time, and assign a "delay" to each frame in the animation (To achieve faster or slower animations, multiply this by a speed factor e.g. 1.2 to get 20% increase in delay).

In you main render loop, check the time passed since last rendering and update your framecounter accordingly. I.e. if the next 4 frames in an animation has delays 12,17,14 and 20 ms, and the time passed is 31, you skip the first two frames, and timestamp the animation with 2 (31-(12+17)).

The trick is that because most animations run 12 or 25fps, while the game runs 40+, you rarely, if ever, have to skip more than one frame per refresh, yet you have the advantage of animating with almost ms accuracy.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!