Complete.Org: Mailing Lists: Archives: freeciv-dev: September 1999:
[Freeciv-Dev] Re: code optimization ideas
Home

[Freeciv-Dev] Re: code optimization ideas

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Peter Schaefer" <schaefer@xxxxxx>, "Freeciv Development" <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: code optimization ideas
From: "Claus Leth Gregersen" <leth@xxxxxxxxxxx>
Date: Thu, 23 Sep 1999 00:18:52 +0200

<Snip>
> Also do not most of the calls to get_map_tile come from pathfinding ?
> How about putting the terrain into an array all by itself,
> and putting the stuff not needed by pathfind elsewhere ?
> This would increase cache hits by only accesing the memory needed by the
pathfind .. maybe .. .
>
> --
> Peter Schäfer - mailto:schaefer@xxxxxx, schaefer@xxxxxx
>
>

I took a look at the AI the other day, to me it seems like that the price of
pathfinding is a sympton
more than the decease. What i mean is that the AI is moving and moving units
around.
What would reduce it, would be an overall AI strategy, that could reduce the
needs to do goto's.
Goto's will never be cheap no matter what is done.

However a possible cure for the waste amount of cycles spent on gotos.
What about implementing an extra goto function, used by an AI player, when
it get more than
a given number of units:
A goto function that is not necessarily giving the best path in all cases,
but always returns a valid
path (and in most cases optimal),
the idea of this secondary goto function should of course be that it should
be much more cpu friendly.
I got a few ideas on how, if anybody would code it.

/Claus Leth Gregersen.



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