AnimationDelay for 'extra' loops, 8 and up

Started by bx83, Mon 05/06/2017 09:11:39

Previous topic - Next topic

bx83

I've added a few loops for my main character, taking up loops 8 and 9, and notice when it plays, it's much slower than walking animations (DLY=0?).

When I speed it up (by changing DLY delay below each and every tedious frame), it stutters in parts and animates slowly, then quickly. It always stutters in the same part: but *every* frames is set to -7 delay (I have 30-40 frame animations, -7 works well for AnimationSpeed).

-Why is loops upward from 7 not controlled by AnimationSpeed? (currently -7)
-Why does loops like this stutter?
-Do I need to adjust DLY on every frame, or is there another way/function?

Any help would be greatly appreciated :)

edit: it had not every frame to -7, one was 0, one was 7.

AnasAbdin

I create separate views for characters animations from the main walk animations. Walk animations have 8 loops from 0 to 7 and are controlled by setting the walk speed in the script. Whenever I need to use other animations I change the view and animate per loop.

Crimson Wizard

Quote from: bx83 on Mon 05/06/2017 09:11:39
-Why is loops upward from 7 not controlled by AnimationSpeed? (currently -7)
This is actually an interesting question. I haven't noticed the manual mentioning that this works only for walking loops.

Snarky

#3
It's because when you're playing other animations, you're using Character.Animate(), which takes the delay as a parameter. (The manual says that 0 is the fastest, but I would try it with -7 instead of setting each frame delay manually. It seems likely that the manual entry just hasn't been updated since animation speed was extended to negative numbers.)

bx83

...But both are set to -7 (DLY on frames, and Animation argument), it goes reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally slooooow. Shouldn't the frames trump Animation argument? Other way around?...

bx83

Why are they fast separately (AnimationSpeed and Delay), but together very slow? How is -14 slow?
Or should I be using AnimationDelay?

Snarky

#6
AnimationSpeed and AnimationDelay are the same thing: http://www.adventuregamestudio.co.uk/forums/index.php?topic=53702.msg636538790#msg636538790

What it means is how many game loops to "hold" an animation frame for.

By default, AGS runs at 40 loops per second. So if an animation runs at a speed (i.e. delay) of 2, it means each frame will be shown for 2 loops, and the animation framerate will be 20 frames per second. If it runs at a speed of 1 it will be shown for 1 loop (40 fps). Common values for the animation speed are 3 (13.3 fps) or 4 (10 fps), similar to TV cartoon animation.

You can't show each frame for less than one loop (since the game only updates once per loop), so the lowest valid value for the animation speed/delay is 1.

However, the effective animation speed is calculated by adding two values together: the character animation speed, and a frame adjustment (which can be used to slow down or speed up particular parts of the animation), called "Delay". The frame adjustment can be negative; I'm not sure whether the animation speed can. In any case, the sum of these two values should always be 1 or greater.

What happens if the value is less than 1 is undefined. So trying to run the animation at a speed of -7 is a fundamentally wrong approach. If it works at all, it must be because AGS starts skipping frames in the animation. In that case, you should just create an animation with fewer frames.

(I should probably acknowledge that I'd forgotten about some of these details in my earlier replies. There's another setting, MovementSpeed, that can validly be negative: in this case, negative numbers represent fractions. So e.g. -3 = 1/3.)

Mandle

Quote from: Snarky on Wed 14/06/2017 08:55:00
There's another setting, MovementSpeed, that can validly be negative: in this case, negative numbers represent fractions. So e.g. -3 = 1/3.

I had no idea about this! Thanks for the info!

Snarky

I can't swear to that being the exact calculation (it would leave 0 undefined, for starters), but it's something along those lines.

SMF spam blocked by CleanTalk