Cannons are too weak against musketeers?

Finished (teamless)
Post Reply
User avatar
CedricD
Member
Posts: 22
Joined: Thu Jan 01, 1970 12:00 am

Cannons are too weak against musketeers?

Post by CedricD »

I've just attacked with 4 cannons (one Veteran) against musketeers in city on Plains with City Walls, without river. All 4 failed.
Attack was from Fortress in nearby tile to city (no movement penalty).
From the formula, assuming musketeers are veterans, def should be 3 * 3 * 1.5 = 13.5
Attack for cannons should be 8 * 2 = 16.

Why was it happened? Could someone check in log which was actual attack/def rate? Maybe cannon's "Gets double firepower when attacking cities" is turned off?
User avatar
HanduMan
Member
Posts: 115
Joined: Thu Jan 01, 1970 12:00 am

Post by HanduMan »

It's not quite that simple. See http://freeciv.wikia.com/wiki/Math_of_Freeciv (scroll down for Probability of winning a fight).
User avatar
CedricD
Member
Posts: 22
Joined: Thu Jan 01, 1970 12:00 am

Post by CedricD »

All my hopes was put to "Gets double firepower when attacking cities" string in help, which should give 16 attack even with firepower=1.
My opponent told that his musketeers were maximum vet2, so they had 9*1.75=15.75 def.
So, the question is open: either I had extremely bad luck today, or "2x firepower against cities" is not true.
If latter, then any offensive is useless at the same epoch, only unexpected 1-turn massive attack may succeed :(

Does anybody know if fight were logged somewhere with actual firepowers?
And I think, it would be good to log real attack/defence/hitpoint of every fight in message window, to explain suspicions like that.
User avatar
mmm2
Member
Posts: 155
Joined: Thu Jan 01, 1970 12:00 am

Post by mmm2 »

CedricD wrote:All my hopes was put to "Gets double firepower when attacking cities" string in help, which should give 16 attack even with firepower=1.
My opponent told that his musketeers were maximum vet2, so they had 9*1.75=15.75 def.
So, the question is open: either I had extremely bad luck today, or "2x firepower against cities" is not true.
If latter, then any offensive is useless at the same epoch, only unexpected 1-turn massive attack may succeed :(

Does anybody know if fight were logged somewhere with actual firepowers?
And I think, it would be good to log real attack/defence/hitpoint of every fight in message window, to explain suspicions like that.
forget about the other stuff I wrote... I guess the city must have been size 8+? Then it would get another *1.5 bonus.. defender would have 20.5. Your 8X attacker would have 28% chance of winning each round and have to put 10 hits. Defender would have 72% chance of winning each round and have to put 20 hits. It should be something like 45% probability for your unit to win battle...
User avatar
CedricD
Member
Posts: 22
Joined: Thu Jan 01, 1970 12:00 am

Post by CedricD »

Nope, the size of city is 6
User avatar
HanduMan
Member
Posts: 115
Joined: Thu Jan 01, 1970 12:00 am

Post by HanduMan »

I did some research on this subject and the executive summary says: "You just had the crappiest of luck, sorry" and "Yes, Cannons get double firepower when attacking cities".

So I created a scenario based on the specifications presented in this thread.
The city is on plains, no river, size 6, has City Walls. It is defended by four musketeer units, two of which are level 1 veterans and the other two level 2 veterans.
Adjacent to the city is an enemy fortress, occupied by for Cannon units, one of them is level 1 veteran, the others are green.
I made five test attacks, always starting with the veteran Cannon. The results can be seen at the bottom of this message.

The combat strengths of each type of unit are:
Musketeers (v2): 20 HP, firepower 1, defense 3 + 2.25 (veterancy) + 2.625 (city 5.25*0.5)) + 5.25 (city walls) = 13.125
Musketeers (v1): 20 HP, firepower 1, defense 3 + 1.5 (veterancy) + 2.25 (city 4.5*0.5) + 4.5 (city walls) = 11.25
Cannon (v1): 20 HP, firepower 1 + 1 (citybuster) = 2, attack 8 + 4 (veterancy) = 12
Cannon (green): 20 HP, firepower 1 + 1 (citybuster) = 2, attack 8

Please note, that the citybuster flag does not double the attack strength but firepower as it says.

As explained in http://freeciv.wikia.com/wiki/Combat#Combat_Mechanics a veteran Cannon has 12/25.125 (48%) chance to inflict damage to v2 Musketeers on each round of violence.
A green Cannon's odds against v2 Musketeers are 8/21.125 (32%) and against v1 Musketeers 8/19.25 (42%). So the Musketeers may get to do some damage more often but the Cannons do more damage when they get the chance.
The double firepower thingy really kicks in as seen in the test results where a green Cannon attacks a v2 Musketeers with only 32% chance to inflict damage. The Cannon succeeded in 3 out of 5 attempts. That is because the Cannon only needs 10 successful rounds to kill the Musketeers, whereas the Musketeers need 20 to do the opposite.
So the odds are just a little bit on the Cannons' side there I think. Not too much which is a good thing in my opinion. It would be boring if a Cannon was sure to always defeat any Musketeers behind City Walls.

Test results:

T0160:
Cannon(v) attacks, Musketeers(v2) defends, Cannon survives with 9/20 HP, gains v2
Cannon() attacks, Musketeers(v2) defends, Musketeers survive with 6/20 HP, gain v3
Cannon() attacks, Musketeers(v) defends, Musketeers survive with 2/20 HP
Cannon() attacks, Musketeers(v) defends, Musketeers survive with 8/20 HP

T0161:
Cannon(v) attacks, Musketeers(v2) defends, Cannon survives with 9/20 HP
Cannon() attacks, Musketeers(v2) defends, Musketeers survive with 8/20 HP
Cannon() attacks, Musketeers(v) defends, Cannon survives with with 2/20 HP
Cannon() attacks, Musketeers(v) defends, Musketeers survive with 14/20 HP, gain v2

T0162:
Cannon(v) attacks, Musketeers(v2) defends, Cannon survives with 1/20 HP
Cannon() attacks, Musketeers(v2) defends, Cannon survives with 1/20 HP
Cannon() attacks, Musketeers(v) defends, Musketeers survive with with 6/20 HP
Cannon() attacks, Musketeers(v) defends, Musketeers survive with 14/20 HP

T0163:
Cannon(v) attacks, Musketeers(v2) defends, Cannon survives with 6/20 HP, gains v2
Cannon() attacks, Musketeers(v2) defends, Cannon survives with 4/20 HP
Cannon() attacks, Musketeers(v) defends, Cannon survives with with 3/20 HP
Cannon() attacks, Musketeers(v) defends, Musketeers survive with 6/20 HP, gain v2

T0164:
Cannon(v) attacks, Musketeers(v2) defends, Cannon survives with 11/20 HP
Cannon() attacks, Musketeers(v2) defends, Cannon survives with 6/20 HP, gains v
Cannon() attacks, Musketeers(v) defends, Musketeers survive with with 4/20 HP
Cannon() attacks, Musketeers(v) defends, Cannon survives with 8/20 HP
Corbeau
Member
Posts: 990
Joined: Thu Jan 01, 1970 12:00 am

Post by Corbeau »

HanduMan wrote:So I created a scenario based on the specifications presented in this thread.
"specifications presented in this thread" does not presume that the ruleset was correct.
User avatar
HanduMan
Member
Posts: 115
Joined: Thu Jan 01, 1970 12:00 am

Post by HanduMan »

Corbeau wrote:
HanduMan wrote:So I created a scenario based on the specifications presented in this thread.
"specifications presented in this thread" does not presume that the ruleset was correct.
Really? The OP started with "I've just attacked with 4 cannons..." and since this thread is in LT34 section of these forums and the OP is a player in that game I naturally assumed we were talking about LT34 ruleset.

Of course I created the scenarion on LT34 ruleset as you could easily see by looking at the unit combat strength calculations.
User avatar
CedricD
Member
Posts: 22
Joined: Thu Jan 01, 1970 12:00 am

Post by CedricD »

Thanks Handu!

Now I have suspicion, is there "CityBuster" really turned on for Cannons.
As argument, look at Cannon's description:
* Will be built as a veteran in cities with appropriate training facilities (see Barracks). - it IS NOT TRUE
* Gets double firepower when attacking cities. - maybe IT IS NOT TRUE also?

Maybe, game-creator which don't like Cannons removed BOTH settings?
How can we check this? Is there local ruleset stored somewhere at computer's disk?
Or can we download ruleset from this site?
If not, Wieder, can you post the ruleset?

It may look as disbalance.. No measures to take a prepared city on plains (no even dream for city on hills/river).
Maybe, it is good that weak nation may easily defend against brute offensive...
But this stimulates only for unexpected massive attacks to unpredicted city...
User avatar
HanduMan
Member
Posts: 115
Joined: Thu Jan 01, 1970 12:00 am

Post by HanduMan »

I thought I made it clear that the citybuster really is on for Cannons. Otherwise they would not stand a chance against Musketeers behind City Walls.
The "built as veterans" text may be something that appears for all units that can gain veterancy. As you know, Cannon can do that through battle. If you look at the help text for Workers, youll find it there too. Along with "May be promoted after defeating an enemy unit." Being promoted after some hard work is not mentioned. These texts come from the game engine according to the ruleset definitions. If a unit is not flagged with "NoVeteran" the help text will say that they can be built and promoted as veterans whether or not they actually can be built as ones. The bug is in the game's help text generator, not in the ruleset.

You'll find the ruleset here: https://github.com/longturn/games/tree/master/LT34

Both CityBuster and Veteran_Build are ruleset dependent things. So they can be checked in the ruleset files.
User avatar
CedricD
Member
Posts: 22
Joined: Thu Jan 01, 1970 12:00 am

Post by CedricD »

Ok, I accept my bad luck :) Truly said, my fourth cannon was not full health (some 75%).
Now, I know that firepower parameter gives less bonus than I expected (not 2x to attack), thanks for explanation!
User avatar
CedricD
Member
Posts: 22
Joined: Thu Jan 01, 1970 12:00 am

