~ubuntu-branches/debian/squeeze/freeciv/squeeze

« back to all changes in this revision

Viewing changes to ai/aidata.c

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach
  • Date: 2008-07-08 18:34:23 UTC
  • mfrom: (5.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080708183423-c80u1h25xmj6h9s0
Tags: 2.1.5-2
Export datarootdir=/usr/share in debian/rules, so make calls can
have a correct value for LOCALEDIR (closes: #489455). Thanks Loïc Minier
for the help to solve this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "log.h"
24
24
#include "map.h"
25
25
#include "mem.h"
 
26
#include "movement.h"
26
27
#include "unit.h"
 
28
#include "unitlist.h"
27
29
 
28
30
#include "citytools.h"
29
31
#include "diplhand.h"
31
33
#include "settlers.h"
32
34
#include "unittools.h"
33
35
 
 
36
#include "path_finding.h"
 
37
#include "pf_tools.h"
 
38
 
34
39
#include "advdiplomacy.h"
35
40
#include "advmilitary.h"
36
41
#include "aicity.h"
59
64
  memset(count, 0, sizeof(count));
60
65
 
61
66
  impr_type_iterate(id) {
 
67
    struct req_source source = {
 
68
      .type = REQ_BUILDING,
 
69
      .value = {.building = id}
 
70
    };
 
71
 
62
72
    ai->impr_calc[id] = AI_IMPR_ESTIMATE;
63
73
 
64
74
    /* Find largest extension */
65
 
    effect_type_vector_iterate(get_building_effect_types(id), ptype) {
66
 
      switch (*ptype) {
 
75
    effect_list_iterate(get_req_source_effects(&source), peffect) {
 
76
      switch (peffect->type) {
67
77
#if 0
68
78
      /* TODO */
69
79
      case EFT_FORCE_CONTENT:
74
84
      case EFT_MAKE_CONTENT_PCT:
75
85
      case EFT_MAKE_HAPPY:
76
86
#endif
77
 
      case EFT_LUXURY_BONUS:
78
 
      case EFT_SCIENCE_BONUS:
79
 
      case EFT_TAX_BONUS:
80
87
      case EFT_CAPITAL_CITY:
81
 
      case EFT_CORRUPT_PCT:
82
 
      case EFT_FOOD_ADD_TILE:
83
 
      case EFT_FOOD_INC_TILE:
84
 
      case EFT_FOOD_PER_TILE:
85
88
      case EFT_POLLU_POP_PCT:
86
89
      case EFT_POLLU_PROD_PCT:
87
 
      case EFT_PROD_ADD_TILE:
88
 
      case EFT_PROD_BONUS:
89
 
      case EFT_PROD_INC_TILE:
90
 
      case EFT_PROD_PER_TILE:
91
 
      case EFT_TRADE_ADD_TILE:
92
 
      case EFT_TRADE_INC_TILE:
93
 
      case EFT_TRADE_PER_TILE:
 
90
      case EFT_OUTPUT_BONUS:
 
91
      case EFT_OUTPUT_BONUS_2:
 
92
      case EFT_OUTPUT_WASTE_PCT:
94
93
      case EFT_UPKEEP_FREE:
95
 
      effect_list_iterate(*get_building_effects(id, *ptype), peff) {
96
 
        ai->impr_calc[id] = AI_IMPR_CALCULATE;
97
 
        if (peff->range > ai->impr_range[id]) {
98
 
          ai->impr_range[id] = peff->range;
99
 
        }
100
 
      } effect_list_iterate_end;
 
94
        requirement_list_iterate(peffect->reqs, preq) {
 
95
          if (preq->source.type == REQ_BUILDING
 
96
              && preq->source.value.building == id) {
 
97
            if (ai->impr_calc[id] != AI_IMPR_CALCULATE_FULL) {
 
98
              ai->impr_calc[id] = AI_IMPR_CALCULATE;
 
99
            }
 
100
            if (preq->range > ai->impr_range[id]) {
 
101
              ai->impr_range[id] = preq->range;
 
102
            }
 
103
          }
 
104
        } requirement_list_iterate_end;
 
105
        break;
 
106
      case EFT_OUTPUT_ADD_TILE:
 
107
      case EFT_OUTPUT_PER_TILE:
 
108
      case EFT_OUTPUT_INC_TILE:
 
109
        requirement_list_iterate(peffect->reqs, preq) {
 
110
          if (preq->source.type == REQ_BUILDING
 
111
              && preq->source.value.building == id) {
 
112
            ai->impr_calc[id] = AI_IMPR_CALCULATE_FULL;
 
113
            if (preq->range > ai->impr_range[id]) {
 
114
              ai->impr_range[id] = preq->range;
 
115
            }
 
116
          }
 
117
        } requirement_list_iterate_end;
101
118
      break;
102
119
      default:
103
120
      /* Nothing! */
104
121
      break;
105
122
      }
106
 
    } effect_type_vector_iterate_end;
107
 
    
 
123
    } effect_list_iterate_end;
108
124
  } impr_type_iterate_end;
109
125
}
110
126
 
111
127
/**************************************************************************
 
128
  Check if the player still takes advantage of EFT_TECH_PARASITE.
 
129
  Research is useless if there are still techs which may be given to the
 
130
  player for free.
 
131
**************************************************************************/
 
132
static bool player_has_really_useful_tech_parasite(struct player* pplayer)
 
133
{
 
134
  int players_needed = get_player_bonus(pplayer, EFT_TECH_PARASITE);
 
135
 
 
136
  if (players_needed == 0) {
 
137
    return FALSE;
 
138
  }
 
139
  
 
140
  tech_type_iterate(tech) {
 
141
    int players_having;
 
142
 
 
143
    if (get_invention(pplayer, tech) == TECH_KNOWN
 
144
        || !tech_is_available(pplayer, tech)) {
 
145
      continue;
 
146
    }
 
147
 
 
148
    players_having = 0;
 
149
 
 
150
    players_iterate(aplayer) {
 
151
      if (aplayer == pplayer || !aplayer->is_alive) {
 
152
        continue;
 
153
      }
 
154
 
 
155
      if (get_invention(aplayer, tech) == TECH_KNOWN
 
156
          || get_player_research(aplayer)->researching == tech) {
 
157
        players_having++;
 
158
        if (players_having >= players_needed) {
 
159
          return TRUE;
 
160
        }
 
161
      }
 
162
    } players_iterate_end;
 
163
  } tech_type_iterate_end;
 
164
  return FALSE;
 
165
}
 
166
 
 
167
/**************************************************************************
112
168
  Analyze rulesets. Must be run after rulesets after loaded, unlike
113
169
  _init, which must be run before savegames are loaded, which is usually
114
170
  before rulesets.
115
171
**************************************************************************/
116
172
void ai_data_analyze_rulesets(struct player *pplayer)
117
173
{
118
 
  struct ai_data *ai = &aidata[pplayer->player_no];
 
174
  struct ai_data *ai = &aidata[player_index(pplayer)];
119
175
 
120
176
  ai_data_city_impr_calc(pplayer, ai);
121
177
}
143
199
      break;
144
200
    }
145
201
 
146
 
    if (unit_flag(punit, F_TRIREME)) {
 
202
    if (unit_has_type_flag(punit, F_TRIREME)) {
147
203
      ai->stats.units.triremes++;
148
204
    }
149
 
    if (unit_flag(punit, F_MISSILE)) {
 
205
    if (unit_has_type_flag(punit, F_MISSILE)) {
150
206
      ai->stats.units.missiles++;
151
207
    }
152
 
    if (can_upgrade_unittype(pplayer, punit->type) >= 0) {
 
208
    if (unit_has_type_flag(punit, F_PARATROOPERS)) {
 
209
      ai->stats.units.paratroopers++;
 
210
    }
 
211
    if (can_upgrade_unittype(pplayer, unit_type(punit)) >= 0) {
153
212
      ai->stats.units.upgradeable++;
154
213
    }
155
214
  } unit_list_iterate_end;
166
225
  defending units, and ignore enemy units that are incapable of harming 
167
226
  us, instead of just checking attack strength > 1.
168
227
**************************************************************************/
169
 
void ai_data_turn_init(struct player *pplayer) 
 
228
void ai_data_phase_init(struct player *pplayer, bool is_new_phase)
170
229
{
171
 
  struct ai_data *ai = &aidata[pplayer->player_no];
172
 
  int i, nuke_units = num_role_units(F_NUCLEAR);
 
230
  struct ai_data *ai = &aidata[player_index(pplayer)];
 
231
  int i;
 
232
  int nuke_units = num_role_units(F_NUCLEAR);
173
233
  bool danger_of_nukes = FALSE;
174
 
  int ally_strength = -1;
175
 
  struct player *ally_strongest = NULL;
176
234
 
177
235
  /*** Threats ***/
178
236
 
 
237
  TIMING_LOG(AIT_AIDATA, TIMER_START);
 
238
 
179
239
  ai->num_continents    = map.num_continents;
180
240
  ai->num_oceans        = map.num_oceans;
181
241
  ai->threats.continent = fc_calloc(ai->num_continents + 1, sizeof(bool));
195
255
     * enough to warrant city walls. Concentrate instead on 
196
256
     * coastal fortresses and hunting down enemy transports. */
197
257
    city_list_iterate(aplayer->cities, acity) {
198
 
      Continent_id continent = map_get_continent(acity->tile);
 
258
      Continent_id continent = tile_get_continent(acity->tile);
199
259
      ai->threats.continent[continent] = TRUE;
200
260
    } city_list_iterate_end;
201
261
 
202
262
    unit_list_iterate(aplayer->units, punit) {
203
 
      if (unit_flag(punit, F_IGWALL)) {
 
263
      if (unit_has_type_flag(punit, F_IGWALL)) {
204
264
        ai->threats.igwall = TRUE;
205
265
      }
206
266
 
214
274
        /* The idea is that while our enemies don't have any offensive
215
275
         * seaborne units, we don't have to worry. Go on the offensive! */
216
276
        if (unit_type(punit)->attack_strength > 1) {
217
 
          if (is_ocean(map_get_terrain(punit->tile))) {
218
 
            Continent_id continent = map_get_continent(punit->tile);
 
277
          if (is_ocean(tile_get_terrain(punit->tile))) {
 
278
            Continent_id continent = tile_get_continent(punit->tile);
219
279
            ai->threats.ocean[-continent] = TRUE;
220
280
          } else {
221
281
            adjc_iterate(punit->tile, tile2) {
222
 
              if (is_ocean(map_get_terrain(tile2))) {
223
 
                Continent_id continent = map_get_continent(tile2);
 
282
              if (is_ocean(tile_get_terrain(tile2))) {
 
283
                Continent_id continent = tile_get_continent(tile2);
224
284
                ai->threats.ocean[-continent] = TRUE;
225
285
              }
226
286
            } adjc_iterate_end;
237
297
      }
238
298
 
239
299
      /* If our enemy builds missiles, worry about missile defence. */
240
 
      if (unit_flag(punit, F_MISSILE)
 
300
      if (unit_has_type_flag(punit, F_MISSILE)
241
301
          && unit_type(punit)->attack_strength > 1) {
242
302
        ai->threats.missile = TRUE;
243
303
      }
244
304
 
245
305
      /* If he builds nukes, worry a lot. */
246
 
      if (unit_flag(punit, F_NUCLEAR)) {
 
306
      if (unit_has_type_flag(punit, F_NUCLEAR)) {
247
307
        danger_of_nukes = TRUE;
248
308
      }
249
309
    } unit_list_iterate_end;
250
310
 
251
311
    /* Check for nuke capability */
252
312
    for (i = 0; i < nuke_units; i++) {
253
 
      Unit_Type_id nuke = get_role_unit(F_NUCLEAR, i);
 
313
      struct unit_type *nuke = get_role_unit(F_NUCLEAR, i);
 
314
 
254
315
      if (can_player_build_unit_direct(aplayer, nuke)) { 
255
316
        ai->threats.nuclear = 1;
256
317
      }
267
328
  ai->explore.continent = fc_calloc(ai->num_continents + 1, sizeof(bool));
268
329
  ai->explore.ocean = fc_calloc(ai->num_oceans + 1, sizeof(bool));
269
330
  whole_map_iterate(ptile) {
270
 
    Continent_id continent = map_get_continent(ptile);
 
331
    Continent_id continent = tile_get_continent(ptile);
271
332
 
272
333
    if (is_ocean(ptile->terrain)) {
273
334
      if (ai->explore.sea_done && ai_handicap(pplayer, H_TARGETS) 
283
344
      /* we don't need more explaining, we got the point */
284
345
      continue;
285
346
    }
286
 
    if (map_has_special(ptile, S_HUT) 
 
347
    if (tile_has_special(ptile, S_HUT) 
287
348
        && (!ai_handicap(pplayer, H_HUTS)
288
349
             || map_is_known(ptile, pplayer))) {
289
350
      ai->explore.land_done = FALSE;
303
364
  ai->stats.cities = fc_calloc(ai->num_continents + 1, sizeof(int));
304
365
  ai->stats.average_production = 0;
305
366
  city_list_iterate(pplayer->cities, pcity) {
306
 
    ai->stats.cities[(int)map_get_continent(pcity->tile)]++;
307
 
    ai->stats.average_production += pcity->shield_surplus;
 
367
    ai->stats.cities[(int)tile_get_continent(pcity->tile)]++;
 
368
    ai->stats.average_production += pcity->surplus[O_SHIELD];
308
369
  } city_list_iterate_end;
309
 
  ai->stats.average_production /= MAX(1, city_list_size(&pplayer->cities));
 
370
  ai->stats.average_production /= MAX(1, city_list_size(pplayer->cities));
310
371
  BV_CLR_ALL(ai->stats.diplomat_reservations);
311
372
  unit_list_iterate(pplayer->units, punit) {
312
373
    struct tile *ptile = punit->tile;
313
374
 
314
 
    if (!is_ocean(ptile->terrain) && unit_flag(punit, F_SETTLERS)) {
315
 
      ai->stats.workers[(int)map_get_continent(punit->tile)]++;
 
375
    if (!is_ocean(ptile->terrain) && unit_has_type_flag(punit, F_SETTLERS)) {
 
376
      ai->stats.workers[(int)tile_get_continent(punit->tile)]++;
316
377
    }
317
 
    if (unit_flag(punit, F_DIPLOMAT) && punit->ai.ai_role == AIUNIT_ATTACK) {
 
378
    if (unit_has_type_flag(punit, F_DIPLOMAT) && punit->ai.ai_role == AIUNIT_ATTACK) {
318
379
      /* Heading somewhere on a mission, reserve target. */
319
 
      struct city *pcity = map_get_city(punit->goto_tile);
 
380
      struct city *pcity = tile_get_city(punit->goto_tile);
320
381
 
321
382
      if (pcity) {
322
383
        BV_SET(ai->stats.diplomat_reservations, pcity->id);
327
388
 
328
389
  /*** Diplomacy ***/
329
390
 
330
 
  if (pplayer->ai.control && !is_barbarian(pplayer)) {
331
 
    ai_diplomacy_calculate(pplayer, ai);
 
391
  if (pplayer->ai.control && !is_barbarian(pplayer) && is_new_phase) {
 
392
    ai_diplomacy_begin_new_phase(pplayer, ai);
332
393
  }
333
394
 
334
 
  /* Question: What can we accept as the reputation of a player before
335
 
   * we start taking action to prevent us from being suckered?
336
 
   * Answer: Very little. */
337
 
  ai->diplomacy.acceptable_reputation =
338
 
           GAME_DEFAULT_REPUTATION -
339
 
           GAME_DEFAULT_REPUTATION / 4;
340
 
  ai->diplomacy.acceptable_reputation_for_ceasefire =
341
 
           GAME_DEFAULT_REPUTATION / 3;
342
 
 
343
395
  /* Set per-player variables. We must set all players, since players 
344
396
   * can be created during a turn, and we don't want those to have 
345
397
   * invalid values. */
346
398
  for (i = 0; i < MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS; i++) {
347
 
    struct player *aplayer = get_player(i);
 
399
    struct player *aplayer = player_by_number(i);
348
400
 
349
401
    ai->diplomacy.player_intel[i].is_allied_with_enemy = NULL;
350
402
    ai->diplomacy.player_intel[i].at_war_with_ally = NULL;
351
403
    ai->diplomacy.player_intel[i].is_allied_with_ally = NULL;
352
404
 
353
 
    /* Determine who is the leader of our alliance. That is,
354
 
     * whoever has the more cities. */
355
 
    if (pplayers_allied(pplayer, aplayer)
356
 
        && city_list_size(&aplayer->cities) > ally_strength) {
357
 
      ally_strength = city_list_size(&aplayer->cities);
358
 
      ally_strongest = aplayer;
359
 
    }
360
 
 
361
405
    players_iterate(check_pl) {
362
406
      if (check_pl == pplayer
363
407
          || check_pl == aplayer
378
422
      }
379
423
    } players_iterate_end;
380
424
  }
381
 
  if (ally_strongest != ai->diplomacy.alliance_leader) {
382
 
    ai->diplomacy.alliance_leader = ally_strongest;
383
 
  }
384
425
  ai->diplomacy.spacerace_leader = player_leading_spacerace();
385
426
  
386
427
  ai->diplomacy.production_leader = NULL;
413
454
  ai->angry_priority = TRADE_WEIGHTING * 3; /* grave danger */
414
455
  ai->pollution_priority = POLLUTION_WEIGHTING;
415
456
 
416
 
  ai_best_government(pplayer);
417
 
 
418
457
  /*** Interception engine ***/
419
458
 
420
459
  /* We are tracking a unit if punit->ai.cur_pos is not NULL. If we
437
476
      *punit->ai.cur_pos = punit->tile;
438
477
    } unit_list_iterate_end;
439
478
  } players_iterate_end;
 
479
  
 
480
  /* Research want */
 
481
  if (is_future_tech(get_player_research(pplayer)->researching)
 
482
      || player_has_really_useful_tech_parasite(pplayer)) {
 
483
    ai->wants_no_science = TRUE;
 
484
  } else {
 
485
    ai->wants_no_science = FALSE;
 
486
  }
 
487
  
 
488
  /* max num cities
 
489
   * The idea behind this code is that novice players don't understand that
 
490
   * expansion is critical and find it very annoying.
 
491
   * With the following code AI players will try to be only a bit better 
 
492
   * than the best human players. This should lead to more exciting games
 
493
   * for the beginners.
 
494
   */
 
495
  if (ai_handicap(pplayer, H_EXPANSION)) {
 
496
    bool found_human = FALSE;
 
497
    ai->max_num_cities = 3;
 
498
    players_iterate(aplayer) {
 
499
      if (aplayer == pplayer || aplayer->ai.control || !aplayer->is_alive) {
 
500
        continue;
 
501
      }
 
502
      ai->max_num_cities = MAX(ai->max_num_cities,
 
503
                               city_list_size(aplayer->cities) + 3);
 
504
      found_human = TRUE;
 
505
    } players_iterate_end;
 
506
    if (!found_human) {
 
507
      ai->max_num_cities = MAP_INDEX_SIZE;
 
508
    }
 
509
  } else {
 
510
    ai->max_num_cities = MAP_INDEX_SIZE;
 
511
  }
440
512
 
441
513
  count_my_units(pplayer);
 
514
 
 
515
  TIMING_LOG(AIT_AIDATA, TIMER_STOP);
 
516
 
 
517
  /* Government */
 
518
  TIMING_LOG(AIT_GOVERNMENT, TIMER_START);
 
519
  ai_best_government(pplayer);
 
520
  TIMING_LOG(AIT_GOVERNMENT, TIMER_STOP);
442
521
}
443
522
 
444
523
/**************************************************************************
445
524
  Clean up our mess.
446
525
**************************************************************************/
447
 
void ai_data_turn_done(struct player *pplayer)
 
526
void ai_data_phase_done(struct player *pplayer)
448
527
{
449
 
  struct ai_data *ai = &aidata[pplayer->player_no];
450
 
 
451
 
  free(ai->explore.ocean);     ai->explore.ocean = NULL;
452
 
  free(ai->explore.continent); ai->explore.continent = NULL;
453
 
  free(ai->threats.continent); ai->threats.continent = NULL;
 
528
  struct ai_data *ai = &aidata[player_index(pplayer)];
 
529
 
 
530
  free(ai->explore.ocean);
 
531
  ai->explore.ocean = NULL;
 
532
 
 
533
  free(ai->explore.continent);
 
534
  ai->explore.continent = NULL;
 
535
 
 
536
  free(ai->threats.continent);
 
537
  ai->threats.continent = NULL;
 
538
 
454
539
  free(ai->threats.ocean);
455
540
  ai->threats.ocean = NULL;
456
 
  free(ai->stats.workers);     ai->stats.workers = NULL;
457
 
  free(ai->stats.cities);      ai->stats.cities = NULL;
 
541
 
 
542
  free(ai->stats.workers);
 
543
  ai->stats.workers = NULL;
 
544
 
 
545
  free(ai->stats.cities);
 
546
  ai->stats.cities = NULL;
 
547
 
 
548
  ai->num_continents    = 0;
 
549
  ai->num_oceans        = 0;
458
550
}
459
551
 
460
552
/**************************************************************************
462
554
**************************************************************************/
463
555
struct ai_data *ai_data_get(struct player *pplayer)
464
556
{
465
 
  struct ai_data *ai = &aidata[pplayer->player_no];
 
557
  struct ai_data *ai = &aidata[player_index(pplayer)];
466
558
 
467
559
  if (ai->num_continents != map.num_continents
468
560
      || ai->num_oceans != map.num_oceans) {
469
561
    /* we discovered more continents, recalculate! */
470
 
    ai_data_turn_done(pplayer);
471
 
    ai_data_turn_init(pplayer);
 
562
    ai_data_phase_done(pplayer);
 
563
    ai_data_phase_init(pplayer, FALSE);
472
564
  }
473
565
  return ai;
474
566
}
475
567
 
476
568
/**************************************************************************
 
569
  Like ai_data_get, but no side effects.
 
570
**************************************************************************/
 
571
const struct ai_dip_intel *ai_diplomacy_get(const struct player *pplayer,
 
572
                                            const struct player *aplayer)
 
573
{
 
574
  const struct ai_data *ai = &aidata[player_index(pplayer)];
 
575
 
 
576
  return &ai->diplomacy.player_intel[player_index(aplayer)];
 
577
}
 
578
 
 
579
/**************************************************************************
477
580
  Initialize with sane values.
478
581
**************************************************************************/
479
582
void ai_data_init(struct player *pplayer)
480
583
{
481
 
  struct ai_data *ai = &aidata[pplayer->player_no];
 
584
  struct ai_data *ai = &aidata[player_index(pplayer)];
482
585
  int i;
483
586
 
484
587
  ai->govt_reeval = 0;
485
588
  ai->government_want = fc_realloc(ai->government_want,
486
 
                                   ((game.government_count + 1)
 
589
                                   ((game.control.government_count + 1)
487
590
                                    * sizeof(*ai->government_want)));
488
591
  memset(ai->government_want, 0,
489
 
         (game.government_count + 1) * sizeof(*ai->government_want));
 
592
         (game.control.government_count + 1) * sizeof(*ai->government_want));
490
593
 
491
 
  ai->diplomacy.target = NULL;
 
594
  ai->wonder_city = 0;
492
595
  ai->diplomacy.strategy = WIN_OPEN;
493
596
  ai->diplomacy.timer = 0;
494
 
  ai->diplomacy.countdown = 0;
495
597
  ai->diplomacy.love_coeff = 4; /* 4% */
496
 
  ai->diplomacy.love_incr = MAX_AI_LOVE * 4 / 100;
497
 
  ai->diplomacy.req_love_for_peace = MAX_AI_LOVE * 8 / 100;
498
 
  ai->diplomacy.req_love_for_alliance = MAX_AI_LOVE * 16 / 100;
499
 
  ai->diplomacy.req_love_for_ceasefire = 0;
500
 
  ai->diplomacy.alliance_leader = pplayer;
 
598
  ai->diplomacy.love_incr = MAX_AI_LOVE * 3 / 100;
 
599
  ai->diplomacy.req_love_for_peace = MAX_AI_LOVE / 8;
 
600
  ai->diplomacy.req_love_for_alliance = MAX_AI_LOVE / 4;
501
601
 
502
602
  for (i = 0; i < MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS; i++) {
503
603
    ai->diplomacy.player_intel[i].spam = i % 5; /* pseudorandom */
 
604
    ai->diplomacy.player_intel[i].countdown = -1;
 
605
    ai->diplomacy.player_intel[i].war_reason = WAR_REASON_NONE;
504
606
    ai->diplomacy.player_intel[i].distance = 1;
505
607
    ai->diplomacy.player_intel[i].ally_patience = 0;
506
608
    pplayer->ai.love[i] = 1;
509
611
    ai->diplomacy.player_intel[i].asked_about_ceasefire = 0;
510
612
    ai->diplomacy.player_intel[i].warned_about_space = 0;
511
613
  }
 
614
  ai->wants_no_science = FALSE;
 
615
  ai->max_num_cities = 10000;
512
616
}