Complete.Org: Mailing Lists: Archives: freeciv-ai: May 2002:
[freeciv-ai] Re: Generalised improvements AI support

[freeciv-ai] Re: Generalised improvements AI support

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv-ai <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] Re: Generalised improvements AI support
From: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Date: Mon, 6 May 2002 22:49:39 +0200 (MEST)

On Mon, 6 May 2002, Ben Webb wrote:
> >From doc/README.impr-gen:-
>  - Not all effects are currently implemented:
>    - Enemy_Peaceful, Improve_Rep

If I'm the one finally implementing AI diplomacy, I won't allow my code to
be sullied by such idiocy. To allow buildings to influence AI players and
AI players only, is crap. I'd be glad to see those go.

;     "May_Declare_War" - allowed to declare war at least AMOUNT percent
;                         of the time

This one should be implemented, though, along with the Senate. I guess
Raahul will have a go at this as part of his Civ2 crusade...? ;)

>    - Barb_Attack, Barb_Defend, Slow_Nuke_Winter, Slow_Global_Warm and
>      Trade_Route_Pct are not yet coded for, but are not used in standard
>      Freeciv rulesets anyway.

How is Barb_Attack supposed to work?

> > /* Create a virtual city out of pcity. If building has any effects that
> >    we can measure, then add effects of building, and reallocate specialists
> >    and workers in virtual city for optimal placement */
> > struct city *clone_city_with_building(pcity, building);
> >
> > /* Clone a list of cities with given building, for wonders.
> >    Calls clone_city_with_building for each city. */
> > struct city_list *clone_city_list(citylist, building);
>       I was just thinking of something similar for the former - cloning
> the city is a nice way to be able to use the functions in common/, but am
> not quite sure what you're driving at with the latter. impr-gen doesn't
> distinguish between buildings and wonders at all, so it's entirely
> possible that an ordinary building can affect multiple cities. This
> _should_ make Civ3-style mini-Wonders trivial to implement.
>       It'd be fairly straightforward to clone a list of cities which
> would be affected by a building being constructed in a given city.

The final ai_eval_building function needs to be able to sum up all the
benefits from the building, even if affecting many cities. Hence the city
list. We'd just pipe this city_list into a city_list_iterate and sum up
all the benefits.

>       impr-gen currently has no support for defense against diplomats,
> and I haven't coded the DEFEND_BARB effects either. I'm thinking of
> replacing the current unit_class_id with something a bit more general,
> that encompases all of the unit flags rather than just the current
> F_MISSILE and F_NUCLEAR. That'll enable you to tweak defence modifiers
> against any kind of unit (which, as Raahul mentioned to me earlier,
> would be handy for extending the impr-gen effects to units, so that
> the whole Aegis/Pikemen/Horse/etc/etc stuff can be taken out into the
> rulesets).

I'm only worried it might get a little too complicated. The flags code is
simple to understand, simple to code and simple to extend. The gen. impr.
approach is none of the above. But this is another discussion.

> > (We should also "reverse amortize" want value for buildings that become
> > obsolete by calculated time to obsoletion.
>       Indeed, or choose research priorities to delay the obsoletion if
> the building/Wonder already exists (I don't know if the AI does this
> already).

No. The AI code contains a lot of very fancy function calls for evaluating
advances, but when you start nesting them up, almost all of them end up in
a function which basically says /* not implemented yet */.

> > This should be merged into my ai_eval_wall|sdi|sam|costal patch.
> Can you remind me of the URL for this?

I'll post a new version which should be more gen. impr.-friendly in a

>       Well, I imagined that the AI would send damaged units to cities
> with Barracks or Ports, or not bother quite so much if it had United Nations,
> and build Barracks and Ports in front-line cities. This would require
> evaluation of (potential) Unit_Repair and Unit_Recover effects.

That's only in your imagination, unfortunately. Currently it does none of
these things.


"There are 10 types of people in the world. Those who understand binary
and those who don't."

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