Closed GoogleCodeExporter closed 9 years ago
No one to answer this? And BWTA won't work with CGAL3.6 / boost1.42...
Original comment by gabriel....@gmail.com
on 5 Apr 2010 at 10:24
There are exactly two problems, the one mentioned above coming from the
resolution of
the walkability grid and one coming from the algorithm: between lines 189 and
190 of
src/pathfinding.cpp, you should have a test for "can we cross diagonally" (same
problem as above). Such a test can be written:
if (!(p.x() == x || p.y() == y) && !(walkability[p.x()][y] ||
walkability[x][p.y()]))
continue;
Regards,
Gabriel
Original comment by gabriel....@gmail.com
on 6 Apr 2010 at 11:39
Original comment by lowerlo...@gmail.com
on 11 Apr 2010 at 8:09
I think there is a mistake in he following lines of AStarSearchDistance &
AStarSearchPath. Please correct me if i'm wrong!
int minx=getmax(p.x()-1,0);
int maxx=getmin(p.x()+1,BWAPI::Broodwar->mapWidth());
int miny=getmax(p.y()-1,0);
int maxy=getmin(p.y()+1,BWAPI::Broodwar->mapHeight());
for(int x=minx;x<=maxx;x++)
for(int y=miny;y<=maxy;y++)
{
etc.
}
it should be:
for(int x=minx;x<maxx;x++) //CHANGE
for(int y=miny;y<maxy;y++) //CHANGE
{
etc.
}
Reasoning:
The map dimensions might be 96x96. Therefore "Broodwar->mapWidth()" = 96.
However, the 96 tile co-ordinates go from 0-95, not 1-96.
The rightmost tile on the map would have co-ords such as (95,0)to (95,95).
using "x <= maxx" causes the algorithm to include tiles (96,0) to (96,96).
these tiles are outside the maps area and give incorrect results.
Often causing crashes (depending on how the function has been used).
Original comment by Kali...@gmail.com
on 20 May 2010 at 3:31
ah it should be
int minx=getmax(p.x()-1,0);
int maxx=getmin(p.x()+1,BWAPI::Broodwar->mapWidth()-1);
int miny=getmax(p.y()-1,0);
int maxy=getmin(p.y()+1,BWAPI::Broodwar->mapHeight()-1);
bwapi beta 2.7.1 now correctly reports the bottom 4 rows of walkability tiles as
unwalkable (as well as 20 columns in from each side) since those tiles are
unwalkable
regardless of the actual map data for those tiles.
The low res map data should be true only if all 16 walk tiles are walkable
because it
is set like so:
for(int x=0;x<width;x++)
{
for(int y=0;y<height;y++)
{
MapData::lowResWalkability[x/4][y/4]&=MapData::rawWalkability[x][y];
}
}
it uses &=, so if any of the 16 raw walkability tiles is false,
lowResWalkability for
that tile will be false.
Original comment by lowerlo...@gmail.com
on 21 May 2010 at 5:24
[deleted comment]
Pathfinding should be fixed as of r148 (with bwapi 2.7.1).
Original comment by lowerlo...@gmail.com
on 21 May 2010 at 10:30
Original comment by lowerlo...@gmail.com
on 23 Jul 2010 at 9:58
Original issue reported on code.google.com by
gabriel....@gmail.com
on 31 Mar 2010 at 1:24Attachments: