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: Petr Baudis <pasky@xxxxxxxxxxx>, rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Raahul Kumar <raahul_da_man@xxxxxxxxx>, Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Thu, 21 Feb 2002 17:13:02 +0000 (GMT)

 --- Petr Baudis <pasky@xxxxxxxxxxx> wrote: 
> Dear diary, on Wed, Feb 20, 2002 at 09:49:53PM CET, I got a letter,
> where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
>
> I
> don't think thas those 99999 constants deserve their own #define. It is used

I agree completely

> only twice on two very near places on the code, it's not something you would
> want to change frequently, its mean/purpose should be pretty clear, and
> after
> all the symbolic names are terribly ugly ;). And as they don't really
> explain
> the value you will anyway scroll up to see what they are defined as when
> you'll
> read the code.
> 
> > > +  if (punit->unhappiness > 0) {
> > > +    best = 0 - 2 * MORT * TRADE_WEIGHTING; /* desperation */
> > > +  }
> > 
> > Can you explain this one?
> 
> Sorry, but I think I can't :-(. I know no logic argument why we shouldn't
> attack with units causing unhappiness, thus apparently this looks like some
> interesting sociologic experiment/simulation ;).

because if it's causing unhappines it should go home instead of attacking, I
guess (in other parts of the code there is check, if unit causes sadness and
is doing nothing, send it home.  so by making it do nothing here we
effectively encourage it going home).

but 
1. I wouldn't multiply by MORT (cause if it attacks and then goes home, the
real expense is just one more turn of unhappiness)
2. Don't units cause different amount of unhappiness under different
governments?  should be taken into account too.

Overall I would suggest a new function
unhappiness_impact(unit *punit, int time)

It would be usefull on other occasions too (I can give exact places if you
care).

G.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


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