Post by CedricD »

I've looked to source and calculated real defence bonus (I've found additional 50 city bonus in ruleset, plus 50 when city size >8):

Def =
3 (Musketeer)
x1.75 (V2)
x(100 + [effect_city_walls]=100 + [effect_city_defense_0]=50) / 100 = x2.5
x1.5 (in city or fortified)
= 19.69

So, params are AS=8, AHP=20, AFP=2, DS=19.69, DHP=20, DFP=1

Putting these into win_chance() function, I've got win chances:
CannonV1 vs MusketeersV2 = 71%

also:

Cannon vs MusketeersV2 = 32%
CavalryV1 vs MusketeersV2 = 6% (no CityBuster flag)
Artillery vs MusketeersV2 = 53%
Howitzer vs MusketeersV2 = 96%
Frigate vs MusketeersV2 = 2% (no CityBuster flag, no "defend" bonuses)
Battleship vs MusketeersV2 = 99% (no CityBuster flag, no "defend" bonuses)

Cannon vs RiflemenV2 = 12%
Artillery vs RiflemenV2 = 26%
Armor vs RiflemenV2 = 31%
Howitzer vs RiflemenV2 = 82%
Battleship vs RiflemenV2 = 99% (no CityBuster flag, no "defend" bonuses)

That's it...
Last edited by CedricD on Mon Apr 27, 2015 11:16 pm, edited 1 time in total.
User avatar
CedricD
Member
Posts: 22
Joined: Thu Jan 01, 1970 12:00 am

