[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]
Dear diary, on Thu, Feb 21, 2002 at 06:13:02PM CET, I got a letter, where
Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> told me, that...
> > 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).
That makes sense. I'll modify the comment (patch'll be attached in another
reply ;).
> 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).
I would welcome such a patch on top of this one, moving this test to another
function and use the function on other places. However, this is IMHO out of
scope of this patch.
--
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/
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), (continued)
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Mike Kaufman, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/21
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/21
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264),
Petr Baudis <=
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/21
- Message not available
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/21
- [Freeciv-Dev] [POOL] Variables descriptions, Petr Baudis, 2002/02/21
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Mike Kaufman, 2002/02/21
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Reinier Post, 2002/02/21
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Raahul Kumar, 2002/02/22
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Daniel L Speyer, 2002/02/22
- [Freeciv-Dev] [POLL] Variables descriptions: Votes on Style, Raahul Kumar, 2002/02/22
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Raimar Falke, 2002/02/22
|
|