anchor.diff:  
   
   function TKMGame.PlayGameTick: Boolean;
  -const
  -  // Spread savepoints / autosaves / autosave at PT end (at 0 tick) among ticks to avoid async / main threads overload
  -  SAVEPT_TICK_SHIFT = 1;
  -begin
  -  Result := False;
  -
  -  {$IFDEF PERFLOG}
  -  gPerfLogs.TickBegin(fParams.Tick + 1);
  -  {$ENDIF}
  -  try
  -    // As soon as next command arrives we are no longer in a waiting state
  -    if fWaitingForNetwork then
  -      WaitingPlayersDisplay(False);
  -
  -    IncTick;
  -
  -    fGameInputProcess.TakePlannedCommands;
  -
  -    fLastUpdateState := TimeGet;
  -
  -    fLastReplayTickLocal := fParams.Tick;
  -
  -    if fParams.IsMultiPlayerOrSpec then
  -      gNetworking.LastProcessedTick := fParams.Tick;
  -
  -    //Tell the master server about our game on the specific tick (host only)
  -    if fParams.IsMultiPlayerOrSpec and gNetworking.IsHost
  -      and ((fParams.IsNormalMission and (fParams.Tick = ANNOUNCE_BUILD_MAP))
  -      or (fParams.IsTactic and (fParams.Tick = ANNOUNCE_BATTLE_MAP))) then
  -    gNetworking.ServerQuery.SendMapInfo(fParams.Name, fParams.MapFullCRC, gNetworking.NetPlayers.GetConnectedCount);
  -
  -    fScripting.UpdateState;
  -    gTerrain.UpdateState;
  -
  -    if gHands.CanHaveAI() then
  -      gAIFields.UpdateState(fParams.Tick);
  -
  -    gHands.UpdateState(fParams.Tick); //Quite slow
  -
  -    if gGame = nil then Exit; //Quit the update if game was stopped for some reason
  -
  -    gMySpectator.UpdateState(fParams.Tick);
  -    fPathfinding.UpdateState;
  -    gProjectiles.UpdateState; //If game has stopped it's NIL
  -
  -    fGameInputProcess.RunningTimer(fParams.Tick); //GIP_Multi issues all commands for this tick
  -
  -    //Returning to the lobby (through MP GIP) ends the game
  -    if gGame = nil then Exit;
  -
  -    //In aggressive mode store a command every tick so we can find exactly when a replay mismatch occurs
  -    if AGGRESSIVE_REPLAYS then
  -      fGameInputProcess.CmdTemp(gicTempDoNothing); //do call cmd before SaveGameCheckpoint
  -
  -    fSavePoints.LastTick := Max(fSavePoints.LastTick, fParams.Tick);
  -
  -    // Update our ware distributions from settings at the start of the game
  -    if (fParams.Tick = 1)
  -    and IsWareDistributionStoredBetweenGames then
  -      fGameInputProcess.CmdWareDistribution(gicWareDistributions, AnsiString(gGameSettings.WareDistribution.PackToStr));
  -
  +
  +  // Make savepoint and autosaves
  +  procedure ManageSaves;
  +  const
  +    // Spread savepoints / autosaves / autosave at PT end (at 0 tick) among ticks to avoid async / main threads overload
  +    SAVEPT_TICK_SHIFT = 1;
  +  begin
       //Save game to memory (to be able to load it later)
       //Make savepoint only after everything is updated (UpdateState)
       if gGameSettings.SaveCheckpoints
         and (fSavePoints.Count <= gGameSettings.SaveCheckpointsLimit) //Do not allow to spam saves, could cause OUT_OF_MEMORY error
  -      and ((fParams.Tick = MAKE_SAVEPT_BEFORE_TICK - 1)
  +      and ((fParams.Tick = MAKE_SAVEPT_BEFORE_TICK - 1) or (fParams.Tick = 0)
           or ((fParams.Tick + SAVEPT_TICK_SHIFT) = (fOptions.Peacetime*60*10)) //At PT end. Make savepoint a bit earlier, to avoid save lag
           or (((fParams.Tick + SAVEPT_TICK_SHIFT) mod gGameSettings.SaveCheckpointsFreq) = 0)) then // Make savepoint a bit earlier, to avoid save lag
         MakeSavePoint;
  
positive.code: 
  
  function TKMGame.PlayReplayTick: Boolean;
  begin
    Result := False;
  
    IncTick;
    fLastUpdateState := TimeGet;
    {$IFDEF PERFLOG}
    gPerfLogs.TickBegin(fParams.Tick);
    {$ENDIF}
  
    try
      fScripting.UpdateState;
      gTerrain.UpdateState;
      gAIFields.UpdateState(fParams.Tick);
      gHands.UpdateState(fParams.Tick); //Quite slow
      if gGame = nil then Exit; //Quit the update if game was stopped for some reason
      gMySpectator.UpdateState(fParams.Tick);
      fPathfinding.UpdateState;
      gProjectiles.UpdateState; //If game has stopped it's NIL
  
      //Issue stored commands
      fGameInputProcess.ReplayTimer(fParams.Tick);
      //Used when need to run Runner replays sometimes (we could make replay at tick 1 and then need to 'simulate' gicTempDoNothing GIP cmd
  //    if AGGRESSIVE_REPLAYS and (fParams.Tick > 1) then
  //      KaMRandom(MaxInt, 'TKMGameInputProcess.StoreCommand');
  
      CheckIfPieceTimeJustEnded; //Send warning messages about peacetime if required (peacetime sound should still be played in replays)
  
      if gGame = nil then Exit; //Quit if the game was stopped by a replay mismatch
  
      //Only increase LastTick, since we could load replay earlier at earlier state
      fSavePoints.LastTick := Max(fSavePoints.LastTick, fParams.Tick);
  
  
negative.code:       IssueAutosaveCommand(True);
      end
      else
      if (fParams.Tick = 0) or ((fParams.Tick mod gGameSettings.AutosaveFrequency) = 0) then
        IssueAutosaveCommand(False);
    end;
  
  begin
    Result := False;
  
    {$IFDEF PERFLOG}
    gPerfLogs.TickBegin(fParams.Tick + 1);
    {$ENDIF}
    try
      // As soon as next command arrives we are no longer in a waiting state
      if fWaitingForNetwork then
        WaitingPlayersDisplay(False);
  
      // Make savepoints and saves BEFORE tick increment
      // Thus all of the previous gip commands, which were made from last tick increment,
      // will be added to the save.
      ManageSaves;
  
      IncTick;
  
      fGameInputProcess.TakePlannedCommands;
  
      fLastUpdateState := TimeGet;
  
      fLastReplayTickLocal := fParams.Tick;
  
      if fParams.IsMultiPlayerOrSpec then
        gNetworking.LastProcessedTick := fParams.Tick;
  
      //Tell the master server about our game on the specific tick (host only)
      if fParams.IsMultiPlayerOrSpec and gNetworking.IsHost
        and ((fParams.IsNormalMission and (fParams.Tick = ANNOUNCE_BUILD_MAP))
        or (fParams.IsTactic and (fParams.Tick = ANNOUNCE_BATTLE_MAP))) then
      gNetworking.ServerQuery.SendMapInfo(fParams.Name, fParams.MapFullCRC, gNetworking.NetPlayers.GetConnectedCount);
  
      fScripting.UpdateState;
      gTerrain.UpdateState;
  
      if gHands.CanHaveAI() then
        gAIFields.UpdateState(fParams.Tick);
  
      gHands.UpdateState(fParams.Tick); //Quite slow
  
      if gGame = nil then Exit; //Quit the update if game was stopped for some reason
  
      gMySpectator.UpdateState(fParams.Tick);
      fPathfinding.UpdateState;
      gProjectiles.UpdateState; //If game has stopped it's NIL
  
      fGameInputProcess.RunningTimer(fParams.Tick); //GIP_Multi issues all commands for this tick
  
      //Returning to the lobby (through MP GIP) ends the game
      if gGame = nil then Exit;
  
      //In aggressive mode store a command every tick so we can find exactly when a replay mismatch occurs
      if AGGRESSIVE_REPLAYS then
        fGameInputProcess.CmdTemp(gicTempDoNothing); //do call cmd before SaveGameCheckpoint
  
      fSavePoints.LastTick := Max(fSavePoints.LastTick, fParams.Tick);
  
      // Update our ware distributions from settings at the start of the game
      if (fParams.Tick = 1)
      and IsWareDistributionStoredBetweenGames then
        fGameInputProcess.CmdWareDistribution(gicWareDistributions, AnsiString(gGameSettings.WareDistribution.PackToStr));
  
      Result := True;
  
  