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 21:16:27 +0100

Dear diary, on Fri, Feb 22, 2002 at 09:10:49PM CET, I got a letter,
where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
> On Fri, Feb 22, 2002 at 08:46:09PM +0100, Petr Baudis wrote:
> > Dear diary, on Fri, Feb 22, 2002 at 08:08:40PM CET, I got a letter,
> > where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
> > > 2) Can someone explain -2*MORT*TRADE_WEIGHTING?
> > 
> > We're cutting off luxury, which is part of trade, so we use TRADE_WEIGHTING.
> > And MORT is just that constant meaning 'reasonably foreseeable (eek?) 
> > future'.
> > And 2 is .. looks like just some constant estimated/tuned to have it working
> > well. Any deeper logic in that?
> 
> 2 trade to compensate one unhappiness? Related question: what is the
> range of values of punit->unhappiness? [0..1] (bool) or [0..2] (as 
>   ./client/gui-win32/mapview.c:  int unhappy = CLIP(0, punit->unhappiness, 2);
> ) suggests. Is it valid for a ruleset to set uk_happy >1?

It looks it's 2 for aggressive units and 1 for other units?

> If unhappiness isn't a bool that the formula has to be changed to
> -2*MORT*TRADE_WEIGHTING*punit->unhappiness

That's a good point. IMHO this was made for the aggressive units anyway
and the more correct thing to do would be:

0-MORT*TRADE_WEIGHTING*punit->unhappiness

However this is also a little beyond mere cleanup and it's something I'm not
really sure about, so I need also opinions of few other ppl :).

-- 

                                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]