So after testing some inventory items I noticed there was a noticeable pause in the frame rate when I attempted to load a list larger than 25 items. My project is estimated to have upwards of 150 items in a single list so I decided to simulate this and by god, It took at least 2-3 seconds to show. This is not ideal performance, especially considering my project is entirely 2d.
After looking into this I discovered this lag happens because the entire list if being dumped into memory all at once. The smart way to handle large list would be to implement a Recyclable Scroll Rect.
https://github.com/MdIqubal/Recyclable-Scroll-Rect
Recyclable Scroll Rect reuses or recycles the least number of cells required to fill the viewport. As a result a huge number of items can be shown in the list without any performance hit.
I would like to request Ork/Makinom use Recyclable Scroll Rect as its default method of handling lists. (the link above is just an example of the behavior I'm speaking about you can create your own method that works with your ecosystem) Data management is the bread and butter of RPGs and being able to efficiently display that data is the bare minimum of what players expect. (why this isn't default behavior in unity, I have no idea)
I'm not sure how to implement this myself, I believe Ork/Makinom handles the creating of prefabs. But I know for sure I can't finalize my project with such slow menu list performance.
For anyone else reading this, I hope we can come up with a solution since this pretty much effects everyone making a data heavy game.
  • It's mainly because it spawns that many input prefabs - if you use pre-placed inputs in your UI box prefab setup that shouldn't really be an issue any longer.

    I can't really use that as a default method, but you can just replace the scroll rect that's created with the custom one on your prefab. Since it descends from ScrollRect it should be working without any issue.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • gamingislove said: It's mainly because it spawns that many input prefabs - if you use pre-placed inputs in your UI box prefab setup that shouldn't really be an issue any longer.
    I forgot pre-placing prefabs was an option. Silly me. I set up a test list with 30 items pre placed and I noticed it was a bit faster but I still had lag. I started to suspect my problem might be else where. I decided to test with a bare bone input prefab and low and behold 30 pre placed items load right up. Finally after slowly stripping my main button down, I fount out it was mostly the playmaker scripts I placed on the prefab that was causing lag.
    I need to go back and do some restructuring for my assets, the closer I can get to bare bone with the input prefabs, the better.
    gamingislove said: I can't really use that as a default method, but you can just replace the scroll rect that's created with the custom one on your prefab. Since it descends from ScrollRect it should be working without any issue.
    After examining Recyclable Scroll Rect more I don't believe it can work with Ork/Makinom without changing how the data is displayed on the input. Since a hand full of inputs will be recycled, they would next to change the data based on the list index as the user scrolls. I have no idea how to do that. lol

Sign In or Register to comment.