EsotericSoftware / spine-runtimes

2D skeletal animation runtimes for Spine.
http://esotericsoftware.com/
Other
4.42k stars 2.92k forks source link

[unity] Performance improvement - parallelization #1348

Open HaraldCsaszar opened 5 years ago

HaraldCsaszar commented 5 years ago

Performance Improvement: Currently only the main thread is used for all computation tasks.

Parallelization / Unity Job System / Entity Component System / DOTS / Burst Compiler could be utilized to move workload off to other threads.

Should help a lot performance-wise, could especially benefit mobile devices.

Consider this forum posting here, requesting support for Project Tiny C#, lightweight build for Web.

HaraldCsaszar commented 5 years ago

User reported problems when repacking atlases due to many item changes on the forum: http://esotericsoftware.com/forum/Repacking-Lag-Issue-11494

HaraldCsaszar commented 5 years ago

As reported on the forum here http://esotericsoftware.com/forum/Async-Skeletondata-loading-11911, ReadSkeletonData() takes up substantial time, more than tolarable when in a streaming environment.

ReadSkeletonData() could be moved to another thread.

vinerz commented 5 years ago

Hey @HaraldCsaszar! Is this the official issue to follow for updates about the Project Tiny compatibility?

HaraldCsaszar commented 5 years ago

Hi @vinerz. Yes, it is. As soon as development of any ECS adaptation of spine-unity starts, we will split off a separate task and reference it here.

EastNightmare commented 5 years ago

Hi @HaraldCsaszar Unity DOTS Animation sample project will be avaliable later this year: https://twitter.com/unity3d/status/1176170116020670466 Hope the spine-unity for DOTS is availabel this year too!

AceEX7 commented 4 years ago

@HaraldCsaszar thank you Harald for creating this issue, i'm the user that reported the repack issue, we've stopped working on that project mentioned in the link for a while and we're getting back to it in a couple of weeks, I still haven't found a solution to this problem and was considering switching to a different 2d skeletal system, having seen this issue got me wondering if it's something that you already started working on? maybe i'll wait a while since we've created everything using spine and it would be a big change to work with other tools

HaraldCsaszar commented 4 years ago

@AceEX7 Unfortunately, due to other higher priority tasks, this task has not yet been started.

bilck commented 4 years ago

Hi @HaraldCsaszar Is there an ETA for this issue? Has this task already started?

HaraldCsaszar commented 4 years ago

Unfortunately we cannot provide an ETA for it yet, sorry. You can see the in progress label when it is started.

UNNYHOG commented 4 years ago

I got some orders to create PlayAds with spine animation. I really wanted to make it with Unity Tiny, but found that Spine isn't yet working with ECS and Tiny.

So I spent some time and created my own plugin, which helped me to finish my projects. I'm selling it on the Asset Store now. It doesn't support all the Spine features yet, but it should be more than enough for a simple PlayAds game. It works only with Bones and Slot Attachments (Region) animations.

Before official Spine support is available, you can use my plugin: https://assetstore.unity.com/packages/slug/181832 If you need some additional features for me to cover, feel free to let me know. The Asset is paid, but one PlayAd order will pay it off for sure.

HaraldCsaszar commented 4 years ago

Thanks for sharing @UNNYHOG!

HaraldCsaszar commented 3 years ago

Also requested on this thread: http://esotericsoftware.com/forum/Unity-15060

Note: Skeleton update performance on PS4 could be improved from 16ms to 2ms by enabling IL2CPP!

suntabu commented 3 years ago

Hi, any good news on Spine running with JobSystem? Looking forward to it

HaraldCsaszar commented 3 years ago

This very big task still needs to be finished as a prerequisite: https://github.com/EsotericSoftware/spine-runtimes/issues/1414 After some urgent tasks and interruptions we're again working on it. Unfortunately we can't put everything else on hold for a month to exclusively work on this, so it takes longer the more porting work, bugfixes, forum support and replies to questions are necessary.

Darth-Carrotpie commented 1 year ago

4 years later, this is still at the bottom of priorities... sad... Back in 2017 a dude did half of work by himself. I remember when we started dev of our game in 2018 and decided to use Spine... apparently for our game it was a mistake, as multithreading capabilities are now our top priority in a DOTS design.

HaraldCsaszar commented 1 year ago

@Darth-Carrotpie Sorry to see you disappointed, which is understandable of course. The order on our roadmap is not the priority order BTW, it's just sorted by ticket ID, I guess you misunderstood that. We would love to get to implement parallelization, unfortunately the task https://github.com/EsotericSoftware/spine-runtimes/issues/1414 as mentioned above takes far, far longer than anticipated and is a prerequisite. Unfortunately any clean solution always takes its time.

In the meantime it's recommended to use the asset store plugin mentioned above, if you don't want to wait for the official feature implementation: https://assetstore.unity.com/packages/tools/animation/spine-animation-converter-for-ecs-and-tiny-181832 Also, answering comments like this one also takes away time which could otherwise be spent implementing features and bugfixes.

Darth-Carrotpie commented 1 year ago

Also, answering comments like this one also takes away time which could otherwise be spent implementing features and bugfixes.

TBH, sounds like an attempt to put blame on me (and others in the thread in retrospect), for taking it long. Not our fault you do not have a dedicated QA person to off-load communication for you. Perhaps it's time to hire one?

In the meantime it's recommended to use the asset store plugin mentioned above, if you don't want to wait for the official feature implementation:

Unfortunately, Spine animation converter for ECS and Tiny is no longer available.

And this is the problem with unofficial assets in Unity. They die quickly.

HaraldCsaszar commented 1 year ago

TBH, sounds like an attempt to put blame on me (and others in the thread in retrospect), for taking it long.

It does not matter who is to blame for something. The majority of github comments contain relevant (bug-related) information. It's not very helpful to have a dedicated person (that would be Luke in our case) pre-filter a channel where 95% is technically relevant anyway and should be addressed as soon as possible.

I understand that when things are getting frustrating, it might be relieving to share your disappointment online. Unfortunately "when will X be done, it took so long already" is neither helpful nor motivating for the other side either, so what is achieved is that now more people are having a bad time instead of just one, and time was wasted writing about it. Please note that priorities will not be shifted according to github comments, unfortunately not even if they are incouraging and polite. We take the time for each ticket that it takes to complete it in a clean and stable way. As I mentioned above, the ticket is not prioritized low, the roadmap is ordered by ticket ID, not by precedence.

And this is the problem with unofficial assets in Unity. They die quickly.

That's unfortunate indeed, I didn't see that earlier, sorry.

TranHaiQuan commented 8 months ago

@HaraldCsaszar when do you release spine using job system? please!!!!!!!!!!!!!!!!!!!

HaraldCsaszar commented 8 months ago

We're working on it whenever more pressing matters allow. It will not be released before it fulfils our quality requirements, sorry.

Alfafar commented 3 months ago

Looking forward to it

jjang16 commented 2 months ago

Would definitely pay more for this!!! (Maybe a paid asset store package would work!!) Would love to see a simple subset of features implemented in the entity system! It would be a good enough start..! Btw always thank you for the awesome product! We can wait for this xD