jdog5000
Revolutionary
Some good points glider, I agree with you that in terms of effect either B or what I proposed for C make the most sense. Here's my take on how they would be different:
Current -
City X considers city Y to be close if they're within 6 or 7 squares and the closeness measure is higher if Y has a higher population. As Yakk said, for player or team 1 their closeness measure to 2 is actually the measure of how close 2's cities are to 2's cities (this is the bug). Because of this bug, player/team 3 (and all other players) will have the same closeness measure to 2 as 1 does.
Fix A -
City closeness is the same as before. For player/team 1, they would consider player 2 close if 1 has a city of any size near large cities owned by 2.
Fix B -
City closeness is the same as before. For player/team 1, they would consider player 2 close if 2 has a city of any size near large cities owned by 1.
Fix C -
The city closeness measure would be highest when X and Y both have high populations, lowest if both are small. X's closeness to Y would be the same as Y's closeness to X (unless one is owned by barbs ...). Because of this, it doesn't much matter whether summing is done like Fix A or B except in the case of barbs where I think it points to summing as in Fix B.
In terms of how these would effect other parts of the game, here's what I can see:
CvCityAI::AI_cityThreat - (determines how "threatened" a city feels, used to compute whether the city needs extra defenders nearby)
Right now, a city feels more threatened if the cities around it are larger. Since it's just city based, current performance would be unaffected by Fix A or B (which only change how CvPlayerAI and CvTeamAI are computed). Fix C would change this so that a larger city would feel more threatened by other cities than a smaller city would.
CvPlayerAI::AI_conquerCity - (decide whether to raze a conquered city)
The closeness of a conquered city to the rest of the player's empire lowers the odds that it will be razed. Again, this just uses CvCityAI::AI_playerCloseness so it is unaffected by Fix A or B. For Fix C a player would be a bit less likely to raze a large city close to small cities in their empire and a bit less hesitant to raze small cities near large cities in their empire. The change here looks to be quite small in magnitude.
CvPlayerAI::AI_getStrategyHash - (determine which strategies a player follows)
CvTeam::AI_teamCloseness used for Crush strategy, but this only checks if closeness is > 0. I believe since it's just > 0, Fixes A, B, and C will all be equivalent and different than the current bugged method which is never 0 (can't not be close to yourself). Also used for the Peace strategy which is not actually implemented, so no real effect there.
CvTeamAI::AI_startWarVal - (used to pick which other team to declare war on)
The current method effectively uses the other team's self-closeness, so a target with many large, tight cities would be more appealing than a small or spread out empire regardless of how close they are to the attacker. Any of the fixes is a significant change from the current function, definitely dwarfing any difference between the fixes. That said, fix A would cause the AI to more often pick war against a player when the AI has a city (of any size) near big cities owned by the other player. For B it would be the reverse, the AI would attack a player who has a city near large cities that it owns. C is a middle ground, where war is most likely against the player with the most large cities near the larger cities of the AI's empire.
So, as you can see Fix C affects a couple of CvCityAI functions that the others do not ... it certainly is not purely a bug fix in that regard. That said, these extra effects would not be that large really and also seem entirely reasonable to me.
The real difference between the fixes is in choosing war victims, I would say we should pick a fix based on what makes the most sense for the AI in this regard. Based on the understanding I've described here I would order them C > B > A, but I look forward to hearing what the rest of you think.
Current -
City X considers city Y to be close if they're within 6 or 7 squares and the closeness measure is higher if Y has a higher population. As Yakk said, for player or team 1 their closeness measure to 2 is actually the measure of how close 2's cities are to 2's cities (this is the bug). Because of this bug, player/team 3 (and all other players) will have the same closeness measure to 2 as 1 does.
Fix A -
City closeness is the same as before. For player/team 1, they would consider player 2 close if 1 has a city of any size near large cities owned by 2.
Fix B -
City closeness is the same as before. For player/team 1, they would consider player 2 close if 2 has a city of any size near large cities owned by 1.
Fix C -
The city closeness measure would be highest when X and Y both have high populations, lowest if both are small. X's closeness to Y would be the same as Y's closeness to X (unless one is owned by barbs ...). Because of this, it doesn't much matter whether summing is done like Fix A or B except in the case of barbs where I think it points to summing as in Fix B.
In terms of how these would effect other parts of the game, here's what I can see:
CvCityAI::AI_cityThreat - (determines how "threatened" a city feels, used to compute whether the city needs extra defenders nearby)
Right now, a city feels more threatened if the cities around it are larger. Since it's just city based, current performance would be unaffected by Fix A or B (which only change how CvPlayerAI and CvTeamAI are computed). Fix C would change this so that a larger city would feel more threatened by other cities than a smaller city would.
CvPlayerAI::AI_conquerCity - (decide whether to raze a conquered city)
The closeness of a conquered city to the rest of the player's empire lowers the odds that it will be razed. Again, this just uses CvCityAI::AI_playerCloseness so it is unaffected by Fix A or B. For Fix C a player would be a bit less likely to raze a large city close to small cities in their empire and a bit less hesitant to raze small cities near large cities in their empire. The change here looks to be quite small in magnitude.
CvPlayerAI::AI_getStrategyHash - (determine which strategies a player follows)
CvTeam::AI_teamCloseness used for Crush strategy, but this only checks if closeness is > 0. I believe since it's just > 0, Fixes A, B, and C will all be equivalent and different than the current bugged method which is never 0 (can't not be close to yourself). Also used for the Peace strategy which is not actually implemented, so no real effect there.
CvTeamAI::AI_startWarVal - (used to pick which other team to declare war on)
The current method effectively uses the other team's self-closeness, so a target with many large, tight cities would be more appealing than a small or spread out empire regardless of how close they are to the attacker. Any of the fixes is a significant change from the current function, definitely dwarfing any difference between the fixes. That said, fix A would cause the AI to more often pick war against a player when the AI has a city (of any size) near big cities owned by the other player. For B it would be the reverse, the AI would attack a player who has a city near large cities that it owns. C is a middle ground, where war is most likely against the player with the most large cities near the larger cities of the AI's empire.
So, as you can see Fix C affects a couple of CvCityAI functions that the others do not ... it certainly is not purely a bug fix in that regard. That said, these extra effects would not be that large really and also seem entirely reasonable to me.
The real difference between the fixes is in choosing war victims, I would say we should pick a fix based on what makes the most sense for the AI in this regard. Based on the understanding I've described here I would order them C > B > A, but I look forward to hearing what the rest of you think.