Jump to content

Bug in morale formula


Recommended Posts

Not sure if there is still going to be a patch, but I'd like to point out that the morale calculation formula is not working well.

Imagine the following situation from the editor:

moralebug.jpg

I am letting the tank attack the AT gun and then either retreat to the capital (supply 10) or to the open (supply 7). Then I check what the effect on the morale is on the next UK turn.

Obviously you'd expect that the tank would have the best morale if its in good supply and that therefore moving to the capital would be the best move. The opposite is true however, the tank will have a higher morale if it has less supply.

So say that the tank takes 7 damage from the attack and then moves to the capital. The next turn it will have 25 morale. If it took 7 damage and moved out in the open it would have had 32 morale.

This happens due to an error in the morale calculation formula:

Morale = OldMorale / 10 * 75% + (Strength - OldMorale * 75%) * Supply / 10 * OldMorale / 100

In the formula the (Strength - OldMorale * 75%) part is usually positive, at which point the (Supply / 10) would reduce the positive number and therefore reduce morale based on supply.

If a unit takes severe damage however, the (Strength - OldMorale * 75%) part becomes a negative number and would reduce morale. But it is still affected by the (Supply / 10) part of the formula that now begins to reduce the negative number. So whenever a unit takes serious damage taking it out of supply reduces the reduction in morale it will suffer the following turn.

One possible solution would be to split the formula into two parts, if (Strength - OldMorale * 75%) is positive, use the formula like this. If it is negative, replace the supply part with a fixed number, such as 0.5 or 1. This would make supply irrelevant after a unit has taken high damage. That is of course far from perfect and even then it would need fixing, but it is still better than that being in good supply reduces morale quicker after taking damage.

Link to comment
Share on other sites

No to both questions. In fact, what you see on the screenshot is the entire map. This was done in the editor, so all contaminating factors are removed. Feel free to test it yourself if you find it difficult to believe, it is quite easy to do.

Link to comment
Share on other sites

  • 3 weeks later...

No, this is weapons and warfare with the latest patch, but the formula I posted came out of the blitzkrieg manual as I obviously do not have the source code. Considering that the effect can be demonstrated in the editor of weapons and warfare however this error must still be in it.

Link to comment
Share on other sites

  • 2 weeks later...

It appears that the same error is another formula, the one for calculating the defenders combat losses.

Take a look at this screenshot and read the explanation below.

swampbug.jpg

The corps targeted in the right screenshot is standing in a swamp and has 50% readiness. The corps targeted on the left screenshot (the one next to the city) is also standing in a swamp and has 110% readiness as there is a HQ near him and he is in good supply. As you can see on the combat calculation predictions at the top of the screenshot, the bomber does more damage versus the corps with the most readiness. So when a unit is standing in a swamp, low readiness protects it from air attacks.

The reason is the same as above, but now in a different formula:

Defender Losses = Attacker Multiplier * (Attack Type Value + Attacker Experience / 3) - (Defender Multiplier * (Defender Experience / 3 + Defender Entrenchment + Defense Bonuses))

Only the last part is relevant:

(Defender Multiplier * (Defender Experience / 3 + Defender Entrenchment + Defense Bonuses))

Defender experience and entrenchment are both zero so that makes this part of the formula equal to:

Defender Multiplier * Defense Bonuses

Defense bonus is -1 because the units are in a swamp. The higher the Defense multiplier is now, the lower the defense bonus will become. For example, say that a unit has 100 readiness, the defense bonus is now -1 (1*-1), say that it has 10 readiness, the defense bonus is now -0,1 (0,1*-1). So the low readiness of the target in this example is reducing the damage by 0,9 point.

Unlike the bug in the above post this one is actually much harder to exploit and will generally not affect the game much, but I guess should point it out anyway.

Link to comment
Share on other sites

×
×
  • Create New...