Complete.Org: Mailing Lists: Archives: freeciv-dev: March 1999:
[Freeciv-Dev] patch: a bit better easy level
Home

[Freeciv-Dev] patch: a bit better easy level

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] patch: a bit better easy level
From: Per Mathisen <permath@xxxxxxxxxxx>
Date: Wed, 10 Mar 1999 14:37:41 +0100 (MET)

AI players now prefer Monarchy. They will use it exclusively after
Monarchy has been researched. My own testing suggests that the AI
will go for Republic before researching Monarchy, and since I did not want
to muck with the research code, I let it use Republic in the meantime.

I am not sure how effective this is, but it seemed to work pretty well for 
me.

Yours,
Per

--- ai/aihand.c.old     Wed Feb 24 15:44:31 1999
+++ ai/aihand.c Wed Mar 10 14:59:48 1999
@@ -440,15 +440,25 @@
 {
   int government = get_race(pplayer)->goals.government;
-  government = G_REPUBLIC; /* need to be REPUBLIC+ to love */
-/* advantages of DEMOCRACY: partisans, no bribes, no corrup, +1 content if 
courthouse */
-/* disadvantages of DEMOCRACY: doubled unhappiness from attacking units, 
anarchy */
+  if (pplayer->ai.skill_level > 3)
+    government = G_REPUBLIC; /* need to be REPUBLIC+ to love */
+  else
+    government = G_MONARCHY; /* well, you asked for it */
 /* realistically we should allow DEMOC in some circumstances but not yet -- 
Syela */
   if (pplayer->government == government)
     return;
+  /* can we switch to desired govt? */
   if (can_change_to_government(pplayer, government)) {
     ai_government_change(pplayer, government);
     return;
   }
+  /* alternatives when desired govt is not available */
   switch (government) {
+  case G_MONARCHY:
+    /* rationale: the AI sometimes researches republic, but not monarchy.
+       we do not want to cripple the AI, even at easy, so we let it have
+       republic until it can switch to monarchy -- Per */
+    if (can_change_to_government(pplayer, G_REPUBLIC)) 
+      ai_government_change(pplayer, G_REPUBLIC);
+    break;
   case G_COMMUNISM:
     if (can_change_to_government(pplayer, G_MONARCHY)) 


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