Complete.Org: Mailing Lists: Archives: freeciv-ai: February 2003:
[freeciv-ai] Re: (PR#2477) Improved Auto-Explore
Home

[freeciv-ai] Re: (PR#2477) Improved Auto-Explore

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: cameron@xxxxxxxxxx
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: (PR#2477) Improved Auto-Explore
From: "Gregory Berkolaiko via RT" <rt@xxxxxxxxxxxxxx>
Date: Wed, 5 Feb 2003 11:07:41 -0800
Reply-to: rt.freeciv.org@xxxxxxxxxxxxxx

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.


Attachment: mmm.gz
Description: mmm.gz


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