I am trying to create a model of the value of different units, but the problem is that I have very little information on how the different phases work. My observations haven't narrowed much down; it seems pretty random. I've seen the melee phase start after a day or two of fighting, or sometimes the melee phase never starts and the skirmish phase happens for 15 days until the battle is done. I've also seen battles where the melee phase starts very quickly into the battle and lasts for the rest of the battle, and other battles where the melee phase switches back into the skirmish phase after a while, and then back into the melee phase later. So, quite simply, I ask if there is any wealth of information out there that could shed some light on how the game calculates how long phases last, and how the game decides to switch between phases.