Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] (PR#7860) smoother unit "animation"
Home

[Freeciv-Dev] (PR#7860) smoother unit "animation"

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7860) smoother unit "animation"
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 11 Mar 2004 23:46:15 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7860 >

Currently when a unit is moved the "animation" just slides the unit from 
the starting to the destination location.  A similar animation is used 
for combat.

These animations are done via steps.  The user specifies that the 
animation takes 3 steps.  Then each step moves the unit 1/3 of the way 
and waits 20 ms.

This could be much better!  The limiting factor here isn't the number of 
steps but the drawing time.

My proposeal is that instead of specifying the number of steps, the user 
specifies the animation time (default 60 ms).  Now in the animation 
instead of the current loop

   for (each step) {
     animate()
     wait_until_next_step()
   }

we'd have

   while (time_is_remaining()) {
     animate_to_where_we_should_be()
   }

this makes the animation take a constant time on all computers 
(controlled by the user), but it will be smoother on a faster computer.

With a 60ms animation this may not make much difference.  However it 
will give the user a more direct control over the animation, and will 
work better on computers of different speeds.

Note that with real "animation" this generally wouldn't be possible. 
We'd have a discrete number of frames for the animation and would have 
to draw them precisely.

jason




[Prev in Thread] Current Thread [Next in Thread]