# Positive Evaluation Function - Territory AI Help

I am trying to implement some positive evaluation into my game. Let me explain.

I have a series (anywhere from 5 to 25 (might vary)) of circles (three sizes, big medium small). And each player starts with a main circle which gains 1 every turn (like risk the circles gain at different speeds, the big one gains the fastest and the small one gains the slowest). You can use these numbers to take over other circles, if the "enemy" is on this circle it does a risk thing (you fight to see who takes it over, who ever has more wins most of the time, I'm not getting into this logic as it is rather irreverent).

So this is a very basic overview of what occurs, now what I need some help with is how I can create an AI which will look at all available (and taken) circles and determine where it wants to move to. There would be circles closes to it, and circles in the enemies area and circles available and circles taken over. And it would need to determine where to move it's forces too next, and so on and so forth.

So after some research I read a lot about Positive Evaluation, which it takes all possible moves and determines the best one.

So I am wondering if anyone could help me out or give me some direction as to where to go from here. I think what I need to do is take all the circles with any forces on them, throw them into a table/array with the cords of each circle and determine which would be best, then I would need to determine how many forces I want to send and where from.

Help!

Allow me to explain a bit, http://imm.io/4Xwy see that diagram lets assume the circles are sections of forces, and you gain a new force each "time interval" and lets say I want to take all my forces (I'm pink) the circle directly below me and capture it, well the AI would need look at all available circles and pick for example the big green on in the top right (since big would make more troops and its close to the "main"). I'm assuming what you said would still work? Weighted options?

• when you say "each circle gains 1 every turn" you mean gains one unit, right? – tenpn Apr 13 '11 at 7:48
• This is similar to the Google AI challenge 2010: ai-contest.com There are AIs with source code available at the site. – Jonas Bötel Apr 13 '11 at 8:43
• Do you mean Position Evaluation? As in what some Chess AI's use? – Ray Dey Apr 14 '11 at 22:42

I don't think I quite follow your explaination, but if I had to write an AI that evaluated multiple targets I'd do something like this:

• create a list of all possible targets
• pass each target to multiple behaviours, each which may return a score
• for instance a "weak target" behaviour might return a high score if the target is not very well defended
• a "supply chain" behaviour might reward a high score to targets that are vital links in the opponent's infrastructure
• add all the scores together
• attack the target with the highest score

This approach is modular and extendable. You may need to put some work into making it easy for you to tweak at run time the numerous constants you will invariably use in each behaviour.

For bonus brownie points, you could return multiple scores in multiple categories (eg seperate scores for how much of a defensive attack this might be, and how much of an aggressive one). Then you could define a personality of your AI as a series of multipliers to these scores (an aggressive AI might have personality [0.5, 1.5] for instance, to boost aggressive targets and relatively ignore defensive targets). You pick the target with the highest of any type of score.

• Allow me to explain a bit, imm.io/4Xwy see that diagram lets assume the circles are sections of forces, and you gain a new force each "time interval" and lets say I want to take all my forces (I'm pink) the circle directly below me and capture it, well the AI would need look at all available circles and pick for example the big green on in the top right (since big would make more troops and its close to the "main"). I'm assuming what you said would still work? Weighted options? – Steven Apr 13 '11 at 7:46
• Good diagram. Think I follow now. Pop that into your question. – tenpn Apr 13 '11 at 7:49
• Yes this technique would still apply. It's all in what behaviours you choose, and how you implement them. A "weak target" behaviour could actually involve a lot of computation. – tenpn Apr 13 '11 at 7:50