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

Started by
1 comment, last by Akura 24 years, 5 months ago
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.

-fel

~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Advertisement
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 ???

thks

Yours friend Akura

It's good to be an outcast, you don't need to explain what you do, you just do it and say you don't belong there.
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.

/Niels

<b>/NJ</b>

This topic is closed to new replies.

Advertisement