@Name said in Ancient Empires: 222 BC:
@redrum smallMap.unit.size=1 fixed most of it, looks like it was the units extending into other territories/seas. Now I need to edit smallmap a bit (small white dots revealed theirselves at points), and I guess there's no way for perfect borders at this scale.
The problem of too big small map units outboarding their zones into nearby ones (which you can test always happens in the case the small map unit is being drawn into a zone to the right and bottom of its own one, never to the left or top) is actually doubled up by the fact (there is also a similar problem for units zoom customization for the user) that those minimap units are drawn from an approximation of the actual coordinates where the units are drawn on the actual map, which is not the centre of the units themselves, but their top-left corner. What follows, from this, is that if the dimension of the quadrangulum, showing the unit on the small map, relative to the dimensions of the small map itself are bigger than the ratio between the actual map's units dimensions and the actual map's dimensions, then the true centre of those quadrangula will be more and more out of place, shifting to the right and down.
This can, and should, only be fixed at the engine level, as the engine should place those quadrangula on the minimap having their centres the closest possible where the centres of the respective units on the actual map are, not just drawing them from the top-left point coordinates, irrispectively of relative dimensions.
Assuming such a fix at the engine level is not coming, the only way, for mapmakers, to restrict such a distortion within less than a single pixel, is to approssimate the dimensions of the quadrangula on the minimap, following this formula:
"small map unit size"=("small map size"*"units scale"*"units size")/"map size"
Both with "small map size" (you need to look at the actual size of the smallMap image) and "map size" (values in map.properties), you can take either the width or the height for both (assuming the width/height ratio is, to the pixel, the same for the actual map and the minimap, as it should). If you use the width, this should maximize the centring of the small map units with respect to X, instead to Y for the height. You can also use the area, to obtain a geometric average between both. You cannot really exactly precise both coordinates for the minimap, as, for doing so, you would need being able to define small map quadrangula that are not perfect squares. However, as long as the map you are using has the same width and height for all images, you are perfectly fine here (and you are almost perfectly fine anyways, unless the map features images that have a width and height ratio very far from 1).
For example, if you take the current dimensions of "the_pact_of_steel"
https://github.com/triplea-maps/the_pact_of_steel/blob/master/map/map.properties#L100
this should be the "smallMap.unit.size", that the map should have, in order to have the centring of the small map units the closest to the position of the actual units on the map, at the default units zoom (doing it using the width for all sizes, as, anyways, the given units.width and units.height are the same, in this map):
smallMap.unit.size=(233*1*48)/3500=11184/3500=3.195...
Hence, the pact_of_steel map should better have this setting, in map.properties:
smallMap.unit.size=3
Instead, it currently has no setting. This means that it is going with the default 4 pixels settings (at least this is what I believe it is going to be, but I'm not a developer). Thus the quadrangula on the small map, representing the units on the actual map, are going to be about half a pixel more to the right and down than they should be, but, since here we are splitting the pixel, this matter is hardly noticeable at all. However, if you look very close at the "Pact of Steel" game minimap, you may see that the fighter and infantry in Norway, at start game, are relatively closer to Sweden on the minimap than they are on the actual map.
To clarify the matter, here it is a 400% zoomed image of the default "Pact of Steel" game minimap at start game (small map unit size is 4):

Here it is a 400% zoomed image of the "Pact of Steel" game minimap at start game, except only setting the small map unit size at 2:

As you can see, they are both drawn from the same top-left corner, which, as I said, implies that, at 4 pixels, their actual centre is too much bottom-right with respect to the map's units, while, at 2 pixels, their actual centre is too much top-left, with respect to the same units.
That is why, assuming no developers will ever fix this matter on the program itself (that is the program having minimap unit centred with respect to what they are relatively representing, instead of centring their top-left corner regardless), I would suggest mapmakers taking care to set the closest value for "smallMap.unit.size" as what you would get by using the formula I provided here. That would be also good in that the minimap units will look the closest in dimensions to the relative size of the units they are representing on the map (likely something one may easily argue the engine should infer too (I assume it doesn't, but I don't actually know, nor I can look at it, since I'm not a developer)), as that also matters in case you want to have a similar empty space or overlap between units in the small map as you have for the same units in the actual map (you can see that in the second image I posted it is much easier to tell how many unit types there are in each territory, while in the default small map they overlap a lot, making hard telling the various squares apart).