User avatar
JacquesDeLalaing
Colonel
Posts: 344
Joined: Tue Mar 09, 2010 11:05 pm
Location: Vienna (Austria)

Minimum Hitchance in Fire Combat cap? (capped at TQ?)

Fri Apr 18, 2014 10:02 pm

I'm still modding very happily (RoP)! I've even modded in the Jablunka-Pass from Hungary to Moravia, and I've got turn-intervalls of 7 days (and everything adjusted to it ;) ).

But I've run into the problem that I can't seem to make light units "immune" in (fire)combat. I've increased their protection value to the maximum 10 (also tried 9), and the cbtMinToHit in Settings is set to 1, but still enemy elements have hitchances of 5-7% according to the battlelog (terrain/weather influences are eliminated; also cbtProtCoef is left at 90). The final hitchance is always 5.00, 6.00, 7.00%. As these perfect values seem suspicious: is the minimum hitchance somehow linked to the troop quality of the firer? E.g. does an element with TQ 7 always have a minimum hitchance of 7%? Or is there any other reason I can't see?



PS: And I have a second question: Sometimes single hussar units that happen to stumble into a giant enemy stack get totally eliminated. I always wonder why, since the retreat parameters should allow them an easy retreat. And then I check the battlelog just to notice that either there wasn't even a check for the hussars (if they want to retreat - i.e. the part that I've cited below simply doesn't show up in the battle log), or the log looks like this:

22:46:36 (Reporting) GiveGroupsTargets 1000515 Kavallerie initiating fight against faction 1000002 engaging: 1001504 Frei-Compagnie
22:46:36 (Reporting) Checking combat stance for Prussia in region 251 Glogau
22:46:36 (Reporting) Preliminary test: No need to retreat from this battle: OppPower: 132 FacPower: 962 .
22:46:36 (Reporting) Checking combat stance for Austria in region 251 Glogau
22:46:36 (Reporting) InCS %: 0 New Retreat Will %: 0
22:46:36 (Reporting) Ammo %: 100 New Retreat Will %: 0
22:46:36 (Reporting) Weighted average of Trench levels: 0
22:46:36 (Reporting) [color="#FF0000"] Power of opponents compared to us: 728.79 % Base Retreat Will: 0.00 %[/color]
22:46:36 (Reporting) Dice rolled: 27
22:46:36 (Reporting) => We want to stay in battle


Is there some cap so that a unit that is out-powered too much gets a retreat will of 0? (The ROE-retreat settings in this case should have given the hussars 100% of their ordinary retreat will)
[CENTER][color="#A52A2A"] S I L E S I A I N R U P T A[/color]
- a work-in-progress mod for Rise of Prussia - [/CENTER]

User avatar
JacquesDeLalaing
Colonel
Posts: 344
Joined: Tue Mar 09, 2010 11:05 pm
Location: Vienna (Austria)

Sat Apr 19, 2014 9:46 am

Just some thoughts why I'm even attempting to make light units "immune":

The fact that all elements that are allowed to fight in a certain terrain/weather search an enemy element to attack each round, regardless of whether the target-element has already been attacked, is very bad for smaller stacks and leads to rather implausible results. In the game, 3 elements can be theoretically attacked by 200+ elements in a single round of combat. Now I'd like to see how 200 companies manage to shoot at and assault a single company within an hour. Naturally, this mechanism is death to any smaller force that has not retreated and thus is a major concern if one thinks about detachement warfare and small war, which was common practice at that time. It gives greater stacks a lot of fatal advantages.

Even though it's quite futile to be discussed since this aspect touches the very core mechanics/code of the battle engine, I'd say that ideally-utopically, the opponent who brings the greater number of elements to a battle should only be allowed to use a frontage of:

the opponents' frontage*coefficient (e.g. 110%) + bonus for his C-in-Cs ratings (or even better: stack leaders ratings)

So, I'd base the frontage (number of elements that you're allowed to bring to battle) on the number of elements that the outnumbered opponent brings, but not on weather/terrain, which could still influence the maximum total number of elements allowed. One could even imagine if/how corps could work in this setting (e.g. if you're engaging with a force organized in two stacks instead of one, you might get a bonus frontage, since you're manoevering "around" the enemy...).

Of course the more numerous opponent will still have the advantage due to the rotation of elements. But for this the battle needs to last more rounds, which gives smaller stacks a chance to retreat (unless routed, a side always checks in between rounds of combat). Therefore, one could model "ambushes" very well in this setting – one round of combat only would mean that you're only fighting as many elements of the enemy as you bring yourself, and then, before rotation sets in, retreat before a more numerous opponent. Naturally, only light troops should be able to conduct this kind of engagement due to their retreat-parameters, while regular troops would suffer retreat casualties.

