SerpentDrago / skin.auramod

Auramod Skin for Kodi 18
83 stars 20 forks source link

Option to disable focus transition animation for performance improvement #264

Open movianlost opened 2 years ago

movianlost commented 2 years ago

When you select an element, the skin lets the user know which element got selected by increasing the element height/width then decreasing them again to its original size in a split second. If you scroll very slowly then there is no problem as the transition animation have enough time to finish, but if you try to scroll through the elements fast, then it will start glitching and scrolling is no longer smooth.

The same behavior is noticeable when you have for example "Poster View" and you have a horizontal scrollbar, if you try to scroll fast, it will glitch and the scrolling is no longer smooth.

So there is two problem, the first is transition for the element size change and the second is that the skin is not able to handle multiple calls to scroll within a short period of time, I suspect that the problem is that I'm trying to scroll but the previous scroll hasn't finished yet which make the scroll glitchy.

For the element size change, I suggest you don't change the element size when it's on focus, just add the border around it instantly, this will look and perform better this is how a lot of skins do it, another way is to have a fixed border and then the element move through it like "Bingie Mod skin" does it, this makes it clear which element have been selected without the overhead of extra animation.

As for the scrolling issue, the scrolling function can be adjusted to solve this, there are functions already available to achieve this, the idea is whenever the user clicks to scroll, the scroll function recalculate its position and destination and adjust its speed.

And by the way, this is most beautiful and complese skin I've come across, and I tried a lot. Thank you for coding this skin.

inb4after commented 2 years ago

You can remove the animations when scrolling items in Skin Settings > Widgets > Focus bounce animation.

You can also turn on "Disable Fixed Focus" for each widget in Skin Settings > Home > Customise Home Menu & Widgets, which will delay moving the widget across until you reach the end of the visible items.

movianlost commented 2 years ago

@inb4after I did what you said and it now works as you described, now the focused item remain the same size, but unfortunately it didn't help with the stuttering the way I was expecting.

The scrolling stuttering remain the same, it seems like this is not a performance issue, but rather a feature of the current scrolling function used by the skin.

The stuttering happens if you try to scroll before the previous scroll gets to finish, at that moment, the previous unfinished scroll is forced to finish immediately and another new scroll start, this causes the stutter.

BTW, I'm talking specificallly about "Showcase" view, The current scrolling function works great with "Big Poster" view because the position of the focused item remains fixed (1st from the left), but for other views like "Showcase" view, the focus first goes to the item then that item moves to the left, this causes the stuttering.

The solution is to change the scrolling function. There are multiple functions that can regulate the scrolling behavior, like "Linear, Ease-in, Ease-out, Ease-in-out" and then for each function, you can customize it even further by choosing whether to run it as "Quad or Qubic". I had a similar problem in the past while working with web a application that had items and scrolling involved and I was able to fix this by changing the scrolling function to one of the above mentioned. The end result is a seamless smooth scrolling not matter what speed you try to scroll.

I have been looking through the code and I can see that you have ported "Bingie Search" style through includeBingieSearch.xml, is it possible to port the way that Bingie handles the scrolling and focus using the rectangle white border that moves to the selected item?

inb4after commented 2 years ago

I see the "list jumping" you are referring to when scrolling across a widget too fast, this happens with all widgets and not just views such as Poster Showcase in DialogAddonInfo.xml. Additional smoothing animations would have to be added to the entire skin globally. The reason it happens is because Kodi handles the list scroll smoothing animation and the skin does not define any additional easing parameters. It has been this way since the beginning and affects similar skins like Arctic Horizon.

AuraMOD was created by skyfsza, who ported some features of Bingie. AFAIK Bingie uses a static rectangle poster border and the widget list itself will move through it. It is possible to port other features, but it's cleaner if it was emulated using existing code.

movianlost commented 2 years ago

I've been tinkering with the code and I was able to improve the "list jumping" so now it works great. I'm still in the process of trying to figure things out inside the skin, but at least now I know that it can be easily fixed. I've changed some values inside includes_view_posters.xml file starting from line 1845 just for a specific view that I'm interested in. I can't remember what I changed exactly, I will have to retest again tomorrow to see which values actually affect the performance and I will be sharing them here for anyone who's interested, I think it was tween value which can have multiple values like linear,cubic, quadratic, etc and I may have shortened the time value. So this is very doable, I just have to invest some time into understand the code and I will definitely be able to make it run very fast.

The conclusion is that this is skin dependent and it can be changed from within the skin without relying on Kodi itself. If someone with knowledge on how the Auramod skin is organized, I think this can be fixed very easily.

Yes you are right that Bingie skin uses a static rectangle, but they also offer another alternative of having the white rectangle move with the widget, so the rectangle actually moves from one item to another and when there is scrolling needed, first the rectangle moves to the new focused item, then the scrolling happens and it makes it return to its position. Both of these are great features to have and each one can be used in specific scenarios.

Bingie has the complete Netflix look, its only disadvantage is that it doesn't work with addons, as most of their features are exclusive to library content. On the other hand Auramod lacks some "Netflix look" features, but has the performance and better addons integration. So, is the Auramod development focused on having the complete "Netflix look" like Titan Bingie, or are you targeting a different look?

inb4after commented 2 years ago

As I mentioned, by defining those easing parameters in the skin, it will change the visual effect of the scrolling animations. I don't think it has any positive effect on performance, in fact those additional animation parameters are increasing the performance load.

At the moment, I'm still focusing only on bugs as any enhancements like redesigns or animation changes are lower priority. This will switch over at some point once the skin is relatively bug-free.

movianlost commented 2 years ago

I agree with you, bugs are a priority over introducing new features. I've come across a couple of bugs myself, the most annoying bug is when Kodi start crashing, it just randomly forces exit from Kodi.

Should I create a separate issue for each bug I find?

Another question concerning performance. when I use "Netflix Season" view and iterate through the seasons, it tries to load the episodes in each season that is in focus without me clicking on the season, so for example to reach season 10 of a show, it's loading all seasons in between which make it run slow. Is there any way you can change this behavior to load the episodes on the right side only if the user click on the season?

inb4after commented 2 years ago

I've not experienced any crashing because of the skin, but I have experienced some rare Kodi crashes in general on any skin. If it does crash, isn't the force exiting expected? I'm not sure what you mean by that.

Yes, please create separate issues for each bug or feature request.

It is definitely possible to improve performance by hiding unfocused areas in some views like Netflix Season.

movianlost commented 2 years ago

My bad, I haven't worded my phrase correctly. I used crashing and force exiting interchangeably. I've cleared my Kodi setup and started a new installation of Auramob, if it starts crashing again, I will start a new issue with the corresponding logs.

I'm not sure I get what you mean by "hiding unfocused areas". What I meant is that the episodes shouldn't get loaded at all before the user clicks on a certain season, If the focus is on a certain season, its episodes shouldn't load in the screen or in the background before the user first clicks on that season, this is how its done in Bingie skin. So I want to change when the skin makes API request to TMDB from just having a season in focus to having the user click on that season before any API request is made.

Currently, for example I have season 1 focused and then I want to go to season 10, which means I will have to pass through season 2,3,4,5,6,7,8,9, and 10, there is a request in the background for each of these seasons even if the data that you get from these request will not get utilized at all. now a task that require one TMDB API request to get episodes in season 10 is done through 10 API request. So this either needs to be fixed so that it consumes 1 API request or gets removed so that to not overload TMDB with unnecessary requests.

inb4after commented 2 years ago

You should open a new issue so we can discuss it separately.