[Freeciv-Dev] Re: stop ai from building useless buildings (2) (PR#1362)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Dear diary, on Fri, Apr 05, 2002 at 11:35:22PM CEST, I got a letter,
where "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx> told me, that...
> On Fri, 5 Apr 2002, Petr Baudis wrote:
> > I'll annoy you until you'll reply! ;)))
>
> You're nasty ;-P
I know ;).
> > Trailing whitespace. /me hides
>
> How do you notice things like that?? Not fixing!
Pff! :)
> > > + /* The next idea is that if our enemies don't have any offensive
> > > + airborne units, we don't have to worry. Go on the offensive! */
> > > + if (unit_type(punit)->attack_strength > 1 && (is_air_unit(punit)
> > > +
> > > ||is_heli_unit(punit))) {
> >
> > This is so ugly.. :^)
>
> There is no pleasing some people. If I wrote
>
> if (unit_type(punit)->attack_strength > 1 && (is_air_unit(punit)
> ||is_heli_unit(punit))) {
>
> then Greg would come after me. What would please you both?
>
> if (unit_type(punit)->attack_strength > 1
> && (is_air_unit(punit)
> ||is_heli_unit(punit))) {
>
> This?? No better, IMHO.
I proposed
+ if (unit_type(punit)->attack_strength > 1 && (is_air_unit(punit) ||
+ is_heli_unit(punit))) {
> > > + /* these variables are used for improvements evaluations in
> > > + ai/advdomestic.c, only valid between ai_eval_init and _done */
> > > + bool eval_invasions; /* check if we need to consider invasions */
> > > + bool *eval_continents; /* check non-allied cities on continents */
> > > + bool eval_coastal; /* check if exists non-allied offensive ships */
> > > + int eval_sdi; /* check for nukes: 0=no, 1=capability, 2=built */
> > > + bool eval_sam; /* check for non-allied offensive aircraft */
> >
> > Why not separate structure?
>
> I don't see the point, at least not yet. Need to think more about how to
> do the AI data structures in general. I don't like AI stuff cluttering up
> common/ players.h and cities.h and units.h.
Dangers are entire separate area of interest for AI, which is not being used
only globally for player, but probably should be used for per-city caching as
well. This'll do it easily, without data duplication. I'll need it in
assess_danger() soon, as I'm going to split it to several smaller functions and
I need to pass this stuff around between its parts. At least it looks so :).
I agree that it'd be nice if this stuff would move away back somewhere to ai/.
> For now I think the above is sufficient.
*sigh* so I'll have to do everything myself again ;)
--
Petr "Pasky" Baudis
* ELinks maintainer * IPv6 guy (XS26 co-coordinator)
* IRCnet operator * FreeCiv AI hacker
.
Teamwork is essential -- it allows you to blame someone else.
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/
|
|