Skip to content

Commit

Permalink
Document why SaveExpansion exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
gibbed authored Mar 29, 2019
1 parent d2320d8 commit 585d342
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/Gibbed.BorderlandsOz.FileFormats/SaveExpansion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@

namespace Gibbed.BorderlandsOz.FileFormats
{
/* All of this handling is a workaround/hack implemented by Gearbox
* programmers to get around a limitation of having used the lite runtime
* for protobufs.
*
* The protobuf lite runtime has a notable limitation that is relevant for
* save data: the lite runtime cannot persist unknown data.
*
* Due to this limitation, if you take a save from a newer version of the
* game and load it in an earlier version of a game, any new protobuf
* fields Gearbox has added in a newer version will be silently lost.
*
* That's bad! Gearbox wants you to be able to round trip saves between
* different versions of the game without losing data.
*
* The Gearbox programmers came up with a workaround: they know how the
* original release version of the game reacts to strange item data: it
* ignores it but keeps it around.
*
* So, their workaround was to store new data fields in specially crafted
* blobs of item data.
*/
public static class SaveExpansion
{
private static readonly byte[] _HackInventorySerialNumber =
Expand Down

0 comments on commit 585d342

Please sign in to comment.