• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by OnlineCop · Feb 29, 2012 at 04:59 PM · serializationproject settings

Asset Serialization: Mixed vs Force Text

I had originally posted my question here but worry that it was immediately swallowed up by all the other questions asked in that forum.

If our team is currently waist-deep in our project, would there be any benefits of converting the entire project from Mixed asset serialization mode to Force Text in Unity Pro?

Text files would seem to be CONSIDERABLY smaller to transmit and store on remote repositories than their binary counterparts, but the time Unity took to convert and re-import all of the files and assets on my local machine alone seemed very prohibitive.

I would find that text files would benefit those of us who like to see what was modified in a scene/prefab/animation by our less-experienced Unity developers. There appears to be surprisingly LITTLE information available on the unity3d.com site regarding this topic, though, so would like to ask for help, feedback, tutorials, FAQs... Even the available tags don't seem to have any reference to Asset Serialization, other than "project settings". :-)

Comment
cregox
benhumphreys
fadden
cowlinator
davient
gomizako
Denis Kniazhev
Tatanan
exec-tails
Nition
mtmoustafa
Mardak
Double_D
LiloE
KwahuNashoba
And 6 more...

People who like this

21 Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cregox · Jul 19, 2013 at 08:06 PM 0
Share

That's very curious to me. I haven't even considered keeping assets as mixed / binary would result in less time for library rebuilds. Nor have I considered using anything but "force text", since we use an external versioning tool (git).

3 Replies

· Add your reply
  • Sort: 
avatar image

Answer by OnlineCop · Jul 22, 2013 at 12:53 AM

I guess I owe a follow-up to my original question, which I posted over a year ago. I prefer a kind of postmortem style (good and bad points).

The Good:

  • Converting to Forced Text was definitely worth it. The time it saved us in the long run paid off a hundredfold, even though it ended up taking 7 hours for each developer to reimport all the assets on their machines after the conversion.

  • Programmers and artists would occasionally move files around in Finder or SVN without their .meta file counterparts. The files that moved would get new .meta files generated for them (which had different GUIDs), which means that all the prefabs, scenes, and animations that relied upon them would break. Since the update, we could inspect the broken files, find the GUIDs they used to reference, and find that GUID in a previously-revisioned .meta file. That immediately fixed all the broken references.

  • Interns and new Developers would scroll around a scene without actually modifying anything in it. That simple act would cause the scene to show that it was modified. When they committed the modified scene files to SVN, it used to require an entire binary to be pushed up. Now the commits are in the low bytes or kilobytes for text differences, not megabytes.

  • Multiple developers and programmers could work on the same scene or prefab, and when an SVN conflict occurred, we could see who made the most significant changes. That let us know whether it was easier for someone who changed a few buttons around a screen to redo his/her work, or someone who added significant portions to redo theirs. And in several cases, the files merged without any conflicts at all when two people changed positions and scales of various items in different portions of those files.

The Bad:

  • Unity would run out of memory and crash multiple times during the conversion/reimport process

  • Prefabs would get "unhooked" from their components, animations, and links, which required us to re-reimport individual prefabs

  • 3rd-party tools like Toolkit2D, SmoothMoves, and RageTools seemed to have more problems on the reimport than Unity-native assets (they got "unhooked" much more frequently)

What we have learned to do for all our future projects going forward:

  • Create a template project. It should have Force Text enabled, your company's name, default sound settings, common Tags and Layers, cameras, 3rd party tools that you use across projects, etc. Once created, save this entire template into SVN somewhere for future use.

  • After the project has been converted from binary to text, and everyone else has to pull it down, make sure each developer deletes their Library/ and Temp/ folders. This significantly boosts reimport time, since it the entire project needs to be reimported anyway and it doesn't have to try to match the new vs. old cached files.

  • Reimport files S-L-O-W-L-Y, a few dozen at a time, from SVN. Basically, too many files makes Unity run out of memory and crash.

  • Restore assets before restoring the 3rd-party tools that creates/manages them. Toolkit2D would reimport images as they were brought back in, but Unity was trying to reimport the same image simultaneously for its own internal cache. This significantly increased reimport time (4x and higher). When we've deleted all the 3rd-party tools, reimported just the assets, and then imported the 3rd-party tools last, the entire project reimport takes much much less time.

