Started working on the thing I've dreaded the most.. Battles! Made quite a bit, but I have no idea if all the parameters are working as expected. Also it probably needs a lot of tweaking to get the balance right. As I start I just wanted the battle loop to work and it seems to do that.
What I'm doing is to have all troops get a random initiative based on their speed. The higher the number the better. Then I loop through all and randomize a defender of the attacker. Then randomize values based on attack and defense. If attack is higher the defender is wounded.
Still have to add modifies for morale and battle orders.