Right now, I'm trying to mod "around" this problem, but I'm still at the start. My latest idea was to reduce frontage drastically for all terrain/weather types (and no more clear terrain- / leader-frontage boni any more), and to compensate by increasing the number of battlerounds/hours per day (the battle report still only shows 6 rounds, but the pros look at the battlelog anyway ;) ), increasing damage output of "regular" (i.e. non-light) troops significantly. And I gotta say it seems to work really very nicely so far, with light troops capable of engaging larger forces, inflicting some damage before retreating (suffering some hits if the enemy has lots of cav). But I'd still be very happy about that "protection"-issue to fine tune small war.
[CENTER][color="#A52A2A"] S I L E S I A I N R U P T A[/color]

- a work-in-progress mod for Rise of Prussia - [/CENTER]

User avatar
Pocus
Posts: 25662
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Tue Apr 22, 2014 10:12 am

This 0% retreat will is indeed weird. I can look at it if you manage to reproduce it in an unmodded game.

As for the targetting, have you tried playing with combat signature? This won't do good if there is only light elements, but if there is a mix, the light ones can be targeted less often with a small signature.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
JacquesDeLalaing
Colonel
Posts: 344
Joined: Tue Mar 09, 2010 11:05 pm
Location: Vienna (Austria)

Tue Apr 22, 2014 12:13 pm

I think that the retreat-will might indeed have been my fault (I picked the wrong ROE - or rather I need to set all ROEs to at least 1% retreat will). Sorry for that! What a rookie-mistake!

The protection issue, however, is still real. Combat signature does unfortunately not solve my specific issue because for small-war-purposes I'm concerned with stacks that consist of light troops exclusively. I don't want to have small stacks of light troops suffer so much when they're outnumbered, and protection seems to be almost the only remedy for that - apart from my "special solution" (more hours/rounds of battle, but at the same time very very small frontage; So only a few elements get to attack outnumbered elements before they retreat) that still needs protection in order to work as intended. I will be able to do some more testing tomorrow, to find out 1) whether I have made some mistake here as well (I don't think I can really break the basic mechanism via modding - cbtProtCoef is left at 90), 2) whether this occurs with smaller protection values as well, and 3) whether terrain-protection works any better than unit-protection. I'm going to post my results and battlelog-extracts tomorrow evening.
[CENTER][color="#A52A2A"] S I L E S I A I N R U P T A[/color]

- a work-in-progress mod for Rise of Prussia - [/CENTER]

User avatar
Pocus
Posts: 25662
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Tue Apr 22, 2014 2:03 pm

We handle that by having regular very bad in deployment in difficult terrains (few can fight), with the intent of letting light troops die if they get caught in open terrain. BOA & WIA are handling asymmetrical warfare like this. I reckon that having a max number of elements allowed to attack a given element, per combat round, could have its use, but this is probably a significant work at this stage of the engine.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
JacquesDeLalaing
Colonel
Posts: 344
Joined: Tue Mar 09, 2010 11:05 pm
Location: Vienna (Austria)

Wed Apr 23, 2014 4:09 pm

I bow to the engine in my mathematical shame! Now that I've tested it out systematically, my conclusion is that everything works as it should. My lack of mathematical comprehension has led me to think that protection wasn't working. Actually it is! It's just that the basic hitchances in my mod have been so high that a modification of 0,9^9 (9 points of protection) still leaves a quite nice hitchance. Where I was expecting a very low hitchance, the hard reality of mathematics teached me better!

Examples:

An element fires at an element of Freicorps Infantry, which has a unit-protection of 9.

*** Start of action # 44 1000503 Grenadiers vs 1001569 Freikorps Infantry ***
16:17:59 (Reporting) Attacker belong to a attacking group SubType: Regular Defender belong to a attacking group SubType: Regular
16:17:59 (Reporting) Leader Battle Bonus (attacker): OffFire(%): 100 DefFire(%): 100 Assault(%): 100 TQ Bonus(pts): 0 Prot Bonus(pts): 0
16:17:59 (Reporting) Terrain: Clear Weather: Snow Complete list of values from TEC:
16:17:59 (Reporting) Grenadiers (Fire: 100 TQ: 0 )
16:17:59 (Reporting) Freikorps Infantry (Prot: 0 TQ: 0 )
16:17:59 (Reporting) Firer base fire: 8.00
16:17:59 (Reporting) Firer value with terrain: 8.00
16:17:59 (Reporting) Grenadiers - Commander: Friedrich II von Preussen Cmd Coeff. %: 115
16:17:59 (Reporting) Grenadiers - Unit Commander: Johann von Wedell Cmd Coeff. %: 106
16:17:59 (Reporting) Battle effectiveness with leader rating: 121.00%
16:17:59 (Reporting) Firer value with leader tactical rating: 9.68
16:17:59 (Reporting) Firer value with TQ correction: 11.13
16:17:59 (Reporting) Firer value with cohesion: 11.13
16:17:59 (Reporting) Firer value with Supply Unit presence: 12.24
16:17:59 (Reporting) Firer value with penalty from losses: 12.24
16:17:59 (Reporting) Firer final fire value: 12.24
16:17:59 (Reporting) Receiver base protection: 9.00
16:17:59 (Reporting) Receiver protection with terrain: 9.00
16:17:59 (Reporting) Receiver protection with entrenchment: 9.00
16:17:59 (Reporting) Receiver final Prot value: 9.00
16:17:59 (Reporting) ToHitCoeff %: 180* ATK ROE %: 100 DEF ROE %: 100
16:17:59 (Reporting) Attacker final To Hit (%): 9.00

