How to minimize time when loading multiple photos?

Discussion and help for Easy Save 3, The Complete Save Game & Data Serializer System for the Unity Engine
Post Reply
jhj198988
Posts: 2
Joined: Wed Nov 27, 2024 4:17 pm

How to minimize time when loading multiple photos?

Post by jhj198988 »

I'm trying to load around 200 saved photos when I start playing now.
I tried to save and load the picture as a texture, so I used a byte array.
But it takes too much time to start the game and load 200 photos.
The platform of the game I make is Android.
I already know it takes a lot of time to load a large amount of photos, but I want to shorten the time to a minimum.
Is there a way?
Attached is the coding picture below.
Attachments
캡처 파일.JPG
캡처 파일.JPG (122.48 KiB) Viewed 1278 times
User avatar
Joel
Moodkie Staff
Posts: 5048
Joined: Wed Nov 07, 2012 10:32 pm

Re: How to minimize time when loading multiple photos?

Post by Joel »

Hi there,

Firstly, how are you getting your Texture bytes? If they're uncompressed then that is going to be an extremely large amount of data so will always be slow (this will be limited by your hardware rather than Easy Save).

Secondly, have you followed the Improving Performance guide? This shows how to improve performance especially in situations where you're saving many keys to a single file:
https://docs.moodkie.com/easy-save-3/es ... rformance/

However, in cases where you're saving many images it's usually best to save them as separate images rather than into a single save file. For example ES3.SaveImage and ES3.LoadImage save and load Textures as PNGs. You can use ES3.GetFiles to get all of the filenames within a folder and use this to load all of your images. You can then use a coroutine to load the images over multiple frames rather than trying to load them all in a single frame.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply