Overview of the AI (3/3)

We’ve come to the final part of the AI overview (link to the first and second part) and today we’re going to discuss the variables that help the AI prioritize between all requests that it receives. These are the variables that give the AI a ‘personality’ and makes different AIs play differently from each other. We’ll also discuss how we plan to optimize some of these variables and let the AI evolve into a challenging experience.

The strategic AI, which makes all strategic decisions and control the whole empire, is influenced by three sets of ‘priority’ variables. Each set of variables contains information on what values should be added/multiplied to the basic importance in the requests the strategic AI receives. The three sets are called ‘race traits’, ‘religious behavior’ and ‘AI personality’.

Race traits – The six races in Rising Empires all have a tendency towards a certain behavior. Greenskins are more aggressive than Dwarves, Krant want to expand faster than Elves and so on. The race traits are a basic set of variables that govern how the dominant race in the empire influences the strategy.

Religious behavior – An empire will also try to follow its religious beliefs. There are big differences between, for example, ‘There can only be one’ and ‘Wisdom of the ages’ and this set of variables are meant to emulate the influence of religion on the strategy of the empire.

AI personality – If we only had the above two sets of variables to races of the same religion should always play with a similar strategy and this will decrease the ‘fun factor’ of the player. For this reason we also have a third set of variables that, in a way, is meant to emulate the emperor and how he run his empire.

In short, the race traits are meant to make the AI play in a way that suits the race, the religious behavior wants to influence the AI to play in a way that makes the best use of the religious bonuses and the AI personality adds some chaos…

The strategic AI has objective AIs and the scout AI to control all armies and fleets according to its strategic objectives. Settlements are controlled by settlement AIs. The strategic AI does not wish to handle the ‘day to day’-operations of a settlement. Instead it issues a Governor to each settlement AI. The Governor is similar to the three sets that influence the decisions of the strategic AI. It contains variables for what kinds of buildings it wishes to construct and how the settlement AI shall develop the settlement in regards to food production. As changing governor often might damage the development of a settlement the strategic AI will only change governors when it make major changes in its policy or when a crisis occur.

As you can see there will be a lot of variables that control how the AI will perform and a major task is to evolve the AI into something that will prove challenging for the players. One series of articles that have influenced me are written by Harvicus of Checkmark Games. In the later parts of the articles he uses genetic algorithms to let the AI evolve itself. This is exactly what we intend to do with our AIs…

Using genetic algorithms will not be an easy task, although if we succeed with this I believe we can improve our AI very much. Two big problems is the sheer amount of variables that controls the behavior of the AI and how to measure if an AI performs well or not. More on this later.