This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Side Mask


On Tue, 2002-07-23 at 15:07, Hans Ronne wrote:
> That I can agree with. A more modular worth code would be easier to
> maintain. And if we add support for doctrines, I think much of what you
> suggested can be achieved. But it's not a trivial thing to do.

Some parts of the new exploring_worth function would be easy to put into
their own functions.  If the range code was put in its own function,
finding the range of a unit would be quite easy throughout the AI code. 
For example, a planning function could determine if a unit could make it
from one place to another with an "if" statement as simple as:

if ( rangeOfUnit(u) > distance(x1, y1, x2, y2) )


Of course, in that case, the AI should also look for a safe path (e.g.
in fantasy.g, don't send cavalry over mountains or swamp), but that kind
of code should probably be placed in the pathfinding algorithm.


I'm not sure how useful it would be to put the mobility code in its own
function, but it certainly could be done.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]