Search Instagram Twitter Facebook Spotify Grid Tag Date Folder Chat Pencil

Weird “invalid serialized file header” Bug Fixed

(Sort of. It’s at least better than what we did before)

The Bug

In the last post I talked about the weird Unity serialization bug that ruined all of Tuesday night, and which we were only able to avoid by sticking with an old revision of the material.

The solution wasn’t very practical though, because if you pulled any version of the material after revision, and then accidentally clicked back on Unity, it would stall and crash. This is quite easy to do, because if you checked out the project folder in Perforce, and then try to submit, Perforce will ask you to get latest version first.

If this stalled, I would have to delete the Library and Temp folders and have Unity build again. Due to the size of the project, this would take around 20 minutes.

This is clearly not at all practical.

In the previous post, I talked about the thread I found, which seemed to pinpoint the problem to the way Unity does serialization and some weird way that it’s handled by Perforce.

What we’ve been experiencing seems to confirm this, as even making the material exactly like what it was in revision 7 and then resubmitting still led to problems.


I started to wonder if maybe the problem was actually over on the Perforce server, and so when we pulled, it messed up the project.

So what I did was to delete the asset that was giving us the “invalid serialized file header”, in our case default_prototype.mat, as well as the associated meta file from the Perforce server. I also deleted them locally.

Then I opened up a new Unity project, and reimported ProBuilder (we’re using the source version by the way).

Then I copied default_prototype.mat from this new project into the original project.


Allowed Unity to generate the meta file, and then committed those to the server.

Had no idea this would work. Here are my commit messages:


Incredibly, this actually fixed the problem!


This problem had actually been bugging us for several weeks now. David had first noticed it and discovered reverting the material to older version fixed it. However, I had only been pulling the project in bits, so it wasn’t until Tuesday that it really affected me.

Anyway, really happy that this is resolved. It’s possible that another asset could have serialization messed up in the future, so I think we will take care of changing the setting on the P4 server.

If you’re experiencing the same problem, I hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.