139 - Smarter Barbarians
Closes #139
This is a set of changes to make the barbarians more dangerous. More changes can be added to make them more dangerous, and may be as part of this PR, or later.
It also organizes them into tribes, with the idea of various tribes having different priorities.
So far the changes center around making them more opportunistic:
- If a barbarian unit starts its turn next to an undefended non-combat unit, goodbye undefended unit
- If a barbarian unit starts its turn next to a non-barbarian unit it thinks it has a chance of beating, it will attack
Corollary, the barbarians aren't the best at figuring out if they think they have a chance of winning yet. I added a very simple risk calculator that takes into account defensive bonuses, but not the round-based nature of combat, meaning the barbarians will be more optimistic than they should be.
Long-term, I envision adding a more accurate combat odds calculator, and perhaps a multi-unit combat calculator (do my five units have a chance of taking that city?). Which combat odds calculator the barbarians (and AI) use could vary based on difficulty level.