I know I commented there but I still didn’t understand how it works:grinning:
I realize that was cryptic
Each unit has its own intrinsic morale that starts at 1. It is slightly decreased whenever there’s a casualty, but will slowly go back toward 1 otherwise. A unit’s effective morale is determined by its intrinsic morale but also the influence of the intrinsic morale of the surrounding units.
The influence factor depends on distance and on the training level of respective unit and the morale of the other unit.
influenceFactor = distanceFactor * (1 - other.intrinsicMorale) * (1 - unit.trainingLevel) * other.trainingLevel
The distance factor is close to 1 for nearby units and closer to 0 for units far away. At 50 meters it drops to 1/2, at 100 meters it’s 1/3, and so on.
distanceFactor = 50 / (50 + distance)
The training levels are:
0.5 for ashigaru
0.8 for samurai
0.9 for general
I still don’t really understand:hushed: