<URL: http://bugs.freeciv.org/Ticket/Display.html?id=35145 >

Forwarding this from the forums: http://forum.freeciv.org/viewtopic.php?t=2703

____________________________________
Due to what I consider bugs in the ai(easy to exploit anyway), I've
made a few changes to my ai/advdiplomacy.c. Some are logical and
probably just forgotten when it was written.

The first makes the ai only consider non obselete wonders, since they
can't help it(except maybe increase a little tourism which freeciv
doesn't do). The second is a result of me sometimes getting 100,000 or
200,000 or more in gold, but not having the ai consider it so
sometimes I'll have a massive amount of gold, a small army, and the ai
wants to attack me for being weak, but by the time the ceasefire after
first meeting runs out, I can have a formidable army. The third's for
the benefit of having Eiffel Tower and not having met an ai yet,
because you can get 1000 love yet have never met.

Index: ai/advdiplomacy.c
===================================================================
--- ai/advdiplomacy.c (revision 12590)
+++ ai/advdiplomacy.c (working copy)
@@ -669,11 +669,20 @@

built_impr_iterate(pcity, id) {
want += impr_build_shield_cost(id);
- if (is_great_wonder(id)) {
- want += impr_build_shield_cost(id) * 2;
- } else if (is_small_wonder(id)) {
- want += impr_build_shield_cost(id);
- }
+
+ if (ai_handicap(pplayer, H_EXPERIMENTAL)) {
+ if (is_great_wonder(id) && !improvement_obsolete(target, id)) {
+ want += impr_build_shield_cost(id) * 2;
+ } else if (is_small_wonder(id) && !improvement_obsolete(target, id)) {
+ want += impr_build_shield_cost(id);
+ }
+ } else {
+ if (is_great_wonder(id)) {
+ want += impr_build_shield_cost(id) * 2;
+ } else if (is_small_wonder(id)) {
+ want += impr_build_shield_cost(id);
+ }
+ }
} built_impr_iterate_end;
} city_list_iterate_end;
unit_list_iterate(target->units, punit) {
@@ -712,6 +721,10 @@
distance = player_distance_to_player(pplayer, target);
ai->diplomacy.player_intel[target->player_no].distance = distance;

+ /* If they have too much more gold than us, we should be worried
+ * because they'll be able to build a quick force against us. */
+ fear += (target->economic.gold - pplayer->economic.gold) / 1000;
+
/* Tech lead is worrisome. FIXME: Only consider 'military' techs. */
fear += MAX(get_player_research(target)->techs_researched
- get_player_research(pplayer)->techs_researched, 0) * 100;
@@ -911,9 +924,11 @@
}

/* Increase the love if aplayer has got a building that makes
- * us love him more. Typically it's Eiffel Tower */
- pplayer->ai.love[aplayer->player_no] +=
- get_player_bonus(aplayer, EFT_GAIN_AI_LOVE) * MAX_AI_LOVE / 1000;
+ * us love him more. Typically it's Eiffel Tower. But only if the
+ * players have met so far. */
+ if (!NEVER_MET(pplayer, aplayer))
+ pplayer->ai.love[aplayer->player_no] +=
+ get_player_bonus(aplayer, EFT_GAIN_AI_LOVE) * MAX_AI_LOVE / 1000;
} players_iterate_end;

/* Can we win by space race? */
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to