dicarlolab / ThreeDWorld

Generator of interactive Unity-based 3D environments with physics
Other
21 stars 4 forks source link

Use AssetBundles in procedural generation #37

Open yamins81 opened 8 years ago

yamins81 commented 8 years ago

Is there some way to create a URL-accessible library of prefabs somewhere that allows them to be loaded? Let's say we create 10,000 prefabs on someone's desktop. Is that the only place we can create binaries from for real production? Is there some way to create a binary that will load prefabs from a storage location? Eg. so that we can add to the library of prefabs without having to rebuild a HUGE binary and then transfer that huge binary? It's really annoying.

@jazzguitarist What do you think? Is this even possible?

chengxuz commented 7 years ago

@pbashivan in current case where we may need to replace the Loadfromcacheordownload methods, I agree...

yamins81 commented 7 years ago

Agreed.

pbashivan commented 7 years ago

I noticed that the object names returned in the SceneInfo also follows the same pattern for reporting the object names. I think it would be best to use a uniform way of referring to objects (preferably without the "http:..." part.

yamins81 commented 7 years ago

Agreed

pbashivan commented 7 years ago

While running TDW_image_generator on the 500 object build, the script hangs at some point and looking at the output_log.txt on the server I found this error occurring. It seems like this happens after I do the scene_switch. The complete log can be found on Richard's machine at: /home/richard/Documents/ThreeDWorld_Server/ThreeDWorld/ServerTools/output_log_error.txt

Error: Using memoryadresses from more that 16GB of memory

STACK: at System.Environment.get_StackTrace() at SimulationManager.HandleLog(System.String logString, System.String stackTrace, LogType type) at UnityEngine.Application.CallLogCallback(System.String logString, System.String stackTrace, LogType type, Boolean invokedOnMainThread) at UnityEngine.AssetBundle.LoadAsset_Internal(System.String , System.Type ) at UnityEngine.AssetBundle.LoadAsset(System.String name, System.Type type) at UnityEngine.AssetBundle.LoadAsset(System.String name) at PrefabDatabase.LoadAssetFromBundleWWW(System.String fileName) at ProceduralGeneration.AddObjects(System.Collections.Generic.List1 prefabList) at ProceduralGeneration.Init() at ProceduralGeneration.Start()

Does the unity script load all the objects again when switching scenes? Maybe we are not clearing the previously loaded assets before scene switch.

yamins81 commented 7 years ago

1) re-implementing cache of files because the LoadFromCacheOrDownload has a max 4gb limit which is too low -- in future versions of unity apparently this limit will be removed but for now we need to implement our cache to avoid this limit.

2) @chengxuz has a bunch of commits in the mongodb_inter branch that clean up some of the memory and loading/reloading of asset bundle issues

3) @pbashivan can you look into whether prefabs need to be unloaded as well as asset bundles and maybe that's causing a memory problem on scene_switch