Conversion: World <x,y,z> <==> Radar <x/8,y/8>
Indexing: World <x,y,z> ==> Radar[(y*width + x)/8]
(Note: The radar is 1/8 the resolution of the world map)
What I tried doing was spitting the radar to a text file, coordinate by coordinate, to see if it the coordinates were different than I expected. The result was somewhat stunning - on comet catcher and with only 2 comms in the game, I found 6 islands of non-zero (large, contiguous chunks) and various streaks of non-zero data values for a single player. When moving the radar source (commander), there was clearly a change in several of these islands in a similar direction, but not all of them. Below is essentially the radarmap transcribing code:
Code: Select all
int height = cb->GetMapHeight();
int width = cb->GetMapWidth ();
int cells = (height*width)/8;
const unsigned short *radar = cb->GetRadarMap();
ofstream output("radar.txt");
output << "Height = " << height << endl
<< "Width = " << width << endl
<< "Cells = " << cells << endl;
for(int a=0;a<cells;a++)
{
output << radar[a];
if(!(a%(width/8)) output << endl;
}
Edit: Figured it out. I was over-running the bounds of the array in a hardcore way. cells should be (height * width) / 64, not /8. I wonder what other array I was reading....