Suggestion Issue: Ping-pong animations


Pages: 1

irock

  • Master Stencyler
  • *
December 28, 2019, 04:26:56 pm
Support for ping-pong animation playback would be nice to have. It would be enabled as a checkbox in the animation editor alongside the current "Looping" and "Synchronized" options.

For example, if you have 4 frames, they would play back like this with ping-pong enabled:

Looping: 0 1 2 3 2 1 (loop)
No Looping: 0 1 2 3 2 1 0

Right now if you want to accomplish this, you have to copy and paste frames 2 and 1 to the end of the animation, but this is redundant, increases the overhead of your animation, and increases the amount of work you have to do setting this up or modifying animations.

Redundant:


Optimal:


I have many instances like that in my game, and it would be nice to eliminate them. You can imagine how needlessly inefficient this might be if you have long animations or high resolution assets.
« Last Edit: December 28, 2019, 04:43:26 pm by irock »


irock

  • Master Stencyler
  • *
December 28, 2019, 04:36:02 pm
Considerations for the question, "what happens when the user uses setCurrentFrame() ?"

setCurrentFrame() wouldn't change the current animation playback direction (e.g. if the animation is currently going backwards, and you set the current frame to 9, the following animation would be 8 ).

and functions ought to be introduced that do the following:

- Get current animation playback direction
- Set animation playback direction
« Last Edit: December 28, 2019, 04:37:37 pm by irock »


irock

  • Master Stencyler
  • *
December 28, 2019, 04:41:00 pm
Also, functions for...

- Getting whether or not the animation is a ping-pong animation (esp. important for calculating the true animation length)
- Enabling/disabling ping-pong for the current animation


LIBERADO

  • Expert Stencyler
  • *
December 28, 2019, 04:42:46 pm
+1


irock

  • Master Stencyler
  • *
December 28, 2019, 04:50:39 pm
Also, in the implementation of this, there's the inclination to treat "reverse" animations as additional frames that share images ("0 1 2 3 (4) (5)" instead of "0 1 2 3 2 1") but this introduces weird inconsistencies, such as a frame duration change to frame 1 in-editor effecting frame 5, but the same change in-engine only effecting frame 1, or having to calculate frame numbers if you want to work with them at runtime.

With that sort of implementation, in order to maintain consistency between the editor and the engine, you would have to implement a distinguished visualization of the "reverse" frames in the animation editor.
« Last Edit: December 28, 2019, 04:54:21 pm by irock »


Pages: 1

Details

  • Reported
    December 28, 2019, 04:26:56 pm
  • Updated
    December 28, 2019, 04:50:39 pm

  • View Status
    Public
  • Type
    Suggestion
  • Status
    New
  • Priority
    Normal
  • Version
    (none)
  • Fixed in
    (none)
  • Assigned to
    (none)
  • Category
    Engine

Tags