summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-06-28 12:47:04 +0200
committerPatric Stout <github@truebrain.nl>2021-07-02 22:21:58 +0200
commit1d9912134df71a0adee5de92b83b9bb361f1f151 (patch)
treecb14dcfd0cff4d8de1b290c39ebaf1deab377e27
parent3e3049fd0e4414225d640a379b894ac72cb119c1 (diff)
downloadopenttd-1d9912134df71a0adee5de92b83b9bb361f1f151.tar.xz
Doc: guidelines for network-compatible patch-packs that want to add fields to existing chunks
-rw-r--r--docs/savegame_format.md11
1 files changed, 11 insertions, 0 deletions
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 `__<shortname>` 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.