Jump to content

  • Log In with Google      Sign In   
  • Create Account

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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Akura   Members   -  Reputation: 130

Like
Likes
Like

Posted 09 November 1999 - 04:47 AM

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


Sponsor:

#2 felisandria   Members   -  Reputation: 739

Like
Likes
Like

Posted 09 November 1999 - 04:35 AM

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


#3 Niels   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 November 1999 - 04:47 AM

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





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS