Complete.Org: Mailing Lists: Archives: freeciv-ai: November 2002:
[freeciv-ai] Re: [patch] trump coinage
Home

[freeciv-ai] Re: [patch] trump coinage

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: [patch] trump coinage
From: Jordi Negrevernis i Font <jorneg@xxxxxxxxxxx>
Date: Sat, 02 Nov 2002 16:34:00 +0100



En/na Per I. Mathisen ha escrit:

This patch (lifted from massive ai to be committed separatedly) changes
the value of coinage (sets it very low) and also changes several other
production WAGs.

In short, almost everything now trumps coinage as a build alternative.
This is good. Coinage sucks.

coinage = TRADE_WEIGHTING = 12
Walls = coinage +2 (when threat)
Costal = coinage +3 (when threat)
SAM = coinage +1 (when threat)
SDI is unchanged
apollo = coinage +1 (as before)

new build possibilities added:
united nations = coinage +4
lighthouse = coinage +4
magellan = coinage +4 as basic want

Wall, coastal, SAM and SDI are also boosted elsewhere in the code when
necessary. These are just in-peacetime-values.

Comments?

Maybe it's better that the ai builds trade routes instead of that wonders or those improvements?

Improvements costs money to upkeep... Wonders, not but ... but trade routes give money.


 - Per
------------------------------------------------------------------------

Index: ai/advdomestic.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdomestic.c,v
retrieving revision 1.91
diff -u -r1.91 advdomestic.c
--- ai/advdomestic.c    2002/11/01 19:44:20     1.91
+++ ai/advdomestic.c    2002/11/01 19:56:00
@@ -65,7 +65,7 @@
               || (ai->threats.invasions
                   && is_water_adjacent_to_tile(pcity->x, pcity->y));

-  return vulnerable ? 20 : 1; /* WAG */
+  return vulnerable ? TRADE_WEIGHTING + 2 : 1; /* trump coinage, and sam */
}

/**************************************************************************
@@ -80,7 +80,8 @@
    return 40;
  }

-  return ai->threats.sea ? 30 : 1; /* WAG */
+  /* trump coinage, and wall, and sam */
+  return ai->threats.sea ? TRADE_WEIGHTING + 3 : 1;
}

/**************************************************************************
@@ -103,8 +104,7 @@
|| is_water_adjacent_to_tile(pcity->x, pcity->y) || city_got_building(pcity, B_PALACE));

-  /* 50 is a magic number inherited from Syela */
-  return vulnerable ? 40 : 1;
+  return vulnerable ? TRADE_WEIGHTING + 1 : 1; /* trump coinage */
}

/**************************************************************************
@@ -155,8 +155,8 @@
                    || city_got_building(pcity, B_PALACE);

  /* Only build missile defence if opponent builds them, and we are in
-     a vulnerable spot. FIXME: 10 is a totally arbitrary Syelaism. - Per */
-  return (ai->threats.missile && vulnerable) ? 10 : 1;
+     a vulnerable spot. Trump coinage but not wall or coastal. */
+  return (ai->threats.missile && vulnerable) ? TRADE_WEIGHTING + 1 : 1;
}

/**************************************************************************
@@ -525,11 +525,7 @@
      values[id] = road_trade(pcity) * t;
      break;
    case B_CAPITAL:
-      /* rationale: If cost is N and benefit is N gold per MORT turns, want is
- * TRADE_WEIGHTING * 100 / MORT. This is comparable, thus the same weight - values[id] = TRADE_WEIGHTING * 999 / MORT; / * trust me * /
-      -- Syela */
-      values[id] = -60 * TRADE_WEIGHTING / MORT; /* want ~50 */
+      values[id] = TRADE_WEIGHTING; /* a kind of default */
      break;
/* unhappiness relief */
@@ -786,11 +782,21 @@
      } unit_list_iterate_end;
      break;
    case B_APOLLO:
- if (game.spacerace) - values[id] = values[B_CAPITAL]+1;
+      if (game.spacerace) {
+        values[id] = values[B_CAPITAL] + 1; /* trump coinage and defenses */
+      }
      break;
-
-    /* ignoring APOLLO, LIGHTHOUSE, MAGELLAN, MANHATTEN, STATUE, UNITED */
+    case B_UNITED:
+      values[id] = values[B_CAPITAL] + 4; /* trump coinage and defenses */
+      break;
+    case B_LIGHTHOUSE:
+      values[id] = values[B_CAPITAL] + 4; /* trump coinage and defenses */
+      break;
+    case B_MAGELLAN:
+      values[id] = values[B_CAPITAL] + 4; /* trump coinage and defenses */
+      break;
+    /* also, MAGELLAN is special cased in ai_manage_buildings() */
+    /* ignoring MANHATTAN and STATUE */
    } /* end switch */
  } impr_type_iterate_end;





[Prev in Thread] Current Thread [Next in Thread]