Complete.Org: Mailing Lists: Archives: freeciv-ai: August 2002:
[freeciv-ai] coreai: ai_new_spend_gold()

[freeciv-ai] coreai: ai_new_spend_gold()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] coreai: ai_new_spend_gold()
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 25 Aug 2002 18:56:22 +0000 (GMT)

This is a big cleanup, and most of it is my own rewrite of it.
 - It used to only upgrade units similar to what it wanted to build or on
that unit's upgrade track. Now it upgrades any units in the cities with
highest want that are in danger. Rarely happens, since the AI rarely has
many defenders.
 - Lots of VERY odd logic nested up and simplified, some of it removed.
There is no way some of this code could ever have worked!
 - I removed some crutch logic that would remove errors created elsewhere
in the code (yeah, start switching production in the function where you
try to buy stuff, that's consistent!). This could mean reduced performance
by the AI, but what the #"=¤)(, this cleanup is necessary! The code should
now be readable and can be improved further by anyone.
 - The AI will no longer raise taxes to buy wonders and buildings.
 - The AI will raise taxes for settlers up until it has 8 cities, and a
big bad settler bug was removed which made the AI not buy settlers as
early as it should. The AI will not buy settlers after its 25th city.
 - The AI will no longer raise taxes when not needing it.
 - The AI will now disband units that remain in its cities when
there is no danger and the enemy has not begun sailing yet, mercilessly.
It does this to increase production.
 - I believe I have fixed the "AI will get stuck in taxmen mode" problem.
 - I believe the AI now is much faster in the beginning of the game.

This changes the AI a lot. I've tested it for many hours, but still:


Attachment: coreai6.diff
Description: Text document

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