Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Spine vs Spritesheet animation perfomance — Gideros Forum

Spine vs Spritesheet animation perfomance

Apollo14Apollo14 Member
edited November 2018 in Code snippets
Hey guys!

I've just tested Spine perfomance vs traditional spritesheet animation (inspired by this video)
Personally, I've expected that Spine animations will perform better, but it turned out that spritesheet is much faster.

I'm getting 60fps on my phone with 300 spritesheet objects, while with 300 spine objects there's only 7-10fps. Project resolution: 1280x720

1) Is it normal or something seems wrong there?
2) Are there ways to further improve perfomance? (I'm not sure if my code is well optimized)

(I've attached my gproj, also there's exported apk and code on github)

What do you think about it?
Thanks!

p. s. I'm also curious about 'SpineC' vs 'SpineLua' comparison. Probably SpineLua will be significantly slower (or maybe not :).
p.p.s. Can we make apk size less than 8mb? I've excluded all but x64 libs.
When I've tried to include only x86&arm, apk size was still 8mb.

image
> Newcomers roadmap: from where to start learning Gideros
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)

Comments

  • I'm not sure is a spine object is a few sprites or a single mesh, if it's a single mesh then you would expect similar times on average - depending on the shape, etc.

    Likes: Apollo14

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    I am not surprised, spine recomputes mesh vertices each frame, so it uses more cpu. The benefit of spine is small file size and less you memory consumed
    +1 -1 (+2 / -0 )Share on Facebook
  • Apollo14Apollo14 Member
    edited November 2018
    Hey guys!
    I've just tested SpineLua lib in the same project, due to extremely low perfomance it is literally UNUSABLE (I'm not even sure if anybody from Corona users could ever use SpineLua in any actual project)
    I'm getting only 22fps when I spawn just 10 objects (on a pretty good hardware, most of android users have much slower phones)
    With such extremely low perfomance we can have maybe one or two spineLua objects on stage, not more.

    With SpineC I'm getting stable 60fps in the same project if I spawn 60 objects.

    Can you pls check my simple code snippet? Maybe something in my code is extremely inefficient?
    https://pastebin.com/bjEuSBac

    p.s. I'm not sure if it will be of any help if we replace standard lua operators with Gideros' custom operators? (I guess it won't change perfomance dramatically, considering how bad it is in the original spinelua lib)
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • That's curious, I've posted topic about bad SpineLua perfomance on Corona forum, it was silently deleted
    (code snippet was converted for Corona, there was no whining, no spam, no mentionings of other game engines, nothing suspicious in topic)

    Likes: SinisterSoft

    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
    +1 -1 (+1 / -0 )Share on Facebook
  • Censorship at work maybe? At least you know we won't ever do that. :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • I'm sure if you write a list of the absolutely necessary api functions that are needed then they could be added, or take a look at the plugin as you may be able to add some then submit an updated library. In the wiki we now have updated the instructions on how to build gideros so it's pretty straightforward, and people are here to help if needed.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Of course sprites are going to be faster than full skeletal animation. Spritesheet animations are just flipping images whereas skeletal animation involves a whole lot of math.

    I was curious about this because I'd like to use Spine in some future projects myself. I started with Defold and couldn't find anything of any use there about how Spine performs on their platform with large numbers of Spine animations onscreen. It would be good to see an actual apples to apples comparison using the same Rooster animations in Defold.

    On a side note, whilst I was at Defold I fumbled upon their tutorial for making extensions.. it's very easy and rather tempting. Gideros should be as easy also :D
  • Extensions? Do you mean Lua plugins or editor extensions?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • The extensions you can make in Defold are C types of extensions that are compiled and included when you build your project (from what I can tell). It really makes extending the core functionality of Defold very easy and for compute intensive tasks.

    https://www.defold.com/manuals/extensions/
  • Apollo14Apollo14 Member
    edited November 2018

    I'm sure if you write a list of the absolutely necessary api functions that are needed then they could be added, or take a look at the plugin as you may be able to add some then submit an updated library. In the wiki we now have updated the instructions on how to build gideros so it's pretty straightforward, and people are here to help if needed.

    Thanks! I've took a look at plugin's code, it seems that it truly could be quite possible for me to contribute to it if I had some experience in C++.
    If I understood correctly, C++ and Lua are a great pair for game developer, they come together very frequently. But I have a feeling that currently I have to focus on releasing my first 2-3 decent game projects. Learning C++ looks like a long journey.

    P. S. I've wrote about essential Spine calls recently, it seems that @hgy29 is busy in the latter days.
    https://github.com/gideros/gideros/issues/451

    @antix I've watched closely what Defold guys do. It seems that among commercial engines only Unreal&Unity are actually developing.

    We know that owners of Defold and Corona are rich (King and Appodeal), they could actively develop their game engines, if they wanted. But they don't want, they don't see a reason to invest in engines, since they don't squeeze money from there (most likely they're even regretting about this expense line and thinking about reducing it to the lowest minimum).

    Defold lacks lots of essential features that are asked from community. With their resources they could do it all in no time. But they don't want it at all, and don't care.
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • @Apollo14 Defold also has a LOT of stuff that Gideros doesn't. That aside they are progressing their engine with a release every two weeks which is pretty good.. just because they don't bow to the whim of every user who requests a feature does not mean that they aren't moving forward ;)

    I have a bunch of unfinished Gideros projects in the works and once I've finished up with those I'm going to give Defold a little try and see which engine will be better for my ARPG. mostly though.. I want to try out their GUI editor :)
  • Apollo14Apollo14 Member
    edited November 2018
    antix said:

    Defold also has a LOT of stuff that Gideros doesn't

    @antix can you please tell exactly what is there in Defold that you are missing in Gideros? (besides gui)
    I didn't find anything really essential for me (but we may have different views, and I have less experience, maybe I didn't notice something)
    I'm reading their every release note in my newsfeed, personally I didn't notice anything that made me wow. (in Gideros every release is exciting for me: debugger, Megacool, SpineC, etc., this is all awesome stuff)
    The extensions you can make in Defold
    well, I don't know, if you're willing to learn C++ and work on enhancing game engine - then sky is the limit, you can do it with Gideros also, maybe even more efficiently, cause Gideros is fully open-source, you have more control, and you already have few years of experience working with it on lua side.

    p.s. antix, I've posted one comment yesterday on your blog, probably it got lost somewhere in 'spam' folder (I know Wordpress does it sometimes)
    comment was about whining on forum, I agree with you that it was uncultured from my side
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • antixantix Member
    edited November 2018
    @Apollo14 That comment must have gotten lost on wordpress, there was no message in my inbox about a comment, sorry :(

    That video.. the guy is totally not motivational in my opinion.. and he appears to be repeatedly attempting to force something to appear from his rear end ;)

    I'd have to look a lot closer at Defold to say what it has but an inbuilt tile editor, lots of multiplayer support it seems and there are probably more things. Both Defold and Gideros have their major features but Defold is the more mature product. Of course this is only because they have trillions of dollars and can afford a team to make good documentation and other infrastructure. Without resources like Gideros.. I doubt Defold would be anywhere near as good.

    Personally I haven't been wowed by any Gideros improvements recently. Spine support is nice but it will be a while before I even look at that stuff. Gideros does improve constantly of course.. but a bit like Defold.. not in the ways that all users would like hehehe. I must reiterate here though.. @hgy29 does such a huge and fantastic job.. and he isn't backed by a mega evil corporation even!!

    Ahh well actually I'm planning on going back to school next year to start some computer study, majoring in programming so I'll be boarding the C++ and most likely Java train *toot toot*
  • Apollo14Apollo14 Member
    edited November 2018
    maybe we have different purposes for multiplayer, and what they have suits you better
    lots of multiplayer support it seems
    Their lack of real-time multiplayer is the main reason why I won't ever touch Defold.
    For low latency real-time multiplayer we have to either setup our own servers in different regions, or use Photon Cloud.
    (but even than average user latency will be 200ms, it's high as hell, but that's what top mobile companies report based on their stats)

    And Defold team couldn't negotiate with Photon (or hack their SDK, hehe), so they don't support it.

    P. S. Out of curiosity I've tried to replace lua math functions with Gideros' faster operators wherever possible in SpineLua files, but fps didn't improve (uh, predictable anyways)
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • Oh, I thought they had realtime Multiplayer.. sorry ;)

    SpineC should be faster than SpineLua I would have thought, even with optimization to use newer faster math operations.
Sign In or Register to comment.