Search Unity

Bug: 4GB limit to Textures in standalone build

Discussion in 'General Graphics' started by ShilohGames, Nov 14, 2016.

  1. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,689
    That's very strange that it's crashing. If you could provide us with some crash dumps or logs that would be great. Be nice not to have it crash for you ;)
     
    radiantboy likes this.
  2. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    399
    I have the same problem. All game is pink if build is too big for Unity. Actually is not big, i just added a normal scene for standalone, i realized if i removed some parts it worked.
     
    Last edited: Dec 22, 2019
    karl_jones likes this.
  3. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    399
    YOu can see it in the build log in C:\Users\nameofyourusername\AppData\LocalLow\Nameofproject\Nameofbuild
     
  4. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    394
    I get this error.

    sharedassets0.assets'. Serialized files over 4.00 GB

    What should I do? I didn't even created 10% of my game world!!!
     
  5. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    399
    I think your scene uses more than 4gb, split it in several scenes. Also for some reason i had also problems with a certain scene and when i moved all the gameobjects to other scene build didnt have any problem. In my case i had all pink and i solved it in that way
     
    Crossway likes this.
  6. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,099
    Yea , thanks I worked around this issue.. Streaming solves it pretty good.
     
  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,689
    You could try the 2020.1 update when it's available, which should solve the issue or re architect your project into multiple scenes or asset bundles.
     
    Crossway likes this.
  8. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    394
    How can I keep the links between objects if I create multiple scenes?
     
  9. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    4,476
    Unity Technologies gave a talk about this a while ago:

    Here are the files he was referring to in the talk:
    https://github.com/Unity-Technologies/guid-based-reference
     
    Crossway and karl_jones like this.
  10. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    946
    How do you do your streaming? id like to try if it doesnt involve too much work :)
     
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,689
    Look at Asset bundles/Addressables. They can load asynchronously.
     
  12. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    946
    ah yes, to be honest this solution doesnt work for me because its too manual to set up, if it can be automated it would be good, but there is no way i can mark up everything, I have too much in this scene. Ideally there would be a way to auto analyse a scene and generate bundles of graphics, sounds etc for that particular scene. I may write an asset for that sometime next year. For now im just happy with the 4 gig fix so I can soldier on with current resources system, but obviously this will become an issue one day when I need to release a small fix/patch. Thanks.
     
    Lars-Steenhoff likes this.
  13. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,099
    If you use steam to sell your game it wont be an issue..
     
  14. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,099
    Theres no real tutorial about it.. and streaming does the same.
     
  15. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    946
    why not? What if I fix 1 small bug, wouldnt they need to get the entire game again ?
     
  16. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,099
    No, it will only download changed files.
     
    radiantboy likes this.
  17. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    946
    nice, i need to read up on how that works..
     
  18. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    130
    If you have a large Unity project you can tell the bug reporter to *not* include your Unity project in the submission. i.e. I have several gigabytes of assets and I don't want to even try to send that. The Unity team will still get your editor log, crash dump, and versioning in your bug report, which is all useful.
     
    karl_jones likes this.
  19. seansteezy

    seansteezy

    Joined:
    Nov 28, 2013
    Posts:
    115
    Thanks! For anyone else experiencing this issue, on older versions, I did the multiple scene thing and it worked pretty easily. Working with 16gb+ point cloud data files, had to split the assets into 5 or so files of 10 million per scene and then load them async/additive at runtime, grab the assets through a simple script, and combine them. Now the hard part is making it perform fast ;)
     
    PhoenixAdvanced likes this.
  20. cloverme

    cloverme

    Joined:
    Apr 6, 2018
    Posts:
    31
    I can't quite visualize the setup of the original solution, I've been reading the post a few times but it's not quite clicking in my head. Could you maybe provide some more details on the setup?

    Update: I figured it out, it works amazingly well for a solution... prior to when 2020.1.0a19 is released.
     
    Last edited: Jan 16, 2020
  21. Bigpete591

    Bigpete591

    Joined:
    May 7, 2013
    Posts:
    57
    Can anyone confirm this is fixed in 2020.1?
     
  22. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,689
    Bigpete591 and richardkettlewell like this.
  23. Zeurin

    Zeurin

    Joined:
    Sep 27, 2018
    Posts:
    3
    First come first, Thanks you for the work on this topic.
    Second, is there a comparative between the loading speed of an asset bundle loaded from assets/bundle folder and the same weight of assets in direct reference way? I am working right now in a project which has Real location photos, text....and I am wondering if it would be a good practice to approach this from an Asset Bundle perspective.

    Thanks.
     
  24. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,689
    Its hard to compare. Generally:
    • scene in the build with direct references. data directly referenced loads quickly. has no asset bundle overhead. but ALL data directly referenced must load when scene loads.
    • scene in build, with addressable references. data loading speed may be slightly slower if data is all in one bundle. If data is spread out, it could be much slower. Each bundle will have slight overhead.
    • addressable scene with direct references. again the data could end up in one bundle or many. more efficient to load/unload in one bundle.
    The fact is, having direct references in scenes, and including it all in the build, works pretty well, until it doesn't. If you have a 2gig android project, direct references in the player are somewhat out of the question.

    perhaps another way to phrase it...
    • if "same weight" is 10mb, it's likely slight faster if data is in build.
    • if "same weight" is 1gb, then in-build load time is infinite because no one will have your app.

    If you are using Asset Bundles then you can increase the speed by using uncompressed bundles.
     
  25. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    4,476
    I wouldn't say that's true always.

    According to my tests, loading speed depends on platform and compression type. For example, I remember a specific console platform loads chunk-based LZ4 compressed bundles significantly faster than any other compression type.

    It's worth to test your game on every target platform with every compression Unity supports. Track how much time each level requires to load. Then pick the compression that works best for you.
     
    karl_jones likes this.
  26. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,099
    Hello! when will 2020 be out of beta?
     
  27. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    559
    In 2021 lol
     
  28. KokkuHub

    KokkuHub

    Joined:
    Feb 15, 2018
    Posts:
    107
    Keep in mind LZMA compression will cause the bundle file to be entirely decompressed to memory in one go when it's loaded. This can easily double your memory usage if you keep your bundles around after loading assets from them (which is how Addressables work, if you are using that).
     
    glenneroo likes this.
  29. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,099
    lol
     
unityunity