Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Downloading Images, Mobile Data Guide[Please Help]

Discussion in 'Game Design' started by WirealTalha, Oct 29, 2020.

  1. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    Hi Im creating a simple 2d mobile Game with unity,

    I have run into an issue, Its regarding leaderboard. I am using 120x120 images for leaderbaord that I'm downloading at runtime from the server. I need to understand how much data (Kilobytes or Megabytes) is needed to download One image of 120x120 pixels. I cant find the solution anywhere on web that's why im asking this question here in this forum
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    How much data the image takes depends entirely on what format you choose. If you choose a format with built in data compression, then you also have to factor in how compressible the data is in your image. An image of all a single color will be significantly smaller than an image of random colors for each pixel, when using a format with compression.

    So the only answer really is for you to create one of these images and see for yourself how big your image is.
     
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,580
    Most important question is, why you do that?
    Why don't you store scores in data base? In worse case scenario as a text.
     
    Joe-Censored likes this.
  4. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    what do you mean? I meant Downloading avatars( facebook Profile pictures) of players from facebook. The complete scenario is this.

    I have a leaderboard which takes 3 arguments ( name, Profile Picture and Score). Profile Picture urls is being fetched for Player's facebook friends thru facebook unity sdk. Now to show the pictures i need to downlaod the images at runtime for each user.

    That is the main issue, How do i calculate how much mobile data is used to download each picture. How can i find this out?

    And is it legal to download and save images( all of facebook friends profile images) on mobile so that i dont have to download the pictures again and again.
     
  5. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,580
    That is unspecified in your first post. Howevever,

    You need read Facebook licence department and contact lawyer.
    But I for example, wouldn't want your application, to access any of my Facebook data.
    Because something is public, doesn't mean you can grab and process as you like.

    And I think you got another thread, talking about FB pictures?
     
    Joe-Censored and WirealTalha like this.
  6. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    Yeh That's why I was only interested in calucalting the mbs/kbs needed to download an image of 120x120 in this post. The main issue is the same.

    How to calculate how much mobile data is needed? How do i calculate that?
     
  7. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,580
    You can save any picture locally from Web on PC for testing and see, how much space it takes.
    There are different formats and compression rates. So size in KB may vary. Grab some set of images from desired source and estimate min, max and a average space required.

    You also should consider using cache. And btw, I am pretty sure, the similar subject pops out at least once before on the forum. Try search for such.
     
    WirealTalha likes this.
  8. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    Bro I've tried searching alot for this particular issue. I failed each time ;-O couldnt find any help. I guess I'll have to do this in this way. What should I do?
     
  9. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    If facebook allows to download and save profile pictures of user's friends on user's device then my life is alot easier.
    But cant for the love of God find whether facebook allows it or not. Tried asking it on facebook developers forum. but that forum is sooooo dull. No response to any questions.
     
  10. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The Facebook developer TOS includes images downloaded from Facebook in the catch all "Platform Data". The term appears 89 times in the TOS, so there are plenty of rules to read up on readily available. But this prohibited practice with regards to Platform Data seems applicable here, and has me assuming you will need explicit permission from every one of those friends before accessing their images. I Am Not A Lawyer
    https://developers.facebook.com/terms/
     
    WirealTalha and Antypodish like this.
  11. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    Thanks so much.