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

Dear diary, on Thu, Feb 21, 2002 at 06:13:02PM CET, I got a letter, where
Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> told me, that...
> > > > +  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).

Oops. I forgot to change this :-).

However, can you please explain me why this test is needed after all, when we
ignore the 'best' anyway in all calls of findvictim(), except one case where we
immediatelly check if it's larget than 40 * SOMETHING and if not we don't care
anymore?

I removed at least the 'noone has an idea what it does' part, when sending the
patch next time, it'll be there ;-).

-- 

                                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]