From 1d9912134df71a0adee5de92b83b9bb361f1f151 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Mon, 28 Jun 2021 12:47:04 +0200 Subject: Doc: guidelines for network-compatible patch-packs that want to add fields to existing chunks --- docs/savegame_format.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/savegame_format.md b/docs/savegame_format.md index e4e2e4000..d0731cbba 100644 --- a/docs/savegame_format.md +++ b/docs/savegame_format.md @@ -173,3 +173,14 @@ To read this, see `CH_ARRAY` / `CH_SPARSE_ARRAY` for details. As each `type` has a well defined length, you can read the records even without knowing anything about the chunk-tag yourself. Do remember, that if the `type` had the `0x10` flag active, the field in the record first has a `gamma` to indicate how many times that `type` is repeated. + +#### Guidelines for network-compatible patch-packs + +For network-compatible patch-packs (client-side patches that can play together with unpatched clients) we advise to prefix the field-name with `__` when introducing new fields to an existing chunk. + +Example: you have an extra setting called `auto_destroy_rivers` you want to store in the savegame for your patched client called `mypp`. +We advise you to call this setting `__mypp_auto_destroy_rivers` in the settings chunk. + +Doing it this way ensures that a savegame created by these patch-packs can still safely be loaded by unpatched clients. +They will simply ignore the field and continue loading the savegame as usual. +The prefix is strongly advised to avoid conflicts with future-settings in an unpatched client or conflicts with other patch-packs. -- cgit v1.2.3-54-g00ecf