• Runtimes
  • Is it possible to change the framerate of animations?

  • 編集済み
Related Discussions
...

Hi there, I'm looking into Spine Pro to see if it could fit my game's needs and I have some questions.

Some context: this is the runtime that I would use: https://github.com/pixijs/spine, and my game is a browser-based (using Pixi JS), 2D, 4-directional MMORPG, that uses PNG Spritesheets for all animations.

The characters and NPCs have a pretty low framerate (less than 15 FPS) because that's the style of the game. Whereas all the examples of games using Spine -that I've seen- have a very smooth high framerate (more than 60 FPS).

Here are a couple of images with descriptions to clarify what I mean:

All of Spine's examples have a very high framerate (60 FPS or more): http://esotericsoftware.com/spine-demos, which are very different from the NPC animation in my imgur link, because it has at most 15 FPS and that's what I'm trying to achieve.

Some people told me that it's impossible because Spine does frame interpolation, so it can't pick out 15 frames out of the whole interpolation and play that (don't know if this is true). Some other people told me that it is actually possible to play everything at 15 FPS at runtime but under the hood it will still be "computing" the animation as if it had 60 FPS. In other words, the user sees the animation at 15 FPS like I want - but they would still suffer the same performance hit as a 60 FPS animation. Of course this wouldn't be ideal since in my game there a lots of characters and NPCs in the screen at all times - this could be a big performance hit to any computer, as you can see here:

I think the Spine Boy in that video is running at least on 60 FPS, and what I'm supposing is that if somehow you could run it on 15 FPS instead, the performance hit would be lessened by a lot. Anyway, if something is not clear let me know. Thanks in advance!

Spine is not limited to any frame rate. Most parts of Spine animations are interpolated (everything except attachment changes and events). When an animation is applied, the skeleton is posed at that time. You can increment the animation time with any amount of precision you like. Most games let the animation be applied based on the wall time elapsed between screen draws. This makes the animation smooth at any frame rate. You can also increment the animation time less often to achieve a lower frame rate. For example:
Changing refresh rate at runtime to mimic No Interpolation

2年 後

Hi @Nate Im aware this discussion is old but I'm having a similar issue. When you edit animations on spine 30 frames are 1 second. When you bring those animations to unity they import at that rate and the seconds display that (1,133 seconds). We need in our project that in import time it imports at 64 frames per second so the seconds in the skeleton data show the same. However we have not found a way to do that. Is that possible?. (changing the time scale is dropping some frames if I make it run faster)

I found the solution. For anyone interested the only thing that has to be done is changing the TimelipseFPS to 64 (in my case) and it imports in the respective amount of seconds in unity.