[freeciv-ai] Re: (PR#2477) Improved Auto-Explore
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Looked at explorer23.
Problem 1: explorer strays from the shore (rare). Savegame attached (try
it with the original explorer23, before fixing other bug detailed below).
Problem 2: verrrry slow. The problem is two-fold. First, you don't set
activity to IDLE, so handle_unit_move_request fails and you have to
generate warmap for _every_ move. Second, the code in explorer_desirable
is rather slow and it's called often. The former is easily fixable,
just add:
/* Idle unit, since otherwise handle_unit_move_request fails!
* TODO: Fix it and remove this idling */
if (punit->activity != ACTIVITY_IDLE) {
handle_unit_activity_request(punit, ACTIVITY_IDLE);
}
before PART 1. Still, when warmap does have to be calculated, the whole
thing is significantly slower. The pig is is_within_own_city_radius,
according to my analysis (60%). But unless we remove it altogether, I
don't know what can be done. likely_ocean is also quite bad (30%). But
maybe we can help by checking the warmap distance first and if it is
outside reasonable bounds (even MAXCOST would be better than nothing), not
call explorer_desirable at all. This should work for bigger maps.
Other comments:
3. likely_coastline can return bool (and be renamed into
is_likely_coastline) same about likely_trireme_loss_pct
(is_likely_trireme_loss), this function you can shorten quite a bit.
4. you obsolete tile_is_accessible. Please check if this function is
undeed not needed (i.e. you didn't forget to put it where it should be)
and then remove it.
5. get_range_at should not peek under the fog (relevant handicap for AI is
H_MAP, I think). Or it can be killed altogether :)
Best wishes,
G.
mmm.gz
Description: mmm.gz
Message not available
[freeciv-ai] Re: (PR#2477) Improved Auto-Explore, Gregory Berkolaiko via RT, 2003/02/06
|
|