From 585d342f77f9783cfb9b2a93ac4b6e08072bd29b Mon Sep 17 00:00:00 2001 From: Rick Gibbed Date: Thu, 28 Mar 2019 21:43:01 -0500 Subject: [PATCH] Document why SaveExpansion exists. --- .../SaveExpansion.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/projects/Gibbed.BorderlandsOz.FileFormats/SaveExpansion.cs b/projects/Gibbed.BorderlandsOz.FileFormats/SaveExpansion.cs index a49fb6d..a6d4024 100644 --- a/projects/Gibbed.BorderlandsOz.FileFormats/SaveExpansion.cs +++ b/projects/Gibbed.BorderlandsOz.FileFormats/SaveExpansion.cs @@ -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 =