Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Loading times on iOS and Android

Author
Message
pinete
13
Years of Service
User Offline
Joined: 28th Jul 2011
Location:
Posted: 27th Feb 2016 23:43
Hi guys,
I'm experiencing a weird behaviour regarding loading times on iOS and Android.
Loading aprox. 30-40 sprites, normal size, not big ones, average of 200x200, excepting 7 PNGs of 1920x1080 but almost flat, without noise, with a great compresion,
takes 19.1 segs to load on Android (Samsung Galaxy 4) and 3.6 segs on iOS (iPhone 6).
Fact is that the bigger image of the ones previous mentioned, a 1920x1080, is 78.7kb.
Total amount of mb in images to load is 1.30mb.
How is it possible that it takes almost 20mb in loading all graphics (sprites, fonts and backgrounds) in an Android device?
I'm not doing anything strange, just load them with Loadsprite.

Is this normal? is there any fix or optmization? anyone has experience something similar?
btw I've compressed all the pngs using Tinyimage, just in case, but the gain is just about 1s.

Any idea on how to improve this issue?

Thanks a lot in advance!
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Feb 2016 00:00 Edited at: 28th Feb 2016 00:12
Quote: "7 PNGs of 1920x1080"

78.7kb compresseed in PNG format, but uncompresseed in video memory is considerably more.

Use smaller images, where possible. (Which is always good advice.) See if you can build up a large image from a number of smaller ones.
pinete
13
Years of Service
User Offline
Joined: 28th Jul 2011
Location:
Posted: 28th Feb 2016 00:08
Thanks Mobiius
I know, but how that affect to loading time?
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 28th Feb 2016 00:23
smaller images are always better for loading times, And if you use to many large images some older and less powerful devices will run into issues.
pinete
13
Years of Service
User Offline
Joined: 28th Jul 2011
Location:
Posted: 28th Feb 2016 01:05
Thanks for the comment Cor
but understanding perfectly that's right, any clue about how to solve this exagerated loading times or if it's a normal behaviour to take 19s to load?
Just for my information, is a samsung galaxy s4 considered a older device? My guess is that it's not a newer one but not older still. This device was a premium one just a couple of years ago as longer.. imagine if this device takes 20s to load graphics, what will happen in hundreds of non-premium devices ?
Thanks a lot!

Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 28th Feb 2016 01:30
19s is an awful long time for something to load in my opinion. I am developing a a full 3d game and every device i have tested on is at the most 10s and thats about 50 high quality zombies with a building and some other objects.

i have noticed before when i was loading lots of images load times could be rather high the larger the image the longer the load time. i usually try and keep my images below 1024
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Feb 2016 02:05
Use smaller images, and the load times will be considerably shorter.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 28th Feb 2016 08:36 Edited at: 28th Feb 2016 08:44
You should not use images larger than 1024x1024 if you want to support less than high-end phones. Their graphics cards can't load them. And anything bigger is to be considered big even on PC. It takes up a lot of video memory because they will be completely uncompressed. IIRC a 1920x1080 image is 2048x2048 in video memory (because it's bigger than 1024x1024). Small file sizes only makes it faster to download the app, not to run it. Do you really need to load all images at once?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 28th Feb 2016 08:59
me also noticed the loading time from a (big) png is very long at android. but me need hd images.
AGK (Steam) V2.0.16 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Feb 2016 14:46
Quote: "but me need hd images."

Use many smaller ones tiled.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Feb 2016 14:52 Edited at: 28th Feb 2016 14:53
Actually, I just saw THIS and thought you could use the paste image in image memblock code to construck a larger HD image from lots of smaller images. Nice quick load times.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 28th Feb 2016 23:05
What exactly are you doing that requires multiple 1920x1080 images anyway? Usually you compose a screen from multiple images.
pinete
13
Years of Service
User Offline
Joined: 28th Jul 2011
Location:
Posted: 3rd Mar 2016 11:24
It's a kind of app with different backgrounds images. As it requires for full screen backgrounds there is no way to "compose" them by parts
Apart from that I've some specific sprites for buttons, etc. but that's my main problem, that I cannot de-compose or cut the backgrounds.
What surprises me a lot is the incredible difference into load times from a Galasy S4 and an iPhone 6 as I commented previously...
While in one of them is about 20 seconds (samsung) it takes only 4 seconds in iPhone... That's the main reason that make me think that maybe there is a problem or issue or whatever with the Android version regarding load big images or something like that
JohnnyMeek
11
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 3rd Mar 2016 12:17
The load times on Apple devices is much quicker than Android. I've been using AppGameKit for a couple of years and this has always been the case.

I suspect that it's just due to cheaper components on some Android devices.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Mar 2016 12:19
Galaxy S4 is 1½ years older than iPhone 6. The phones also use different CPU, GPU etc and different OS. And IIRC Android generally takes longer to start apps. BTW, make sure that you iPhone doesn't have it preloaded. Reboot both phones and start up the app the first thing you do.

You should only load the background that you currently need and delete the backgrounds you are not using. Much faster and doesn't use up a lot of memory. Images takes up a lot of memory when loaded because they will be uncompressed. And for the sake of compatibility I would split them up into 4 smaller images and use 4 sprites, keeping them under 1024x1024 so older phones can load them. Or you can have 2 versions and load a smaller one if the resolution is low.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Mar 2016 13:53
Scale the images down, and stretch them fullscreen. it won't make that much difference on a mobile device screen.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Mar 2016 15:17
Mobiius:
Could make a difference on a 10" tablet though
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Mar 2016 15:57
I wouldn't say that much of a difference if the image is high enough quality.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Mar 2016 19:19 Edited at: 3rd Mar 2016 19:19
Mobiius:
Depends on what is in the image too. The finer the detail the more you will notice. But perhaps you are correct for most background images.

pinete:
Keep in mind that not all screens are 16:9. iPad is 4:3. It's usually a good idea to allow for bigger backgrounds. Apple doesn't allow black borders in iPad apps.

Login to post a reply

Server time is: 2024-09-29 11:32:21
Your offset time is: 2024-09-29 11:32:21