Feature: opt-in survey when exiting a game

On first start-up, the game will ask if you want to participate
in our automated survey. You have to opt-in, and can easily opt-out
(via the Options) at any time.

When opt-in, whenever you exit a game, a JSON blob will be send
to the survey server hosted by OpenTTD. This JSON blob contains
information that gives a global picture of the game just played:
- What settings were used
- How many humans vs AIs
- How long the game has been played
- Basic information about the OS / CPU

All this information is kept very generic, so there is no
chance we send private information to our survey server.
Nothing in the JSON blob could identify you as a person; it
mostly tells about the game played. At any time you can see
what the JSON blob includes, by pressing the "Preview Survey
Results" button in-game.
This commit is contained in:
Patric Stout
2023-04-25 19:43:45 +02:00
committed by Patric Stout
parent 021c45c4f6
commit 7634553d22
54 changed files with 1018 additions and 53 deletions

View File

@@ -3224,6 +3224,10 @@ bool AfterLoadGame()
for (Station *st : Station::Iterate()) UpdateStationAcceptance(st, false);
}
if (IsSavegameVersionBefore(SLV_SAVEGAME_ID)) {
GenerateSavegameId();
}
if (IsSavegameVersionBefore(SLV_AI_START_DATE)) {
/* For older savegames, we don't now the actual interval; so set it to the newgame value. */
_settings_game.difficulty.competitors_interval = _settings_newgame.difficulty.competitors_interval;

View File

@@ -29,6 +29,7 @@
extern TileIndex _cur_tileloop_tile;
extern uint16 _disaster_delay;
extern byte _trees_tick_ctr;
extern std::string _savegame_id;
/* Keep track of current game position */
int _saved_scrollpos_x;
@@ -87,6 +88,7 @@ static const SaveLoad _date_desc[] = {
SLEG_VAR("company_tick_counter", _cur_company_tick_index, SLE_FILE_U8 | SLE_VAR_U32),
SLEG_VAR("trees_tick_counter", _trees_tick_ctr, SLE_UINT8),
SLEG_CONDVAR("pause_mode", _pause_mode, SLE_UINT8, SLV_4, SL_MAX_VERSION),
SLEG_CONDSSTR("id", _savegame_id, SLE_STR, SLV_SAVEGAME_ID, SL_MAX_VERSION),
/* For older savegames, we load the current value as the "period"; afterload will set the "fired" and "elapsed". */
SLEG_CONDVAR("next_competitor_start", _new_competitor_timeout.period, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_109),
SLEG_CONDVAR("next_competitor_start", _new_competitor_timeout.period, SLE_UINT32, SLV_109, SLV_AI_START_DATE),

View File

@@ -353,6 +353,7 @@ enum SaveLoadVersion : uint16 {
SLV_EXTEND_VEHICLE_RANDOM, ///< 310 PR#10701 Extend vehicle random bits.
SLV_EXTEND_ENTITY_MAPPING, ///< 311 PR#10672 Extend entity mapping range.
SLV_DISASTER_VEH_STATE, ///< 312 PR#10798 Explicit storage of disaster vehicle state.
SLV_SAVEGAME_ID, ///< 313 PR#10719 Add an unique ID to every savegame (used to deduplicate surveys).
SL_MAX_VERSION, ///< Highest possible saveload version
};