I was intrigued by this metric that Civ4 employs, so just for my own interest I looked at it a bit more closely. Some of you might be interested.
If it weren't for the rounding due to forcing points onto the board's tiles, the points of equal distance (from origin) would give the following contours.
Note whenever we use the usual metric we're used to, we get circles as curves of equal distance instead of octagons (note the octagons are not regular). This Civ4 metric is used for other things in Civ4 like bomber/fighter range and calculating city distance costs. In general it is used for any notion of distance except for unit movement where stepDistance is used (as VoiceOfUnreason pointed out).
I wondered why it was exactly that the designers decided to use such an uncommon metric, but I thought it might be because the Euclidean metric gives a very large 2-tile radius, or perhaps because it covers slightly fewer tiles for each radius. The Euclidean (usual) metric in the following comparison is d((x1,x2),(y1,y2)) = floor(sqrt( (x1-x2)^2 + (y1-y2)^2 ) ). For each cell, the number inside is a measure of the distance from the cell with 0 in it (the origin).
Also, note the Civ4 metric
d((x1,x2),(y1,y2)) = floor( max(|x1-y1|,|x2-y2|) + 1/2 * min(|x1-y1|,|x2-y2|) ) (from earlier)
has an equivalent expression
| |x1-x2|-|y1-y2| | + floor( 1.5 * min(|x1-y1|,|x2-y2|) )
which I happen to prefer.
Spoiler :
If it weren't for the rounding due to forcing points onto the board's tiles, the points of equal distance (from origin) would give the following contours.
Note whenever we use the usual metric we're used to, we get circles as curves of equal distance instead of octagons (note the octagons are not regular). This Civ4 metric is used for other things in Civ4 like bomber/fighter range and calculating city distance costs. In general it is used for any notion of distance except for unit movement where stepDistance is used (as VoiceOfUnreason pointed out).
I wondered why it was exactly that the designers decided to use such an uncommon metric, but I thought it might be because the Euclidean metric gives a very large 2-tile radius, or perhaps because it covers slightly fewer tiles for each radius. The Euclidean (usual) metric in the following comparison is d((x1,x2),(y1,y2)) = floor(sqrt( (x1-x2)^2 + (y1-y2)^2 ) ). For each cell, the number inside is a measure of the distance from the cell with 0 in it (the origin).
Also, note the Civ4 metric
d((x1,x2),(y1,y2)) = floor( max(|x1-y1|,|x2-y2|) + 1/2 * min(|x1-y1|,|x2-y2|) ) (from earlier)
has an equivalent expression
| |x1-x2|-|y1-y2| | + floor( 1.5 * min(|x1-y1|,|x2-y2|) )
which I happen to prefer.