[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]
On Wed, Feb 20, 2002 at 08:49:26PM +0100, Petr Baudis wrote:
> > > + benefit = (benefit + 40) * punit->hp / unit_type(punit)->hp;
> >
> > What is that 40?
>
> Just magic value of city. It's used as this very frequently (I'm not sure that
> equal value for city walls is absolute coincidence ;).
>
> This would be nice to have as some #define or at least mentioned in README_AI.
> Someone promised to extend it. Who was it? Raahul?
>
> > > + SET_BEST(99999);
> > ...
> > > + if (map_has_special(x1, y1, S_HUT) && best < 99999
> > > + && could_unit_move_to_tile(punit, punit->x, punit->y, x1, y1)
> > > != 0
> > > + && !is_barbarian(unit_owner(punit))
> > > + && punit->ai.ai_role != AIUNIT_ESCORT
> > > + && punit->ai.charge == 0 /* Above line doesn't seem to work.
> > > :( */
> > > + && punit->ai.ai_role != AIUNIT_DEFEND_HOME) {
> > > + SET_BEST(99998);
> > > + }
> >
> > These 9999* are ugly.
>
> And what shall we do with them..?
Change the SET_BEST to a SET_BEST_IF_BETTER (this will remove the
"best < 99999"). Add
#define BEST_FITNESS 9999
#define SECOND_BEST_FITNESS 9998
> + if (punit->unhappiness > 0) {
> + best = 0 - 2 * MORT * TRADE_WEIGHTING; /* desperation */
> + }
Can you explain this one?
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
pgp 2: id: 0F9D7955 len: 1024 fingerprint: 7760F933D5478009 4FA0C56F1DC2FB8E
1 + 1 = 3, for large values of 1
- [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/17
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/17
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/17
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/18
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/18
- [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), Raahul Kumar, 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), Petr Baudis, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264),
Raimar Falke <=
- [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, 2002/02/21
- [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
|
|