Quantcast
Channel: Questions in topic: "tree"
Viewing all articles
Browse latest Browse all 513

400 Scriptable objects per 1 datastructure = overkill. Halp plz

$
0
0
Hello everyone! ---------------------------------------- I have a [kd-tree][1] datastructure. The leaf nodes are used to store items. Items hold: a vector position and 4 references to other similar items. Kd-tree nodes are also referencing each other (parent-child relationship). ---------------------------------------- To keep those references, each node of my tree is a [scriptable object][2] and gets saved as an asset onto the disk. The items the leaf nodes hold are also scriptable objects and are also [saved as assets.][3] ---------------------------------------- However, just to store 50 items like that, I need to create ~200 tree nodes (200 scriptable objects). This comes down to about 400KB of size just for the tree. But I need to store information about 50 000 items, which would rocket up to Gigabytes of data. ---------------------------------------- So, creating a scriptable object to store information in 2 fields and keep a few references seems an overkill. 1 scriptable object =2-3kb of data. . ..Please save me, what are my alternatives? [1]: https://en.wikipedia.org/wiki/K-d_tree [2]: http://docs.unity3d.com/ScriptReference/ScriptableObject.html [3]: http://docs.unity3d.com/ScriptReference/AssetDatabase.CreateAsset.html

Viewing all articles
Browse latest Browse all 513

Trending Articles