Cover and defence vs cities

Alright, so it sounds like cover is still the way to go for those epic xbow wars. The one hit that a city gets per turn doesn't change much.

How are you getting that as a take-away from this thread? Cover only helps XBs versus great war bombers. Unfortunately, that is something I actually face a little too frequently, but is that what you mean?
 
How are you getting that as a take-away from this thread? Cover only helps XBs versus great war bombers. Unfortunately, that is something I actually face a little too frequently, but is that what you mean?

He said that cover works vs units. Just not vs city ranged attacks. Since getting hit by cities is like 5% of total damage in a big war, it's not a large concern. My xbows are usually being attacked by other xbows, knights and random crappy melee.
 
Who said that? The whole point of this thread is that cover only works as expected for melee units. It’s only use for ranged units is for defense against air units!

Yes cover works vs. units.
One thing that I think people are aware of but I'll make sure anyway is that the strength rating, the list of modifiers and the damage prediction are not all the same thing. Meaning you can only trust the damage prediction, the rest might not be correct. It's a bug but since it's only a display problem it's never fixed. It does however make real bugs like this cover vs. cities one hard to find.

Still confused...
 
So using ranged combat score for defense is how it was intended. I doubt they intended for cover to protect melee units from city attacks but not ranged units.

Okay, I understand you to be affirming that the cover promotion does not help ranged units.

Yes cover works vs. units.

Sorry, but this contradicts what you wrote just a few posts before!
 
So using ranged combat score for defense is how it was intended. I doubt they intended for cover to protect melee units from city attacks but not ranged units.


Okay, I understand you to be affirming that the cover promotion does not help ranged units.
No that's not what I'm affirming. I specifically said city attacks. Ranged units are not protected from city attacks by cover. I never said anything about cover not helping against attacks from units.

Yes cover works vs. units.
This is me addressing units, not cities.
Sorry, but this contradicts what you wrote just a few posts before!
Sorry Phoenix Wright, there is no contradiction. The only thing that doesn't work is a ranged unit using cover to defend from city attacks. I never said cover doesn't work with other units. It was asked if cover works with airplanes and it does. Planes are units. Cities are not units.
 
I never heard of Phoenix Wright before.

I never said cover doesn't work with other units.

Sorry for misunderstanding you, but I don’t think you were clear. In any case, I think you are mistaken about the cover promotion helping ranged units defend against other ranged units. That is not consistent with what others have reported on this thread, nor with my subjective experience. I have not tested myself, but the cover promotion certainly does not feel like it has ever helped my ranged units (not against cities, and not against other ranged units).

It was asked if cover works with airplanes and it does. Planes are units.

The benefit of cover to melee units is readily apparent in play. I only just started paying attention to the cover promotion for ranged units against bombers, but with just one game, the benefit is quite noticeable.
 
In any case, I think you are mistaken about the cover promotion helping ranged units defend against other ranged units. That is not consistent with what others have reported on this thread, nor with my subjective experience. I have not tested myself, but the cover promotion certainly does not feel like it has ever helped my ranged units (not against cities, and not against other ranged units).
I think you're mistaken that I am mistaken.
I created a map just for these tests. A city with an archer and a bomber, surrounded by enemy units of different types and different promotions to shoot at.

My archer firing at an archer with no cover promotion shows a damage prediction of 29 and the actual attack it did was 26 damage.

My archer firing at an archer with both cover promotions shows a prediction of 21 damage and actual damage of 18.

A difference of 8 damage using cover.

I saved and reloaded so it was the same random seed for both. The results were very clear. Ranged vs. ranged, more cover promotions, less damage.
Now I don't know why others are getting something different. Are they getting different damage or just different strength ratings? Because the strength rating it shows isn't the one it calculates damage from.
 
I hope that is the case! Hopefully Thorak and Talamare will come back to this thread and figure out what is going on with your conflicting results. Perhaps they were not as careful as you?

Maybe I was unclear but I never tested if cover worked vs archers/siege units only vs cities. Reason is that for me taking cities is the tough part while killing units is easy so I wanted to know how to take less damage from cities. If cover doesn't work vs cities (which is true except for melee) then for me it doesn't matter if cover works vs archers/siege units/ships as it isn't worth to take cover only for that IMO. I almost never lose units except when attacking a city...
 
OK. I have a fix for ranged units not getting cover promotion or terrain defense bonuses when attacked by cities.

My solution was to change it so city attacks against a ranged unit use it's regular strength rating. That way cover promotions and terrain defense will apply. Since most ranged units have higher ranged strength this means more damage from cities to ranged units unless they have cover or terrain bonuses. Since siege have ranged attack that is closer to their melee strength rating compared to other ranged units, this means pre-industrial siege units will take comparatively less damage than ranged units of the same era. After that archers are now machine guns and have the same strength for both and siege has 3 range so it no longer matters.

Here's the new code
Code:
int CvCity::rangeCombatUnitDefense(const CvUnit* pDefender) const
{
	int iDefenderStrength = 0;

	// Use Ranged combat value for defender, UNLESS it's a boat
	if (pDefender->isEmbarked())
	{
		iDefenderStrength = pDefender->GetEmbarkedUnitDefense();;
	}
		//M.A. City v Ranged fix mod start

	//else if(!pDefender->isRangedSupportFire() && !pDefender->getDomainType() == DOMAIN_SEA && pDefender->GetMaxRangedCombatStrength(NULL, /*pCity*/ NULL, false, false) > 0)
	//{
	//	iDefenderStrength = pDefender->GetMaxRangedCombatStrength(NULL, /*pCity*/ NULL, false, false);

	//	// Ranged units take less damage from one another
	//	iDefenderStrength *= /*125*/ GC.getRANGE_ATTACK_RANGED_DEFENDER_MOD();
	//	iDefenderStrength /= 100;
	//}
	else
	{
		iDefenderStrength = pDefender->GetMaxDefenseStrength(pDefender->plot(), NULL, /*bFromRangedAttack*/ true);
		if (pDefender->GetMaxRangedCombatStrength(NULL, /*pCity*/ NULL, false, false) > 0)
		{
			// Ranged units take less damage from one another
			iDefenderStrength *= /*125*/ GC.getRANGE_ATTACK_RANGED_DEFENDER_MOD();
			iDefenderStrength /= 100;
		}//M.A. City v Ranged fix mod end
	}

	return iDefenderStrength;
}
Their may be a better way to fix this but this is the only way I know of that will allow ranged units to use cover promotions and terrain when a city attacks.
 
Minor already predicted my probable error, I was inspecting the strength output.
Which seems to be bugged in itself as a display error, I have no intention of running the tests again since they are fairly tedious to do.

I respect and acknowledge Minors improved conclusion, well done :goodjob:
 
Back
Top Bottom