Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

What are the advantages of the new text based scene/prefab format?

Discussion in 'Developer Preview Archive' started by spiralgear, Jan 31, 2012.

  1. spiralgear

    spiralgear

    Joined:
    Dec 13, 2007
    Posts:
    528
    From release notes:

     
  2. Yannic

    Yannic

    Joined:
    Jan 7, 2012
    Posts:
    27
    You can change the scene in Scripts or external Software.
     
  3. Farfarer

    Farfarer

    Joined:
    Aug 17, 2010
    Posts:
    2,249
    It's also easier for version control software to store it, since often it can just replace a few lines of ascii code and your new scene's backed up (whereas with the non-text-based version, it had to back up the entire new binary file - lots more data and bandwidth).
     
  4. spinaljack

    spinaljack

    Joined:
    Mar 18, 2010
    Posts:
    992
    Also merging the work from 2 people, no more one person having to redo all his work because someone else had the scene open at the same time.
     
  5. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    The merging is almost impossible in it's current form,
     
  6. Wahooney

    Wahooney

    Joined:
    Mar 8, 2010
    Posts:
    281
    I've also found that the ascii based scene is incredibly unstable. In some cases I close a scene, shut Unity down and start up again, certain objects would disconnect from their prefabs, settings would be lost and general chaos ensues. Personally, having it work properly is far rarer than there being issues.

    It would be nice if less effort was put into Flash and more effort is put in to fix the basics.
     
  7. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    "It would be nice if less effort was put into Flash and more effort is put in to fix the basics"

    Completely agree.
     
  8. Farfarer

    Farfarer

    Joined:
    Aug 17, 2010
    Posts:
    2,249
    Merging isn't particularly easy.

    But I've had no issues with the text-based assets and prefabs (and Git loves them) not sure what's happening with yours Wahooney.
     
  9. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Did you report a bug (with repro case) on this?
     
  10. Owen

    Owen

    Joined:
    Apr 20, 2011
    Posts:
    79
    The format looks pretty merge friendly, except with regard to object IDs. The examples in the docs show them to be sequential, which would create obvious problems if two people add a new object to the scene. Even if two people save a scene, without changing it, after making prefab changes you could get conflicts which cannot be resolved due to new objects being created.

    Any chance you could make it use a GUID generator so that collisions are at least extremely improbable?
     
  11. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    +1 - I just had my project get munched trying to open in debug mode, fortunately I'm pretty paranoid with Unity these days and have an hourly backup :).
     
  12. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Actually, this has been changed for the exact reasons you outline. While any scene converted from Unity 3.4 will indeed have sequential object IDs (as that is how they were generated in 3.4, in the binary files), new object IDs output by Unity 3.5 will be random 32-bit values - for the exact reason you stated: to make ID collisions between two conflicting changes unlikely.
     
  13. Owen

    Owen

    Joined:
    Apr 20, 2011
    Posts:
    79
    Excellent. I can think of other cases where merge conflicts would occur (two revisions with new objects appended to the end of the file would still be a conflict because SVN won't know what order to apply them in, even though it doesn't matter to Unity) but they can probably be resolved, maybe even with an automated tool.
     
  14. Teeleton

    Teeleton

    Joined:
    Jun 11, 2011
    Posts:
    10
    Which would be reduced if the file was always written in sorted order by object ID. Then the random 32 bit number would place it randomly between two existing objects in the list. This way it's not always appended every time, and the revision control can use a context diff properly.
     
  15. Demostenes

    Demostenes

    Joined:
    Sep 10, 2010
    Posts:
    1,106
    Usefulness is not merging (try to merge it and you will see how you destroy your scene), but in general working and assembling custom scenes on the fly, doing various exports, etc...