16:17:59 (Reporting) Attacker rolled a 19 and failed to hit
16:17:59 (Reporting) *** End of action ***


So, the firer value before the calculation of protection was 12,24.
What would the hitchance have been if protection was not working? As I've set cbtHitCoef (in Gamelogics) to 180, each point of "final fire value" translates into 1,8% hitchance. So: 12,24 * 1,8 = 22,032 (in % final hitchance). Without protection, a hitchance of 22% was to be expected!

Instead, if we take into account protection, we get the correct result: every point of protection reduces the final firer value by a consecutive 10%, since I've set cbtProtCoef (Game Logics) to 90. So, protection 9 means that the firer final value has to be multiplied 9 times by 0.9:

12.24*0.9^9 = 4.742
To get the final result, we need to multiply this with 1,8 (cbtHitCoef in Gamelogics) again, which gives us 8,53. Round that up and you get the 9% that we see in the game.


Let's check another example from the battle log:

16:17:59 (Reporting) Firer final fire value: 11.42
16:17:59 (Reporting) Receiver base protection: 9.00
16:17:59 (Reporting) Receiver protection with terrain: 9.00
16:17:59 (Reporting) Receiver protection with entrenchment: 9.00
16:17:59 (Reporting) Receiver final Prot value: 9.00
16:17:59 (Reporting) ToHitCoeff %: 180 ATK ROE %: 100 DEF ROE %: 100
16:17:59 (Reporting) Attacker final To Hit (%): 8.00


11,42*0,9^9 = 4,424
4,424*1,8 = 7,96 --> rounded up to 8%

Now a test what happens when I set the cbtProtCoef (Gamelogics) from 90 to 40, so that each point of protection should multiply the firers final value not by 0,9 but by 0,4?

16:39:50 (Reporting) Firer final fire value: 8.80
16:39:50 (Reporting) Receiver base protection: 9.00
16:39:50 (Reporting) Receiver protection with terrain: 9.00
16:39:50 (Reporting) Receiver protection with entrenchment: 9.00
16:39:50 (Reporting) Receiver final Prot value: 9.00
16:39:50 (Reporting) ToHitCoeff %: 180 ATK ROE %: 100 DEF ROE %: 100
16:39:50 (Reporting) Attacker final To Hit (%): 1.00


8,8*0,4^9 = 0.0023
0,0023*1,8 = 0,00414 --> however, since the hitchance is capped at a certain minimum (cbtMinToHit in Gamelogics; in my case 1), the element has a chance of 1% to hit, as we can see in the game.

Everything works fine, shame on me! I hope that this was the last placebo-issue caused by my own mistakes/lack of comprehension. :love: Now I still need to find a way to protect light troops a bit more from assaults.

PS: And as a modding remark: I think it's a better to idea to give light troops protection via terrain (for "irregulars"), and not via unit-stats, because the latter actually increases their combat-power.
[CENTER][color="#A52A2A"] S I L E S I A I N R U P T A[/color]

- a work-in-progress mod for Rise of Prussia - [/CENTER]

User avatar
Pocus
Posts: 25662
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Thu Apr 24, 2014 9:38 am

That's no problem, you are one of the very few willing to check the battle log and that you are reporting you are seeing no error is always very good feedback, given the complexity of the battle module :)
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
JacquesDeLalaing
Colonel
Posts: 344
Joined: Tue Mar 09, 2010 11:05 pm
Location: Vienna (Austria)

Thu Apr 24, 2014 9:53 am

Thanks for your kind words, Pocus!
Just in case someone was wondering: I've edited the original post, noting that the formatting did not adopt superscript. So now it reads 0,9^9 instead of 0,99. ;)
[CENTER][color="#A52A2A"] S I L E S I A I N R U P T A[/color]

- a work-in-progress mod for Rise of Prussia - [/CENTER]

Return to “Modding AGE engine games”

Who is online

Users browsing this forum: No registered users and 10 guests