glob2-devel
[Top][All Lists]

## Re: [glob2-devel] Pheramonal-Directional Algorithm

 From: Andrii Zvorygin Subject: Re: [glob2-devel] Pheramonal-Directional Algorithm Date: Tue, 8 Nov 2005 15:42:58 -0500

what i was thinking was that when the first glob using A* finds the resources (as the trails will be from a certain inn say to the wheat resource) we can along side the type destination borrow a bit to show if any water squares are crossed in the proccess (this should be pretty simple to implement, simply when it has found the optimal path it runs the squares through to check if any are water squares, if yes then we set the swim bit, if not then we don't)

btw i forgot to mention, the type will point to 2 bytes that could store the end location and swim bit, it wont store the locations to a precise point, it can say divide the grid by 4, so instead of 512x512 it will be 128x128, and not only will it take up less room. also if a glob gets lost it will check the entire square for say wheat instead of just the original wheat source.

On 11/8/05, Andrew Sayers <address@hidden> wrote:
On Mon, Nov 07, 2005 at 04:06:41AM -0500, Andrii Zvorygin wrote:
(snip)
>
>    (12*2)*128^2+(2*4*9)*(128^2/2)
>    we have a result of 983 040
>    1.0 MB

Remember that the figure of 12 bytes for an empty vector is not
portable.  It's very likely that different implementations (even future
or past versions of GCC) will have larger or smaller values.

>    now if we decide to have non-directional pheramones as well (to indicate
>    danger zones and length of time since last viewing) then we can have that
>    in the following way
>    vectorOfTeams<type[2]> nonDirectionalPheramones
>    so if it's initalized it will have both types put there
>    so
>    12*128^2+1*128^2
>    which is 212 992
>    so 0.2 MB

Why not bundle these together with the directional pheramones?  There's
already a vector of information for each team, for each square on the
map.  You only need add variables to the structure:

class TeamCellData
{
// ...
Phearmone directionalPheramones[4];
Pheramone nonDirectionalPheramones[2];
}

Also, how do you intend to handle globs that can/can't swim?  Obviously,
trails that cross water can't be followed by non-swimming globs, but
globs that can swim won't necessarily swim during a particular
expedition, and could lay down a non-swim trail if they wanted.

- Andrew

_______________________________________________
glob2-devel mailing list