Comment
cregox
benhumphreys
DannyB
Kieran Chandler
Sycobob
Jessy
_MGB_
cowlinator
fadden
davient
charliehelman
neonblitzer
gomizako
Denis Kniazhev
Tatanan
And 21 more...

People who like this

36 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cregox · Jul 22, 2013 at 04:57 PM 0
Share

Following up your good list (which had few points I didn't know), here are 50 more tips: http://devmag.org.za/2012/07/12/50-tips-for-working-with-unity-best-practices/

Also:

  • Move away from SVN to git, mercurial, bazaar or perforce - in other words, any 3rd level VCS. SVN is just 2nd level. For your own good.

  • I never had problems with Unity crashing or running out of memory due to rebuilding the library. And it's a big project here, 4gb of assets. Certainly your issue isn't with file quantity.

avatar image

Answer by cregox · Jul 19, 2013 at 08:47 PM

Having being using "force text" since it came out, in our big project here, I can safely say it isn't much better than having binary files.

The files do get bigger in the working dir, obviously. GIT gets smaller and faster. It's dealing with text, so commits only get true diffs and text is much better compacted.

Reimporting / library rebuilding isn't really an issue with using "force text". It's an issue with Unity and how it works in general. I get library reimports all the time when dealing with checkouts. In cases such as in yours, it's just a migration issue, and very punctual. Hardly a reason to not do it. You could even let it doing overnight and cost you no working time at all.

Unlike many may imagine, merge isn't a benefit. At least not currently. You still can't do scene merge. Not even by hand. I mean, unless you do know how all indexing works inside the crazy YAML format it generates and want to go nuts on it. I never did. But it might still be needed to make true merging work with plugins, such as UniMerge.

Sometimes you can see what was modified in history, if it's small enough. This is a plus. In theory, sometimes merge may even work - when it's small enough in both ends. Can't rely on it, though, and I don't even recall if ever happened for good.

I believe the biggest advantage is being able to at least have something in the diff. When it's small enough, it's very clear what have been done. In other case, at least you know a lot have been done there.

I just found an annoying bug with using "force text", but it's a minor bug. It should be fixed soon and all it does is not being able to convert a big binary file to text - so the file stays as binary and we get error messages about it on the console.

The big point here is: versioning binary files provides not a single reasonable advantage.

Comment
metaleap
roberto_sc
Jessy
_MGB_
fadden
TheWarper

People who like this

2 Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image roberto_sc · May 13, 2014 at 12:49 AM 2
Share

Merge is a benefit, you'll get much less conflicts when merging! With binary, you'll have a conflicted file to resolve 100% of times, with text the version control system may resolve it automatically for you. And I have never had any problems with automatically merged files.

avatar image tylercook · Jan 18, 2016 at 07:33 PM 0
Share

As of now, there is a tool called YAMLMerge that ships with every version of Unity. In my experience it does a fantastic job of merging, unless it doesn't. It is still a work in progress and will be a constant battle against weird edge cases.

http://docs.unity3d.com/Manual/SmartMerge.html

avatar image

Answer by swquinn · Mar 11, 2012 at 01:00 PM

I would think that most of the benefits that would come are from the transparency in changes made on assets, that and you should be able to merge changes made by you with those made by others while working on the same objects simultaneously. I'd love to use the text format with a few of the others guys I'm working with right now--but we're just starting out and aren't shelling out for pro licenses yet. As it seems to be that you need to have a pro license in order to use the text mode serialization feature.

Not having experience with the text mode conversion, I would say that you and anyone else just now beginning to utilize it are going to be the pioneers in best practices. It really depends on how long is "long", an hour or two might suck but if it makes your life easier from that point out then I'd say its worth it.

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cregox · Jul 19, 2013 at 08:07 PM 0
Share

Nope, no benefits in merging at all. The YAML is hardly worth anything even for simple scene changes.

Your answer

Hint: You can notify a user about this post by typing @username

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

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Save/load playerprefs 2 Answers

Saving/Load using menu C# 1 Answer

How can I save and load an entire hashtable using playerprefs, or on all systems.? 1 Answer

Unity Serializer Scene Only? 1 Answer

Properly serialize array of derived classes. 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges