Complete.Org: Mailing Lists: Archives: freeciv-ai: January 2003:
[freeciv-ai] Re: (PR#2644) AI needs 5400 years to get Republic
Home

[freeciv-ai] Re: (PR#2644) AI needs 5400 years to get Republic

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: (PR#2644) AI needs 5400 years to get Republic
From: "ue80@xxxxxxxxxxxxxxxxxxxxx via RT" <rt@xxxxxxxxxxxxxx>
Date: Fri, 3 Jan 2003 06:04:11 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, Jan 02, 2003 at 09:25:02AM -0800, Per I. Mathisen via RT wrote:
> 
> On Mon, 30 Dec 2002, ue80@xxxxxxxxxxxxxxxxxxxxx via RT wrote:
> > > > after playing a little bit with the experimental AI i saw that the AI
> > > > isn't able to make the step to Monarchy or The Republic in some
> > > > cases.
> > >
> > > What was the reason - lack of the technology or didn't it decide to
> > > change?
> >
> > It's lack of technology. And a situation where all money is needed for
> > the buildings.
> >
> > New game with actual cvs:
> >
> > 100% tax 21 baracks + 16 courthouses, no libraries. 30 cities.
> > 28 settlers.
> 
> This could be because of one of two things:
>   - We don't have anything useful to build (can't optimize for food so
> that we can build settlers), so we build barracks instead.
>   - We have some spurious want for attackers all over the place that leads
> us to build barracks.
> 
> The former is more likely. Both are actual problems that should be fixed
> eventually.
> 
> I do not think that the complex algorithms hinted at by Ross will do any
> good whatsoever in any case. Fix the underlying problems.

I wrote some lines of code to see when Ai usually gets Republic.

1: Endyear: -2150
1: Endyear: -1800
1: Endyear: -1950
1: Endyear: -1050
1: Endyear: -575
1: Endyear: -1350
1: Endyear: -1850
1: Endyear: -1750
1: Endyear: -575
1: Endyear: -1800
1: Endyear: -1400
1: Endyear: -1100
1: Endyear: -725
1: Endyear: -2050
1: Endyear: -2450
1: Endyear: -1700
1: Endyear: -1200
1: Endyear: -2750
1: Endyear: -1700
1: Endyear: -2350
1: Endyear: -2850
1: Endyear: -2250
1: Endyear: 1776
1: Endyear: -1350
1: Endyear: -2400
1: Endyear: -2150
1: Endyear: 800
1: Endyear: -2100
1: Endyear: -500
1: Endyear: -2250
1: Endyear: -1550
1: Endyear: -925

10 times before -2000
 8 times between -2000 and -1500
11 times between -1500 and 1 AD
 2 times after 1 AD

Thats in 66% of the game much to late. The earlier you get Rep or
Monarchy the faster you can grow.

I think that the number of settlers is to high in all games. More than 1
settler for every city is not ok in most cases. (High food cities can
have 2)

To test
% for ((i=1 ;i<21;i++)) ;do ./ser -r test-ai >> test-rep  ; done
% grep Endy test-rep

Thomas
-- 
Thomas Strub  ***  eMail ue80@xxxxxxxxxxxxxxxxxxxxx
Nur weil das Aufzeichnen, Kopieren und Schnüffeln bei elektronischem 
Datenverkehr leichter als bei der klassischen Post ist, darf man es nicht
einfach tun.

hard
expe
set endy 5000
create 1
#create 2
#create 3
#create 4
#create 5
#create 6
#create 7
#create 8
#set xsi 200
#set ysi 100
set spacer 0
set gen 3
set huts 0
set barba 0
set expl 2
set timeout -1
start
? civscore.log
? ddddd
? def_ships_moves2.diff
? fun.leaders
? key.diff
? rep-2250-normalplaying-civscore.log
? rep-2250-normalplaying.gz
? rep-2400-not-normal.civscore.log
? rep-2400-not-normal.gz
? rep-end.diff
? rep-in-27.gz
? republic.gz
? test-ai
? test-rep
? common/.tech.c.swp
? server/.srv_main.c.swp
Index: client/gui-gtk/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/citydlg.c,v
retrieving revision 1.150
diff -u -r1.150 citydlg.c
--- client/gui-gtk/citydlg.c    2003/01/01 11:51:32     1.150
+++ client/gui-gtk/citydlg.c    2003/01/03 13:59:31
@@ -1672,6 +1672,7 @@
   } else {
     width = SMALL_TILE_WIDTH;
   }
+  freelog(LOG_ERROR,"width= %d", width);
   pdialog->cwidth = width;
 
   gtk_pixcomm_clear(GTK_PIXCOMM(pdialog->citizen_pixmap), TRUE);
Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.110
diff -u -r1.110 srv_main.c
--- server/srv_main.c   2002/12/18 17:36:20     1.110
+++ server/srv_main.c   2003/01/03 13:59:32
@@ -195,7 +195,12 @@
   int barbs = 0, alive = 0;
   bool all_allied;
   struct player *victor = NULL;
+  const char *end_year_tech = "The Republic" ;
+  Tech_Type_id tech_id;
+  
+  tech_id = find_tech_by_name(end_year_tech);
 
+
   /* quit if we are past the year limit */
   if (game.year > game.end_year) {
     notify_conn(&game.est_connections, 
@@ -203,6 +208,17 @@
     gamelog(GAMELOG_NORMAL, _("Game ended in a draw as end year exceeded"));
     return TRUE;
   }
+
+  /* we end the game after someone has the tech from tech_end */
+  players_iterate(pplayer) {
+    /* tech??? */
+    if (base_total_bulbs_required(pplayer,tech_id) <= 0)
+    { 
+      freelog(LOG_ERROR,"Endyear: %d",game.year); 
+      return TRUE;
+    }
+  } players_iterate_end;
+  
 
   /* count barbarians */
   players_iterate(pplayer) {

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