x


Is there a limit to how deep you can save something?

I have a tree structure of data that I am using to store data.

The Top level data is a Scriptable object that is saved into the project, and the tree data itself is stored as serializable classes that have an unknown number of children (ye old N-ary tree).

This saves completely in Unity when I create the object, and change scenes and play. The data is all stored and completely fine.

When I reopen the project after closing however, I find the data truncated to a depth of 8. Is this a known limit to Unity's serialization system?

root/1/2/3/4/5/6/7 is saved. All of 7's children are lost.

more ▼

asked Jul 10 '12 at 12:42 AM

Avaista gravatar image

Avaista
484 8 23 31

Yes, you are correct. I am also experiencing this issue and it seems to be undocumented and rarely discussed :(

My attempted solutions:

  1. Use BinaryFormatter to write my own serialized binary data file to disc, and load it back during the game. This proved horrendously slow and created a huge file.
  2. Forget serializing and speed up the tree creation by parallelizing it, but it still causes a 20 second delay on the iPad, vs the unnoticable delay using Unity's prefab serialization.

Anyone know what Unity is using to serialize and deserialize data? It's very fast at loading in comparison to anything I've tried.

Apr 09 at 12:43 AM OP_toss
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Sounds a bit weird. There are no limitations like that as far as I know it.

more ▼

answered Jul 10 '12 at 09:49 AM

Paulius Liekis gravatar image

Paulius Liekis
7.3k 16 24 46

Bit of an update. I could not get it to work. I turned the data into Scriptable Objects and saved them into the same asset file. I don't have time currently to sufficiently test, but I will come back to this at a later date and update with findings.

Jul 15 '12 at 03:45 AM Avaista
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x419
x181

asked: Jul 10 '12 at 12:42 AM

Seen: 252 times

Last Updated: Apr 09 at 12:43 AM