[freeciv-ai] Re: [Freeciv-Dev] Why does the partisan does not conquer th
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, 13 Sep 2002, Gregory Berkolaiko wrote:
> 2. This problem is wide-spread.I reckon that sometimes it's the
> bodyguard code which doesn't release the unit.Sometimes it's simply that
> the city was cleared after the potential occupier is processed.I thought
> about it and the solutions would probably involve either cycling through
> all units again and forcing them to occupy cities if they have enough
> movepoints or cycling through empty (or better emptied) enemy cities and
> see if any of our units is within walking distance.The second is
> preferable and can be done better with the new path finding.
This can easily be solved (assuming this is the problem) by changing the
structure of ai_manage_units() so that we first run throgh all bodyguards
(let them have a chance to rendezvous before we move their charges), then
move all units but bodyguards, then finally run bodyguards again (let them
have a chance to detach and attack empty cities).
This won't spend much extra CPU since we will (or should) abort at once if
the unit has zero moves left.
A similar structuring should probably be done for ferries, but the current
ferry code, I have concluded, is unsalvagable so I don't really wnat to
mess with it.
"I don't see why people are so upset about cloning sheep. American
television networks have been doing that to their audiences for years."
-- Jello Biafra