glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] Gradient concept


From: Nuage
Subject: Re: [glob2-devel] Gradient concept
Date: Tue, 25 Jan 2005 18:32:01 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050122

The idea of the gradient is true. Here are some precisions,
(usefull only for coders):

-all gradients unse unsigned 8-bits values (Uint8).

-there is one gradient for each destination type. One for each ressource,
for each team, and for each "swimability" unit. There is one for each
building, made only when needed, and made only when needed.

-the value "0" is reserved to defive places where there is an obstacle.
For instance, the places there is a building. Or the water for the
gradients used for units which can't swim.

-the value "255" is reserved for the destination. (Therefor, the units will
try to move to the highest value, instead of what where previously explained.)

-before proceding the gradient, all obstacle are set to "0", all free
places with "1", and all target places with "255".

-the value "1" is reserved for placeswhere the desination is too far,
(and that the place is not an obstacle). For instance, if a ressource is not
reacheable, then it will be writtent "1" in the gradient, at the position
of the considered unit. It's some logical consequences as the gradient
where not modiffied in such a place.
Maybe you want to say: "but maybe the target is at 255-1==254 cases away.
The answer is: yes, but the engine need to know what case it is. Therfor,
we accept to loose this reserved value, despite it limits the pathfiniding
to 253 distances.

and other question ?
Nuage





reply via email to

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