[freeciv-ai] AI plans
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
It does appear that our plans for the AI's war code is not documented
anywhere. Did we really only discuss this on irc and not make any logs,
Anyway. I will try to rehash the ideas. Since both I and Greg are pretty
busy, anyone who wants to have a go at it should feel free to. At the
moment, I am working on diplomacy and hunter code and Greg is working on
ferry code, and I think that's it. Everything else is up for grabs.
So. The idea is that find_something_to_kill (hereafter fstk) should be
retired in its entirety, along with kill_something_with (ksw) and other
A new system should be built which clearly separates defensive attacks
(kill units converging on our cities) from coordinated offensive attacks
(bring an army to the enemy).
Defensive attacks are in general in two categories:
1) kill dangerous units that are too close to our cities
2) kill transports, diplomats and other dangerous units before they get
We already have ai_military_rampage (rampage) which looks for targets in a
one-turn horizon. It has been basically rewritten by Greg, and now works
pretty well, and the code is easily readable (unlike fstk and ksw). The
plan is to extend this to slightly more than one turn, so that it can
handle (1) above.
I have written an AI hunter code, which builds fast-moving units that it
sends after targets that the AI keeps track of and tries to guess roughly
where is heading based on its past movement trajectory. Along with the
custom code for air units this should take care of (2) above.
Then on to the offensive part.
We should calculate a 'ground zero', a place to concentrate our attacks.
This should be a coordinate on a continent that is somewhat close to the
AI, which has not too well defended cities, and bonus if there are rails
and roads we can abuse. We should calculate a turn sometime in the future
when we should have forces enough available to conquer this place.
Units that are recruited to offensive actions should check each turn if
they must start moving towards ground zero this turn to reach it or not
(with some margin of error). If they must, start moving. If not, just
check for rampage targets and wait. This way the army will only assemble
once they are at the ground zero, at which point it is hopefully too
late to do countermeasures.
If they need to ferry, then they should grab a ferry immediately, and
the ferry will sail when it is time. (I am not sure about this point.
When moving into ground zero, avoid ending up stacked with other units
(if killstack == 1). This is a challenge best left to the pf authors, I
believe, rather than custom hacked into the AI movement code.
The offensive want calculation should be based on the same principles
as ksw - that is, we check what is a good unit to attack versus the
units in the ground zero area. We need a nice statistical distribution
of attackers and defenders (bodyguards).
Now, the big question is how to stick the odd unit capabilities into
this. Diplomats, nuclear and air units should (still) be handled by
separate code, I think. Paratroopers, I am not sure.
Comments / ideas? Code? :)
|[Prev in Thread]
||[Next in Thread]|
- [freeciv-ai] AI plans,
Per I. Mathisen <=