Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#
Home

[Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, Mike Kaufman <kaufman@xxxxxxxxxxxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264)
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Fri, 22 Feb 2002 18:43:10 +0100

Dear diary, on Fri, Feb 22, 2002 at 06:14:50PM CET, I got a letter,
where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
> > > > > > So it looks to me that a boolean value would be enough. At least 
> > > > > > this
> > > > > > "- 2 * MORT * TRADE_WEIGHTING" thing can be removed.
> > > > > 
> > > > > Please see my another mail :^).
> > > > 
> > > > Which one?
> > > 
> > > Basically we agree that this unhappiness setting in not used at all.
> > 
> > It is! It is! It is! Inside findvictim() it is! 
> 
> How? Where?

| Ok, they aren't. What broke our predictions today was the fact that desire may
| be negative - thus the mean of the unhappy calculation was completely opposite
| to the one we thought.

And from the latest code:

    /* When we're causing unhappiness, we'll set best even lower, so that we
     * will take even targets which we would ignore otherwise (in other words -
     * we're going to commit a suicide). */

However, I agree that the latest patch and this comment was pretty hard to find
now even to me in this thread ;-). Next patches will be really marked with
revision number in the subject (and rather at the start of the subject as end
of it isn't even visible in mutt on 132-chars wide screen at some places of the
thread :).

> > See latest patch and comment about this in it! :)
> 
> Which is the latest? The one I commented?

The one I sent you now :).

> > > However boolean value will not be sufficient.  You need at least three:
> > > NOTHING_TO_KILL
> > > SOMETHING_GOOD
> > > SOMETHING_SO_GOOD_EVEN_A_BODYGUARD_CANT_RESIST_IT
> > > 
> > > Then all of them would be used, fx in
> > > 
> > > 1631       ai_military_findvictim(pplayer, punit, &dest_x, &dest_y);  
> > > 1632       if (dest_x == punit->x && dest_y == punit->y) {
> > > 1633 /* no one to bash here.  Will try to move onward */
> > > 
> > > this idiotic if (dest....) would be replaced by a better one
> > > if (ai_mil_fv(...) == NOTHING_TO_KILL)
> > 
> 
> > I would like more to still return best and keep those tests... (my old bones
> > feel we might want to take advantage from this value later).
> 
> No. IMHO we should remove them. If there are added later (_if_ this
> happens) it has to be with reason (you have to give then).

I still disagree but I don't care a lot. I'll move on in next patch and leave
tuning of this to you with Greg; I'm not *so* much interested in it and you
seem to understand it in higher deep.

-- 

                                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]