[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]
I read your patch. The code is very clean and nice. I don't quite
understand where such drastic improvement in performance comes from...
You code just ensures that AI doesn't build walls in loony places. I
guess it allows AI to build walls where it actually needs them...
However I have two major grudges against the code:
1. Your caching is fake. ai_eval_buildings is called for each city of
pplayer and for each city you recompute player-wide values. Move
ai_eval_init one frame above ai_eval_buldings, it's the easiest I guess.
2. I would really like the code to be more unified. The wall values are
being majorly hacked by assess danger. Maybe we should remove walls and
such out of jurisdiction of advdomestic and move it into assess_danger??
And a minor grudge:
3. A handicap H_DEFENSIVE is player-wide, so you can take it into account
in ai_eval_init by setting everything to TRUE.
And a nitpick:
4. You don't initialize player->ai.eval_continents to FALSE explicitely.
But I guess it's a standard that FALSE is 0, so calloc is fine...
G.
On Fri, 5 Apr 2002, Per I. Mathisen wrote:
> On Fri, 5 Apr 2002, Per I. Mathisen wrote:
> > Here is a version sans bug and H_DEFENSIVE.
>
> And here is a new version of the wall/etc eval patch. Removed bug in
> H_EXPERIMENTAL code and made it completely stop building SDI when no
> non-allied player could build nukes (not just scale down want to 20).
>
> Yours,
> Per
>
> "While we're all in favor of Arafat doing more to suppress violence in
> the Middle East, we fear that he doesn't have all that much influence on
> the Israeli government. " --Sam Smith
>
|
|