[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]
--- Petr Baudis <pasky@xxxxxxxxxxx> wrote:
> 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
My mistake, I'm not differentiating here between Per's 1st and 2nd patches.
<snip>
> > 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.
>
Obvious from the code. Hmm must be some new definition of obvious. In
particular
from line 1630 onwards in the ai/aiunit.c. So to be blunt, the todo is wrong,
and I'm not sure what code you are referring to that makes it obvious that the
AI does not establish trade routes.
I'll expect your grovelling apologies.
static void ai_manage_caravan(struct player *pplayer, struct unit *punit)
1601 {
1602 struct city *pcity;
1603 struct packet_unit_request req;
1604 int tradeval, best_city = -1, best=0;
1605 1606 if (punit->activity != ACTIVITY_IDLE)
1607 return;
1608 if (punit->ai.ai_role == AIUNIT_NONE) {
1609 if ((pcity = wonder_on_continent(pplayer, map_get_continent(punit->x,
punit->y))) &&
1610 build_points_left(pcity) > (pcity->shield_surplus*2)) {
1611 if (!same_pos(pcity->x, pcity->y, punit->x, punit->y)) {
1612 if (!punit->moves_left) return;
1613 auto_settler_do_goto(pplayer,punit, pcity->x, pcity->y);
1614 handle_unit_activity_request(punit, ACTIVITY_IDLE);
1615 } else {
1616 /*
1617 * We really don't want to just drop all caravans in immediately.
1618 * Instead, we want to aggregate enough caravans to build instantly.
1619 * -AJS, 990704
1620 */
1621 req.unit_id = punit->id;
1622 req.city_id = pcity->id;
1623 handle_unit_help_build_wonder(pplayer, &req);
1624 }
1625 }
1626 else {
1627 /* A caravan without a home? Kinda strange, but it might happen. */
1628 pcity=player_find_city_by_id(pplayer, punit->homecity);
1629 city_list_iterate(pplayer->cities,pdest)
1630 if (pcity && can_establish_trade_route(pcity,pdest) &&
1631 map_same_continent(pcity->x, pcity->y, pdest->x, pdest->y)) {
1632 tradeval=trade_between_cities(pcity, pdest);
1633 if (tradeval) {
1634 if (best < tradeval) {
1635 best=tradeval;
1636 best_city=pdest->id;
1637 }
1638 }
1639 }
> **************************************************************************/
> > > > > -
> > > > > 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.
>
K, funny code is good enough reason. But when the AI crew is done no one else
will ever get lost in that wilderness again.
> --
>
> 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/
>
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), (continued)
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Petr Baudis, 2002/02/25
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Raahul Kumar, 2002/02/25
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Per I. Mathisen, 2002/02/25
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Raahul Kumar, 2002/02/25
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Raahul Kumar, 2002/02/26
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Per I. Mathisen, 2002/02/26
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Raahul Kumar, 2002/02/26
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Tony Stuckey, 2002/02/26
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Raimar Falke, 2002/02/26
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Raahul Kumar, 2002/02/26
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277),
Raahul Kumar <=
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Petr Baudis, 2002/02/25
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Raahul Kumar, 2002/02/25
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Tony Stuckey, 2002/02/25
- [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277), Raahul Kumar, 2002/02/25
|
|