Post by CedricD »

Now I can calculate winrates for someone if needed :)
Wow :)
User avatar
HanduMan
Member
Posts: 115
Joined: Thu Jan 01, 1970 12:00 am

Post by HanduMan »

CedricD wrote:I've looked to source and calculated real defence bonus (I've found additional 50 city bonus in ruleset, plus 50 when city size >8):

Def =
3 (Musketeer)
x1.75 (V2)
x(100 + [effect_city_walls]=100 + [effect_city_defense_0]=50) / 100 = x2.5
x1.5 (in city or fortified)
= 19.69
So there is a hardcoded x1.5 multiplier for 'in city or fortified'? And it multiplies the result after all other effects have been evaluated?

WOW! :o
Last edited by HanduMan on Tue Apr 28, 2015 5:22 am, edited 1 time in total.
User avatar
CedricD
Member
Posts: 22
Joined: Thu Jan 01, 1970 12:00 am

Post by CedricD »

Yes, there are following lines at the end of combat.c/defense_multiplication() function:

if ((pcity || fortified)
&& uclass_has_flag(utype_class(def_type), UCF_CAN_FORTIFY)) {
defensepower = (defensepower * 3) / 2;
}

So actually, this bonus applied only to units able to fortify, i.e. Land, BigLand and Siege only.
Post Reply