Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity 4.5 Max Serialization Depth Changed?

Discussion in 'Editor & General Support' started by ICEYHOTSTUNTA, Jun 12, 2014.

  1. ICEYHOTSTUNTA

    ICEYHOTSTUNTA

    Joined:
    Nov 6, 2012
    Posts:
    25
    The maximum depth for serialized data structures seems to have changed in Unity 4.5. Is this working as intended?

    This completely breaks our game and would take so much work to fix we probably won't be able to update to this version.

    Thanks.

    EDIT: Added some more info below, might as well put it up here so you don't have to read the whole thread

    Here is the basic tree structure I'm using:

    class Node
    {
    Node[] mChildren = {};
    Data[] mData = {};
    }

    Pre 4.5 I am able to have a tree that was 7 levels deep, at the 7th level nodes can't have children, but I CAN add data to them.

    Post 4.5 update I am still able to have a tree that is 7 levels deep, however these nodes CANNOT have any data as Unity blows it all away, making this level of the tree useless.
     
    Last edited: Jun 17, 2014
  2. KyleOlsen

    KyleOlsen

    Joined:
    Apr 3, 2012
    Posts:
    237
    As far as I know they didn't change anything, they're just informing us about potential performance cliffs due to cycling class references. Before it would just silently stop serializing after a specific depth (7?), while also being a potential hog in performance.
     
  3. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,613
    No, it hasn't changed; all they've done is add a warning.
     
    Graham-Dunnett likes this.
  4. ICEYHOTSTUNTA

    ICEYHOTSTUNTA

    Joined:
    Nov 6, 2012
    Posts:
    25
    It definitely has as I can clearly see that it is destroying my data. After I upgrade my project, I am getting all sorts of null refs because arrays that used to be populated have been destroyed. After I save my project I can clearly see all the data that's been wiped out if I diff my text based assets. Seem like this is a bug that was introduced when this warning was added?
     
  5. KyleOlsen

    KyleOlsen

    Joined:
    Apr 3, 2012
    Posts:
    237
    Unity would previously silently destroy any serialized data at a depth greater than 7. They are now simply informing us of cycling class references. I don't believe this is the issue you're experiencing.
     
  6. ICEYHOTSTUNTA

    ICEYHOTSTUNTA

    Joined:
    Nov 6, 2012
    Posts:
    25
    I see these warnings but they are for data that is was NOT previous destroying.

    Some how with the addition of this warning it is destroying data that it wasn't before.
     
  7. ICEYHOTSTUNTA

    ICEYHOTSTUNTA

    Joined:
    Nov 6, 2012
    Posts:
    25
    Here is the basic tree structure I'm using:

    class Node
    {
    Node[] mChildren = {};
    Data[] mData = {};
    }

    Pre 4.5 I am able to have a tree that was 7 levels deep, at the 7th level nodes can't have children, but I CAN add data to them.

    Post 4.5 update I am still able to have a tree that is 7 levels deep, however these nodes CANNOT have any data as Unity blows it all away, making this level of the tree useless.
     
  8. KyleOlsen

    KyleOlsen

    Joined:
    Apr 3, 2012
    Posts:
    237
    I would recommend creating a small project with minimal reproduction steps, then file a bug report by going up to Help -> Report a Bug.

    Sounds like something might have been broken :)
     
  9. Griautis

    Griautis

    AI & Physics STE Unity Technologies

    Joined:
    Jan 26, 2013
    Posts:
    63
    Hey,

    Yes, as KyleOlsen said, please send a bug report. After that please post the bug number here (or send it to me via PM).

    Best wishes,
    Ugnius
    Unity QA Team
     
  10. HSz

    HSz

    Joined:
    Nov 5, 2013
    Posts:
    9
    We are also facing this issue (more than 3.000 events when running the game).
    Thanks
     
  11. ICEYHOTSTUNTA

    ICEYHOTSTUNTA

    Joined:
    Nov 6, 2012
    Posts:
    25
  12. ICEYHOTSTUNTA

    ICEYHOTSTUNTA

    Joined:
    Nov 6, 2012
    Posts:
    25
    Here's screenshots of the issue from the sample project I supplied with my bug report.
     

    Attached Files:

  13. Griautis

    Griautis

    AI & Physics STE Unity Technologies

    Joined:
    Jan 26, 2013
    Posts:
    63
    I've forwarded the bug to the developers for fixing.

    Best wishes,
    Ugnius
    Unity QA Team