The top tribes and recent conquers should be separate, imo. Nickjer counted the number of villages and the points they were worth and ranked the tribes that way(by points) for the recent conquers, showing who was nobling more, which isn't always obvious from the map(nobling clusters, for example). This can't be done if the maps are combined, since the top ranked tribe in the world may not noble the most villages(and displaying the conquer stats would be difficult on the size allowed). Since you have to know which villages were taken recently to mark them on the map, making those stats shouldn't be too hard.
No, that isn't entirely true. He seperates them both, yes, but for the background villages he uses the toptribes image, but he uses an alpha channel for the toptribe villages, and no-alpha channel for the nobling.
With some text resizing, would it be possible to just display the actual point value on the maps? On the players, the number already displays below, so doing the same on the tribes shouldn't be too hard, and as long as no one hits a billion points, it should work out. As for the black on the side, would a white background with black-outlined text work? I wish I could find an old map of nickjer's that showed how he did the side area, but I don't seem to have any saved anywhere.
He uses a white box on the side, with a 30-pixel height box on top for the details of the map(date, time, what map, etc.). the box itself is 250 x 1000 pixels(widthxheight). As for the spacing he used...
[spoil]
PHP
$font1 = 10;
for ($i=0; $i<$numtribes; $i++) {
$xword = $nump + 90;
$yword = 25 + $i*55;
$xcolor = $nump + 15;
$ycolor = 20 + $i*55;
$width = $xcolor + 60;
$height = $ycolor + 30;
$number = number_format($points[$i]);
imagefilledrectangle($image,$xcolor-1,$ycolor-1,$width+1,$height+1,$charcoal);
imagefilledrectangle($image,$xcolor,$ycolor,$width,$height,$color[$toptribe[$i]]);
imagettftext($image, $font1, 0, $xword, $yword, $black, $fontfile2, $toptribe[$i]);
imagettftext($image, $font1, 0, $xword, $yword+15, $black, $fontfile2, $number." pts");
imagettftext($image, $font1, 0, $xword, $yword+30, $black, $fontfile2, $numvills[$i]." vills");
#imagettfstroketext($image,$font1,0,$xword,$yword,$white,$black,$fontfile,$toptribe[$i],1);
}
[/spoil]
For village outlines the outline gets villageX - 1, villageY - 1, villageX2 + 1, villageY2 + 1. To fix the zoom issue, I would recommend using your own zoom feature, rather than a function one. For example, what I did...
Calculate the lowest possible x coordinate from the village file and calculate: worldSize = (500 - (lowX / 100) * 100) * 2; You don't care about single village issues. You can set what the zoom is based upon the outcome of that. Personally I just use 100% for 500, 200% for 300, and 400% for anything else.
After that comes the fun stuff, first is figuring out the village's new coordinates, which goes like this:
[spoil]
C++
if (villageX.at(villages[topIndex].at(counter)) < 500)
xCoord = 500 - ((500 - ((villageX.at(villages[topIndex].at(counter)) / 100) * 100)) * zoom);
else
xCoord = 500 + ((((villageX.at(villages[topIndex].at(counter)) / 100) * 100) - 500) * zoom);
if (villageY.at(villages[topIndex].at(counter)) < 500)
yCoord = 500 - ((500 - ((villageY.at(villages[topIndex].at(counter)) / 100) * 100)) * zoom);
else
yCoord = 500 + ((((villageY.at(villages[topIndex].at(counter)) / 100) * 100) - 500) * zoom);
gdImageFilledRectangle(image, xCoord - 1, yCoord - 1, xCoord + zoom + 1, yCoord + zoom + 1, charcoal);
gdImageFilledRectangle(image, xCoord, yCoord, xCoord + zoom, yCoord + zoom, playerColors[count]);
[/spoil]
EDIT: After re-reading some old PHP code of mine, I understand that for a clearer image of the outlines on the villages, you first need to handle all the outlines for the first tribe, THEN do the color marker for each village after all outlines are done, to entire there are no strange outlines randomly running through markers, etc. Best way would probably be to run through and do the outlines and store the x and y of what you use in an array/vector(if you so choose to do it similar to myself).
Next is the k lines:
[spoil]
C++
for (int count = 0; count <= kLength * floor(worldLength); count += kLength)
{
gdImageLine(image, partialK * kLength + count, 30, partialK * kLength + count, kLength * worldLength + 30, kNumber);
gdImageLine(image, 0, partialK * worldLength + count + 30, kLength * worldLength, partialK * worldLength + count + 30, kNumber);
}
[/spoil]
And of course the k numbers themselves:
[spoil]
C++
for (unsigned _int8 xLine = floor((10 - worldLength - 1) / 2); xLine < 10 - ceil((10 - worldLength) / 10); xLine++) {
for (unsigned _int8 yLine = floor((10 - worldLength - 1) / 2); yLine < 10 - ceil((10 - worldLength) / 10); yLine++) {
itoa(yLine, kNum, 10);
itoa(xLine, kNum, 10);
x = 82 + (xLine - floor((10 - worldLength) / 2)) * kLength;
y = 98 + (yLine - floor((10 - worldLength) / 2)) * kLength;
gdImageStringFT(image, &brect[0], 0, "Arial-Black.ttf", 10, 0, x, y, kNum);
}
}
[/spoil]
And the calculation for most of the variables used are as such:
[spoil]
C++
float worldLength = 10 / zoom;
int wholeK, numK = 100, kLength = 100 * zoom, worldLengthFloor = floor(worldLength = 10 / zoom);
if (worldLengthFloor % 2 == 1)
wholeK = worldLengthFloor - 1;
else
wholeK = worldLengthFloor;
float partialK = (worldLength - wholeK) / 2;
[/spoil]
This should be able to handle all the zoom you should want to do, even different amounts then what I stated. Of course, you'd still get partial Ks as to what you have already, but it seems like people don't fully care about that anyways.
EDIT: The reason for the disappearing K lines is because of the resize function. It does not handle such thin lines nearly as well, and will ultimately cut some out.