NP300
Prince
Hi all,
As has been pointed out in this thread, the AI cheats and can see far beyond what it is supposed to be able to see.
In the case of naval units, this cheating has long been very noticeable to me and breaks the illusion of an AI that plays by the same rules. It becomes annoying when the AI always seems to be able to find your ships, and always just happens to head right to them. In the case of land units, I have not found it to be very noticeable.
To correct this, I have been experimenting with a change in my Random Invisibility modcomp, which uses BetterBTSAI. I made the AI_searchRange to be based on visibilityRange(), as opposed to baseMoves().
Here is my code for the naval unit AI_searchRange:
And the original code:
It seems to work fairly well, and the illusion is no longer broken. Now my question is if this may be having any unintended consequences in other places. I wonder if this would prevent an AI sea unit from attacking a unit that the AI Civ can see, but which is outside of the particular unit's visibility range. For instance let's say there is a hostile French transport right by an English city; and let's further say the English have a destroyer 7 tiles away. The English can see the French transport, but this transport is outside of the destroyer's visibility range. Will my change in the code prevent the destroyer from attacking? Will it make any difference?
I looked in CvUnitAI.cpp and it appears that the settings for iRange range from 1 to 5. 3-5 seem to only be used for things like escorting settlers and evacuations. But iRange=2 does seem to be used to make attack decisions.
So for those who know the AI code well: Is my change having some significant unintended consequences? Thanks.
As has been pointed out in this thread, the AI cheats and can see far beyond what it is supposed to be able to see.
In the case of naval units, this cheating has long been very noticeable to me and breaks the illusion of an AI that plays by the same rules. It becomes annoying when the AI always seems to be able to find your ships, and always just happens to head right to them. In the case of land units, I have not found it to be very noticeable.
To correct this, I have been experimenting with a change in my Random Invisibility modcomp, which uses BetterBTSAI. I made the AI_searchRange to be based on visibilityRange(), as opposed to baseMoves().
Here is my code for the naval unit AI_searchRange:
Code:
return (iRange * visibilityRange());
And the original code:
Code:
return (iRange * baseMoves());
It seems to work fairly well, and the illusion is no longer broken. Now my question is if this may be having any unintended consequences in other places. I wonder if this would prevent an AI sea unit from attacking a unit that the AI Civ can see, but which is outside of the particular unit's visibility range. For instance let's say there is a hostile French transport right by an English city; and let's further say the English have a destroyer 7 tiles away. The English can see the French transport, but this transport is outside of the destroyer's visibility range. Will my change in the code prevent the destroyer from attacking? Will it make any difference?
I looked in CvUnitAI.cpp and it appears that the settings for iRange range from 1 to 5. 3-5 seem to only be used for things like escorting settlers and evacuations. But iRange=2 does seem to be used to make attack decisions.
So for those who know the AI code well: Is my change having some significant unintended consequences? Thanks.