CombatLib
Degrading morale from being shot at.
And more work on morale generally.
All this is still prototype stage.
There are two measures of morale.
The stat which is 1-99. ( A 1 stat morale unit would be extremely brittle and 99 would be equally silly).
The level ( I might change the name for that ) which is the unit's current state and can reduce effectiveness, limit what they will do or make them run away completely.
The various morale levels are:
Enthusiastic
Steady
Slowed
Shaken
Halted
Suppressed
Repulsed
Routed
Dispersed
Most, maybe all units, will start Steady.
How a unit gets to be Enthusiastic is TBD.
Hence (at present) if a unit fails morale tests badly enough it can be irrecoverably broken.
I might make that only if attacked whilst routed.
Each usually has 5 shots.
A unit shot at takes morale tests.
These are a straight percent roll vs the unit's current morale stat.
Failure reduces the morale level to the next one - eg Steady to Slowed.
It takes 1 test + another per 5% casualties taken.
Just being fired at can be bad.
Taking a lot of casualties is likely to be really bad.
For each test the current morale stat is always reduced by 1.
Say unit X takes fire from unit A.
Unit A has 5 firing points which fire is resolved for.
For each of these.
Casualties are resolved.
Morale is then tested.
At the end of a period... which is yet to be decided....
The unit will recover morale if it wasn't shot at during that period.
At the end of a period.... again which is yet to be decided...
The unit may be rallied to recover level.
Winning a combat will probably increase morale level.
There will also be some sort of rallying mechanism.
Self rallying will be possible but leaders in proximity will be better.
You can't just send a note telling a unit to rally.
This attempts to model how real world unit morale works.
Studies looking for a morale losses based "break point" have found there is no guaranteed percentage.
An assaulting unit will probably break at around 30% losses but there are instances where attacks have still carried on with higher or stopped with far lower.
"Just" 10% losses can often stop an assault.
What these studies found was how fast a unit took losses was usually a decider.
This is what reducing the morale stat and then increasing it when not under fire is about.
If a unit comes under sustained attack then it will become brittle.
If it comes under attack from numerous attackers then that will happen quicker.
The longer it goes without being attacked the more such a unit will recover morale.
Below is debug output for some shooting.
I'm using this to check my process gives good results and it's not really for public consumption but probably clear enough.
If you find it confusing, don't worry.
Combat reports you see in the game will be more user friendly, albeit with less internal detail.
When I write em.
The 5 sets of hits (casualties) are one each per firing point.
The unit shooting is strength 2390.
It has first shot bonus making modifier 1.2
Each musket is rated as killing 1 person per hit.
This is very short range so accuracy is high.
The morale of the firing unit is indifferent - 40
The quality of the firing unit is indifferent - 42
The target unit is face on and both are in line so no enfilade multiplier
The random factor used is weighted - It's currently three randoms between 0.01 and 1 added together and divided by 9.
Note that the casualties are maybe still too high - morale is and was far more significant than pure casualties.
Hits 91 -- Strength: 2390 Modifier 1.2 Lethality 1 Accuracy 0.993 Morale 0.4 Quality 42 Enfilade 1 Random 0.191271533347327
Hits 51 -- Strength: 2390 Modifier 1.2 Lethality 1 Accuracy 0.993 Morale 0.4 Quality 42 Enfilade 1 Random 0.108229782068795
Hits 110 -- Strength: 2390 Modifier 1.2 Lethality 1 Accuracy 0.993 Morale 0.4 Quality 42 Enfilade 1 Random 0.231340596404861
Hits 101 -- Strength: 2390 Modifier 1.2 Lethality 1 Accuracy 0.993 Morale 0.4 Quality 42 Enfilade 1 Random 0.212642983942902
Hits 122 -- Strength: 2390 Modifier 1.2 Lethality 1 Accuracy 0.993 Morale 0.4 Quality 42 Enfilade 1 Random 0.255582311102719
The morale tests for these:
Fives +1 is five-percent-losses plus one.
Rolled is the percentage "rolled" as a test.
Morale is the current morale of the unit which started at 72 and drops 1 each test.
Strength is the number of men left alive in the unit being shot
When it says "Reduced Morale state" that means the level drops from Steady > Slowed > Shaken > Halted
This is a relatively large unit shooting at a smaller one at point blank and 475 casualties would be a LOT from a real napoleonic era volley.
Rolled 20 Morale 71
Rolled 38 Morale 70
New Morale Steady Casualties 91 Fives+1 2 Strength 1560
Rolled 19 Morale 69
New Morale Steady Casualties 51 Fives+1 1 Strength 1509
Rolled 20 Morale 68
Rolled 15 Morale 67
New Morale Steady Casualties 110 Fives+1 2 Strength 1399
Rolled 92 Morale 66
Reduced morale state
Rolled 82 Morale 65
Reduced morale state
New Morale Shaken Casualties 101 Fives+1 2 Strength 1298
Rolled 61 Morale 64
Rolled 16 Morale 63
Rolled 70 Morale 62
Reduced morale state
New Morale Halted Casualties 122 Fives+1 3 Strength 1176
RunTime 0 s 10 ms
Total casualties: 475