What now confuses me until I try to read the code further is how we are getting not all units that bombard having their bombard ability reduced to nothing, no matter how 'strong' their bombard ability actually is. It makes me wonder if there's some kind of 'counter' like a 'puncture' that works from the unit to reduce the defense itself when encountered. It would be helpful to identify what that unit 'ability' is tagged as.
Do you mean, that for example my ballista elephant which had 5% bombing strength done no damage, but arsonist, which had to 5%, reduced the defense quite well? Or that, that those units with high bombing strength perform some damage or those with low do nothing?
I could take a look at the code but I'm working on some other things here and every time I've looked into bombarding to try to understand it I come up with the opinion that its terribly overcomplicated
Doesn't look so horrible, I've seen much worse. Maybe it was reorganized.

However, the code responsible for reducing city defense is quite amazing.
As stated above, perhaps its that the strength of bombings gets around defense differently by a less visible variable on particular units.
No, I was wrong. I thought the the protection against defense reduction was the value below which you can't reduce the defense. Like you can't reduce it with bombing below 10% (btw is it some const, or it si given by some building)
I'd actually suggest to put it at 95% for now. HOWEVER, what I'd REALLY like to do is NOT change it all that much. Instead, I'd like to make it have a diminishing return mechanism applied to it. A while back, ls612 and I put a diminishing return (not sure if we completed this project) on withdrawal and I came up with an idea as to how we could generate this sort of thing on any value quite easily. I think the total Bombard Defense should apply to a diminishing return.
What this would mean is that after it exceeds 50%, the next points thereafter are half as valuable. So it takes a total of 100% to reach 75%. At that point, the value of additional points is 1/2 again (1/4) as valuable. Thus you reach something like 87(.5) with 150%. Then the next 50 pts are half again as valuable. Thus the next 50 pts gets you to 93.75 (reached at 200%) and it continues as such, never actually reaching 100% until fractions of a point over 99% make it impossible not to at an astronomically high actual % pt value.
(Please define multiplicative in this context. I'm not quite following you on that. Surprisingly enough, I'm not well educated on mathematical terminology but have been learning a lot here in that realm.)
This diminished return (strange name) is a little bit like multiplicative aggregation of a bonus. I think an example will be the best explain.
Lets have some buildings with the bombard defense bonus in a city (values are my imagination): walls (10%), high walls (20%) and castle (25%). Then we perform a bombardment with a siege ram (20% of bombardment strength). The attack hits the city and is firstly reduced by the castle (20 - 20*25% = 15), then what is left is reduced by the high walls (15 - 15*20% = 12) and then what is left is reduced by the walls (12 - 12*10% = 10.8). Now when we transform a little those evaluations we get the result to be 10.8 = 20(100%-25%)(100%-20%)(100%-10%).
This too can't reduce the bombing strength totally to 0, if only bombard defense bonuses are < 100%.
Still the problem is, what if the strength of bombardment is reduced to something like 0.9, which will be downgraded by the integer arithmetic to 0.
@
Koshling, if you have few minutes, can you tell me, what is this?
Code:
void CvCity::changeDefenseModifier(int iChange)
{
if (iChange != 0)
{
int iTotalDefense = getTotalDefense(false);
if (iTotalDefense > 0)
{
changeDefenseDamage(-(GC.getMAX_CITY_DEFENSE_DAMAGE() * iChange + (iChange > 0 ? iTotalDefense : -iTotalDefense)/2) / iTotalDefense);
}
}
}
This method is used by the bombardment. But I can not see, how can this work correctly. GC.getMAX_CITY_DEFENSE_DAMAGE() is set in the xml to 100, so for a siege ram and a city with defense 50%, we get changeDefenseDamage(40).
And one important thing, how to compile this thing?
C2C (VS 2010).sln points to
C2C (VS 2008).vcxproj, that does not exists and after changing it to
C2C (VS 2010).vcproj, the VS 2012 can't cope the project file. Is
C2C (VS 2008).vcproj up to data? I can also try to move it to Qt, but don't know does it have some dependent code.