Theoretically sorted by urgence.

Current state of work is visible at
http://pasky.ji.cz/cvsweb.cgi/freeciv/?cvsroot=aiciv - the module freeciv
contains my old cleanups, probably full of bugs, but there's a lot of them and
they may possibly help you. The freeciv-a2 module contains (now) only ongoing
cleanups which should be hopefully bug-free and are sent to maintainers as a
patch and are waiting for inclusion; it is also occassionally synced with the
official freeciv CVS.

My plan of work:
-> clean up assess_danger() and proccess_*_want()
-> take Ross' cleanups and first cleanup the places it touches (in AI) and then
produce patches from them
-> AI diplomacy.. too far away :) (or maybe it isn't, Per's improving something)

Feel free picking some of following, but please notify me so I assign you there.

========

Cleanup THRESOLD*move_rate uses:
find_beachhead(), find_something_to_kill(), find_nearest_friendly_port(),
really_generate_warmap()

[Raahul]

Basically I mean that THRESHOLD should be always multiplied by either move_rate
or SINGLE_MOVE (imho).

========

Massive AI cleanups (comments, variable names, accidental formating changes)

[In progress]

This basically blocks everything else for now, as I'm not going to mess cleanup
with features changing behaviour and I'm not going to backport my features
to original messy code.

Beware:
- (...*3)/2 rather than ... *1.5
- _type_ for Unit_Type_id

========

Merging of rwetmore's corecleanup patches

[In progress]

I merge only appropriate comments and clarifications for now, no new features
yet.

========

http://arch.freeciv.org/freeciv-dev-200005/msg00041.html

It also mentions something of following...

========

Check settlers AI code:
  - makes cities on silly places (take the tile directly under the city into
    more account as we can't move workers from theer?) seems to me.
  - teach settlers not to move thru too hot ground

========

Riflemen won't leave its bodyguard (also riflemen, but with half of HP) even
near empty enemy city?! Automatically release bodyguard when weaker than unit
it guards.

[Tony Stuckey]

>       And the corrolary -- when multiple units are on a square, and one
> bodyguard is out of movement points, check for another with movement points
> and swap the units.  This would allow some faster travel.

>       When landing on a beachhead, try to disperse to multiple landing
> points, if none of them give a defensive advantage.  It's silly to have 4
> Howitzers and 4 Riflement on 1 square, where they can all be easily killed,
> when spreading them over 2 or 3 squares gets you a much more significant
> invasion force.

========

[18:06] < per> if you'd have fixed the "I must build city walls or coastal defence" syndrome of the AI, then that would have been
               nice
[18:07] < per> pluss add some code to ensure every city has a defender
[18:08] < per> now the AI builds city walls and coastal defence in cities where it doesn't have defenders... stupid

========

Better starving city decreasing population than city constantly in disorder
(maybe even some counter of number of turns city is in disorder?)

========

Only phalanx inside city attacking against only horsemen outside on ordinary
terrain?! (loosing obviously)

Looks like city autoattack problem.

[Tony Stuckey]

>       The AI needs to have better unit selection.  It builds lots of
> defenders, but few attacking units.  In the early game, each city should be
> lightly defended.  Once it's clear that initial expansion has stopped, we
> should have at least one strong defender and one strong attacker in each
> city.
>       Also, when obsoleting units, the AI fails to understand that
> building a new Barracks and disbanding may be better than upgrading
> previous units.

========

Take time left to obsoleting wonder into account when deciding what to build

Decide globally about wonders with global effects (and this decision has
a lot higher priority, only grave danger can override it) - take into account
possibility of danger (in-land city in the heart of the empire is best) and
production of the city.

Use wonders less as a stock for production and more as actual wonders

Build some wonders more and hunt for them more and stick on them more

========

AI DIPLOMACY! FINALLY! WE NEED IT! :-)

[Per] [Tony?]

========

Check disbanding AI code, disbanded archer in front of empty enemy city, with
tons of others idling. Basically, compute somewhat 'importance' of the unit
and start disbanding from least important unit.

========

When hanging gardens got obsoleted, all cities fall into disorder => 100%
luxury rate for too long time, big problems (dunno if still an issue?)

========

When capital in big danger, move palace (if launched spaceship, do it fast!)

========

Space race improvements:
  - launch if others are already launching too

========

Rewrite tax/sci/lux rate code, rate each(!) of those

========

Move science-related AI code into advscience.c (?)

========

Clean up other advisors too

========

Make a possibility for multiple strategies in the AI for various nations,
e.g. one militarized something, another one civilized perfecionist

========

civbot

========

Possibility to mark some tiles, e.g. locations for further cities etc. visible
thru shared vision, multiple types (see TeamCiv)

========

Easily parseable gamelog containing all important informations

========

Rewrite ruleset|everything parser using flex+bison

========
