Bug: 4GB limit to Textures in standalone build

I second making the build outright fail

3 Likes

How can I see if I have this issue with 4gb limit? I have the same screwd texturesā€¦ this sucks Unity!!!

Is this the file in build ; sharedassets0.assets.resS ? its a littile over 4gbā€¦

Does it count EVERYTHING thats in the project folder OR ONLY the textures you actually use in your scene? Can I make them smaller? they are 4kā€¦

@karl_jones

If itā€™s over 4gb then its the same problem. Newer versions of Unity now have an error message for this. Making them less than 4k should reduce the size. Its not everything in the Projectfolder, we do not include assets that are not referenced in scenes.

3 Likes

Okay thanks! where can I find more info about the Asset Bundle? I found some free one on the Asset Storeā€¦ The same one Githubā€¦ Is it easy to use? Just drop textures there or ? ā€¦

You probably meant 4GB there.

https://docs.unity3d.com/Manual/AssetBundlesIntro.html
https://unity3d.com/learn/tutorials/topics/scripting/assetbundles-and-assetbundle-manager

They have a learning curve but once you get up and running you will find they are not too bad.

Thanks! one question toughā€¦ I understand that theres need to be a script so it can load the assetsā€¦

var prefab = myLoadedAssetBundle.LoadAsset<GameObject>(ā€œMyObjectā€);
Instantiate(prefab);

does that code line be for EVERY prefab and texture or ?

You dont need to load the dependencies for the prefab, just the prefab.

Okay thank you.

What if I have a gameobject in my scene that is a house (prefab) and I have furniture in the house and water bottle with script and food with script (pickup & use)ā€¦ The house is the parent, furniture and food & water is childrenā€¦ I drag the house (gameobject) to the asset bundle manager window and it goes there and I name it ā€œHouseā€. Okay wohoo I have a asset bundle, I build and it creates the META and whateverā€¦

I was thinking only to have houses etc as asset bundlesā€¦

BUT

When I build the game the default way, how does Unity know NOT to include the asset bundle asset & its belongings into the resource file?

Should I build the asset bundle asset to the same folder as the real game?

And the script that loads the asset should it be in the scene on some gameobject?

Isnt the asset you are using for the terrain reusing textures?

Does this work for things like Watersystems, ufps, vegetation studio rendering solution?

Unable to open archive file: C:/Users/Unity/Documents/Asset Bundler Test/Assets/StreamingAssets/AssetBundles
UnityEngine.AssetBundle:LoadFromFile(String)
loader:Start() (at Assets/loader.cs:9)

I got that error with this code_ <<<

using UnityEngine;
using System.Collections;
using System.IO;

public class loader : MonoBehaviour
{
void Start()
{
var myLoadedAssetBundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, ā€œAssetBundlesā€));
if (myLoadedAssetBundle == null)
{
Debug.Log(ā€œFailed to load AssetBundle!ā€);
return;
}

var prefab = myLoadedAssetBundle.LoadAsset(ā€œPlaneā€);
Instantiate(prefab);

myLoadedAssetBundle.Unload(false);
}
}

Should the sceneloader script be on the 0 scene (splash scene)?

Any news about the resource file fix?

Aaah now I get it! This is clever! Much better than the assetbundle if you allready have big project :slight_smile: do you know how to instead of prefabs lets say use it for textures? :slight_smile:

Is it okay if I make a youtube tutorial about this?

This limitation is really bad news for me. I am working on game where I have a lot of different cloths and attachements for player (Almost 6 bg of different meshes + HD textures). Problem is that having that many assets means, that is impossible to have all of them referenced by some kind of config with standard unity references, because if I make references like this, than all of this assets will be stored in RAM memory on device. So I really need to use resources or something like this. Or is there any other way how to reference some kind of ā€œdatabaseā€ of prefabs without loading all of them to memory? Or how to deal with this situation?

Any ETA on this this needs to be fixed asap without developers having to add work around, this issue is long known and should be fixed by now. For a true 64bit engine there should be no 32bit limitations plain and simple. A Unity dev should respond to this please. We are experiencing this issue with 2017.1.0

That sounds like using asset bundles would be much better. Reference an asset bundle instead of an asset.

I

Its not something that will be fixed like a bug. Its a feature that will improve the situation in the future but it wonā€™t be backported like a bug fix. I know itā€™s frustrating but we canā€™t just change a core element like that, it would break a lot of stuff. Iā€™ll ask the team for an update.

Update:
Fixing this issue is a priority for the build team. The current plan is to address the serialized files and upgrade them so they can be 64 bit. Although this is a lot more complex than it sounds as we need to go throughout the entire engine and update any areas where we expect 32 bit and then be able to handle upgrading of old projects and assets. We canā€™t provide a version when this will be ready at this stage but will try and provide an update later in the year after 2018.2 is released.

We also have some feature in 2018.2 which allow for better management of resources and loading assets so keep an eye out for them.

2 Likes

Iā€™m fine with not being backported like a bug fix, but the feature has to improve the situation now, I mean look how old this thread is since 2016! We are in the era of 4K , Iā€™m actually shocked that this limitation is something you guyā€™s have not fixed or commented in your docā€™s or even stated as a warning message in older versions by older I mean at least Unity 5 and Unity 2017. We lost couple of dayā€™s taking everything apart until we found this post here, thatā€™s unacceptable for a subscription based Engine. Please let us know when this feature will be implemented ( In my opinion thatā€™s not a future feature but something a 64bit engine should off had from the start)

1 Like