spine-runtimes icon indicating copy to clipboard operation
spine-runtimes copied to clipboard

[unity] Performance improvement - parallelization

Open HaraldCsaszar opened this issue 5 years ago • 22 comments

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 avatar May 06 '19 14:05 HaraldCsaszar

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

HaraldCsaszar avatar May 06 '19 14:05 HaraldCsaszar

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.

HaraldCsaszar avatar May 06 '19 14:05 HaraldCsaszar

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

vinerz avatar Oct 08 '19 18:10 vinerz

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.

HaraldCsaszar avatar Oct 09 '19 08:10 HaraldCsaszar

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!

EastNightmare avatar Oct 12 '19 07:10 EastNightmare

@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

AceEX7 avatar Jan 07 '20 09:01 AceEX7

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

HaraldCsaszar avatar Jan 07 '20 14:01 HaraldCsaszar

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

bilck avatar Aug 26 '20 20:08 bilck

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

HaraldCsaszar avatar Aug 27 '20 08:08 HaraldCsaszar

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.

UNNYHOG avatar Nov 04 '20 14:11 UNNYHOG

Thanks for sharing @UNNYHOG!

HaraldCsaszar avatar Nov 05 '20 19:11 HaraldCsaszar

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!

HaraldCsaszar avatar Dec 14 '20 16:12 HaraldCsaszar

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

suntabu avatar Nov 22 '21 08:11 suntabu

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.

HaraldCsaszar avatar Nov 22 '21 18:11 HaraldCsaszar

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.

Darth-Carrotpie avatar Sep 06 '23 12:09 Darth-Carrotpie

@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.

HaraldCsaszar avatar Sep 06 '23 12:09 HaraldCsaszar

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.

Darth-Carrotpie avatar Sep 06 '23 13:09 Darth-Carrotpie

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.

HaraldCsaszar avatar Sep 06 '23 14:09 HaraldCsaszar

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

TranHaiQuan avatar Mar 18 '24 03:03 TranHaiQuan

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

HaraldCsaszar avatar Mar 19 '24 06:03 HaraldCsaszar