I've been facing a lot difficulties on the programming side of Domination.
One tiny challenge of the many - and the one I'm currently working on - is AI-Scouting.
Scouting is expensive, and real scouting is only done for human player. (More about how its handled later) But AI-players still need a fake scouting to decide if a city is in range or not. So, we need something like getCitiesInVision function which returns all the cities that have been scouted.
AI Players just increase their vision range in time depending on the technologies they discovered. Then when they need to get which cities in range, it calculates distance from his own cities to all other cities in the map. If distance < range, it means that city is scouted.
The problem is that, this function might be called A LOT depending on diplomatic conditions. And it's not very efficient to make this calculation ALL the time. So, first thing came to my mind is to keep _citiesInVision for every Lord out there and update those whenever their range increases. But it's not enough, because a city may have expanded into their range earlier. It's very hard to know when this happens - efficiently. And most importantly, AI may not really need citiesInVision for a long time but it will still be updating it everytime it range increases.
Current solution: When the getCitiesInRange called again, it checks if the range has changed after last update (if yes: update citiesInRange) then it checks if it's been some time after last update (if yes: update citiesInRange) and returns citiesInRange. This decreased the amount of this function called in a game session greatly.
We started writing the stories of each Ruler. My step-father (who is a great writer imo) has outlined most of the stories. I'm very happy with the results so far and can't wait to share it with you. But first, we need to finalize 1-2 of them and translate them into English.
Oh, and some nice progress with character sketches. Did I mention every ruler will have different characteristics and this will hugely affect the way you play? Here's 3 characters one barbarian, one nomad and one merchant. Guess which one is which