Changelog - picture heavy

Started by Andy ONeill, January 02, 2018, 02:08:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy ONeill

All

Removed Limbered and Unlimbered from formations.
Artillery in column will be limbered and hauled by horses.
Artillery in Line is not limbered and will move slower.

FYI
In real world for our period a cannon could be prolonged and moved by it's team of horses without being limbered.  If you feel the need you can alter scenario movement speeds and how long it takes to change from line to column to take this into account.

Andy ONeill

Scenario Editor

Added formation change time to edit movement rates
This is per side so one can be better drilled than the other.
This will be used as a base value.
Changing formation will be harder when close to the enemy and harder again when under fire.

Show piece size in px on menu

Andy ONeill

All
Choose file view - increased width of column for name

Sandbox

Best visible target calculation.
This takes several points representing a shooting unit and work out what enemy units are in range and within arc of fire.
It then looks at the distance between each shooting point and each visible point representing the position of qualifying target units.
The closest (or none) is chosen for each shooting point.


Andy ONeill

All
Choose file view, added user confirmation before deleting.

Andy ONeill

Sandbox

Shooting - another iteration on best target points.

Andy ONeill

Scenario editor
Bug fix
Set turn time.
The width of each rectangle representing movement was calculated incorrectly.

Army Editor
Increase ammo max to 999

Andy ONeill

Sandbox

Moving some code around so shooting and target points are only calculated once per unit ( in a time slice ).

Choosefile

This is the standardised view which is used to open a file -  map, army or scenario.
Avoiding opening any selected file if you close the window using the x top right.

Andy ONeill

Combat Lib & SandBox

Started shooting prototype.
There are a lot of factors go into deciding how many casualties are inflicted by a volley.
Amongst other things, a unit might not be shooting at just one enemy.

Andy ONeill

Combatlib

Shooting weighted random and modifiers.

Andy ONeill

ModelLib

Moved randomisation routine and weighted it.
This is used for shooting and the previous version was a bit too slow and producing too many casualties.
The routine now produces a "bell curve" similar to rolling 3 dice - or normal distribution.

Andy ONeill

Sandbox & CombatLib

Calculating the zone shooting is from - front, flank or rear.
A unit in line has 5 "shooting points" and fire is calculated for each.
The "zone" that point falls in is calculated for each of these.

The zone will be used for morale.
Being attacked from the rear doesn't particularly cause any more casualties than from the front.
It's particularly bad for morale though.

Andy ONeill

Sandbox

Added horse holders multiplier
A quarter of skirmishing cavalry are allocated as horse holders so they shoot at 0.75 effect.

Minor refactor of combat code.

Andy ONeill

SandBox & ModelLib

Added Current stats for piece
This allows me to track losses from shooting.
Will allow me to track changes in status such as morale, fatigue etc.

Andy ONeill

Sandbox & CombatLib

Added Morale prototype.
Still incomplete but I now have a set of morale states and a mechanism which will degrade these as a unit is shot.


Andy ONeill

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