Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Parametrized warmap generation
Home

[Freeciv-Dev] Parametrized warmap generation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Parametrized warmap generation
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Wed, 26 Sep 2001 13:44:56 +0100 (BST)

Hi,

This is not really a patch (although it's fully functional, see below),
just sharing some development code.  

Following discussions with Raimar about triremes and warmaps and, having
been given a code base by Ross, I managed to incorporate and to get
working the following change to the warmap generation:
the main loop in really_generate_warmap already contains quite a few
switches: landmove vs seamove, unit vs city, igter or not.  To
efficiently generate safe targets for exploring triremes, one would need
to introduce even more checks which would slow down an already
CPU-expensive calculation.  The solution is to pass to a generic
Dijkstra-type loop a cost function specific to the considered case.

Different cost functions can be designed to handle special units such as
air and triremes.  Also this model can be extended to include a penalty
function which will evaluate each tile and terminate the loop when the
best target is found.

Right now it just produces identical savegames with the old method which
means it is correct (or at least not more incorrect than the current
method).

Comments/suggestions welcome,
G.

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

Attachment: warmap_func2.diff
Description: warmap_func2.diff


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Parametrized warmap generation, Gregory Berkolaiko <=