Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277
Home

[Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277)
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Mon, 25 Feb 2002 14:37:15 +0100

Dear diary, on Mon, Feb 25, 2002 at 02:19:12PM CET, I got a letter,
where Raahul Kumar <raahul_da_man@xxxxxxxxx> told me, that...
> > > > diff -u3NrX freeciv/diff_ignore freeciv/ai-old/aiunit.c
> > freeciv/ai/aiunit.c
> > > > --- freeciv/ai-old/aiunit.c     Sun Feb 24 01:00:21 2002
> > > > +++ freeciv/ai/aiunit.c Sun Feb 24 19:38:18 2002
> > > > @@ -1396,8 +1396,7 @@
> > > >  
> > > >  /* this is horrible, but I need to do something like this somewhere. --
> > > > Syela */
> > > >    players_iterate(aplayer) {
> > > > -    if (aplayer == pplayer) continue;
> > > > -    /* AI will try to conquer only enemy cities. -- Nb */
> > > 
> > > Petr is right about the comment still being right. What does the AI do
> > > when it runs out of enemies?
> > 
> > It wins.
> 
> No I mean if it KO's the human player, it should go on to stomp the other
> AI's. World Domination.

AI has no particular dislikes of human player - is player as all others are.
Did you ever hear about autogames? ;p

> > > > +    if (!pplayers_at_war(pplayer,aplayer)) continue;
> > > >      city_list_iterate(aplayer->cities, acity)
> > > >        city_reinforcements_cost_and_value(acity, punit);
> > > >        acity->ai.invasion = 0;
> > > > @@ -1755,7 +1761,7 @@
> > > >  }
> > > >  
> > > > 
> > /*************************************************************************
> > > > -...
> > > > +  TODO: teach AI about trade routes with friendly players
> > > > 
> > **************************************************************************/
> > > 
> > > I believe you said this was done. Kill that todo.
> > 
> > When? Where? :)
> > 
> 
> Per said it was done in the readme to his later patches. 
> 
> Date:  Mon, 25 Feb 2002 02:07:00 -0800 (PST)
> From: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx> 
> To: freeciv-dev@xxxxxxxxxxx
> Subject: [Freeciv-Dev] patch: make ai understand peace and alliances 2
> (PR#1277)
> CC: bugs@xxxxxxxxxxxxxxxxxxx
> 
> Changes:
>  - the ai will now try to establish an embassy with you, even if you are
> on friendly terms with it
>  - the ai will attempt to establish trade routes with friendly players

It's not in this patch. I'll have a look at that one.

> Ah hah. By the way, for Per's info, the AI does establish trade routes. There
> are crap routes though, the AI does not seem to check on city size at all when
> establishing trade routes.I have never seen it establish a trade route with a
> foreign civ.

It doesn't as is obvious from the code - and the TODO implies that as well.

> > > >  static void ai_manage_caravan(struct player *pplayer, struct unit
> > *punit)
> > > >  {
> > > > @@ -1820,7 +1826,6 @@
> > > >  When empty, it tries to find some units to carry or goes home or
> > explores.
> > > >  Military units handled by ai_manage_military()
> > > > 
> > **************************************************************************/
> > > > -
> > > >  static void ai_manage_ferryboat(struct player *pplayer, struct unit
> > *punit)
> > > >  { /* It's about 12 feet square and has a capacity of almost 1000 
> > > > pounds.
> > > >       It is well constructed of teak, and looks seaworthy. */
> > > 
> > > That comment is ridiculous. Kill it.
> > 
> > Don't!
> 
> Why?

Why yes? It's kinda funny and no particular reason why to remove it; the code
has to be a little funny in onder to revive programmer lost in the wilderness
of Syela's code.

-- 

                                Petr "Pasky" Baudis

* elinks maintainer                * IPv6 guy (XS26 co-coordinator)
* IRCnet operator                  * FreeCiv AI hacker
.
No one can feel as helpless as the owner of a sick goldfish.
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/


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