[BtS] Navy AI

Okay, I went to check out the bombard AI in CvUnitAI::AI_seaBombardRange and found something I don't understand. In the meat of the function it's assigning values to different targets, here's the first part of the value code:

Code:
		int iValue = (AI_getUnitAIType() == UNITAI_ASSAULT_SEA) ? 0 : 1; 
		
		iValue += (kPlayer.AI_plotTargetMissionAIs(pBombardCity->plot(), MISSIONAI_ASSAULT, NULL, 2) * 3);
		iValue += (kPlayer.AI_adjacentPotentialAttackers(pBombardCity->plot(), true));
		
		if (iValue > 0)
		{
		     may potentially bombard this target ...

I get the second two lines, they make a lot of sense ... assign more value to a target that might actually be attacked. Very reasonable. The first line doesn't make sense to me ... if this unit is not running UNITAI_ASSAULT_SEA always give a value of 1 (ASSAULT_SEA is the AI for transports that run invasions).

First of all, are there any transport units in the game that can do bombardments?

Firstly, you have to account for mods which DO have transport ships which can do bombardments.

Secondly, I do not recall for sure, but some escort ships might get grouped in the transport selection group as protection. (I know there is also an escort type, but I do not recall if it is always used for transports). The other case is carriers and I believe either transports or carriers (or both) get regular fighting ships grouped in their selection group.

The problem with escort missions is that the ship may decide to go do something else, leaving the transport undefended (another problem to be solved)

-Iustus
 
Back
Top Bottom