anchor.diff:  end;
   
   
  +//
   procedure TKMCityPredictor.CityInitialization(aGoldMineCnt, aIronMineCnt, aFieldCnt, aBuildCnt: Integer);
   
     procedure AddCitizens(aUT: TUnitType; aCnt: Word; aOverride: Boolean = False);
  
positive.code:     if (gGame.GameTickCount < 22000) then
        RequiredHouses[ht_Wineyard] := 0;
  
      //if (gHands[fOwner].Stats.GetWareBalance(wt_Corn) = 0) then
      //begin
      //  RequiredHouses[ht_Mill] := 0;
      //  RequiredHouses[ht_Swine] := 0;
      //end;
      //RequiredHouses[ht_Butchers] := RequiredHouses[ht_Butchers] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Pig) > 0);
      //RequiredHouses[ht_Tannery] := RequiredHouses[ht_Tannery] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Leather) > 0);
      //RequiredHouses[ht_ArmorWorkshop] := RequiredHouses[ht_ArmorWorkshop] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Skin) > 0);
      //RequiredHouses[ht_Bakery] := RequiredHouses[ht_Bakery] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Flour) > 0);
      //
      //
      //RequiredHouses[ht_IronSmithy] := RequiredHouses[ht_IronSmithy] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_IronOre) > 0);
      //RequiredHouses[ht_WeaponSmithy] := RequiredHouses[ht_WeaponSmithy] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Steel) > 0);
      //RequiredHouses[ht_ArmorSmithy] := RequiredHouses[ht_ArmorSmithy] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Steel) > 0);
    end;
    //}
  end;
  
  
  
negative.code: end;
  
  
  // Basic house requirements
  procedure TKMCityPredictor.UpdateBasicHouses(aInitialization: Boolean = False);
  const
    INN_TIME_LIMIT = 9000; // ~ 15 minutes from start
    SCHOOL_PRODUCTION = 3; // Amount of gold which requires school (in 1 minute) - in ideal case it requires only 3.5 in real there is not sometimes gold so it must be lower
    FIRST_MARKETPLACE = 30000;
    SECOND_MARKETPLACE = 40000;
  begin
    // 1 Storehouse
    RequiredHouses[ht_Store] := 1 - fCityStats.Houses[ht_Store];
    // 1 Barracks (build only when we have or produce axe / armors)
    RequiredHouses[ht_Barracks] := Byte(aInitialization OR (gHands[fOwner].Stats.GetWareBalance(wt_Warfare) > 0)) - fCityStats.Houses[ht_Barracks];
    // Schools (at least 1 + WarriorsPerMinute criterium)
    RequiredHouses[ht_School] := Max( 0,  Max(1, Byte(  (fCityStats.Houses[ht_Barracks] > 0) OR aInitialization ) * (Round(fMaxSoldiersInMin / SCHOOL_PRODUCTION))) - fCityStats.Houses[ht_School]  );
    // Inn (at least 1 after INN_TIME_LIMIT + CitizensCnt criterium)
    RequiredHouses[ht_Inn] := Max(0, Ceil(  Byte( (gGame.GameTickCount > INN_TIME_LIMIT) OR aInitialization ) * fCityStats.CitizensCnt / 80  ) - fCityStats.Houses[ht_Inn]);
    // Marketplace - 1. after FIRST_MARKETPLACE; 2. after SECOND_MARKETPLACE
  