nOOb going doing an AI to an computerized war boardgame, yeah sure..

Hei!

One picture speaks more than hundred words so here comes…
[edit]you can get the picture larger by right clicking it from your browser and selecting open picture…

http://5mingames.eurojari.net/Map.jpg

at first i have to say that i have no education for computers,
still i can imagine and build an “simple” statemap with my brains, so i think i have an nice start on building this AI…

situtation-
map has 4 towns, towns are light green hexes containing rectangles, 3 of the towns are controlled by infantry and one town has two american armor adjacted…
map has several units of german and american (O) armor and (X) infantry on…
units are on war and armor is strong and infantry is a bit weaker, armor moves 5 and infantry moves 3…
this picture is just an small example of my possible game situtations, my plans have an scenarios of about 45x45 hexes sided maps with towns rivers forests seas hills, so this is just an simple example of my plan…

my question goes to those who have more years of experience on AIs than what i have, greatly happy to get even few tips from the people…

if units are on offence, is the AI what i need just an simple go to an “location” AI…
so if units in offence i should just “lock” few preplanned locations on my game map on random or in nonrandom order and then just put the units stubbournly try to move and fight on theyr way to these “locked” locations…
and if the units are on defence i should just build an “eye pleasing” line of defence around “locations” with my units…

i have horrible english im just an (finnish) factory worker, but, would be very nice to have an small chat conserning about computer AIs, with someone who has already build an (small) AI to a game before…

thanks…

JariTapio / Helsinki
www.EuroJari.net
JariTapio@EuroJari.net

I think this will be round based, which allows a good analysis of the situation. Players dont mind to wait 5 seconds for the AI to make its move on a roundbased game.

For defence find strategic useful position, place short range units in front and long range units in the back. Place artillery so that they can support as many sourrunding units as possible. Maybe have some mobile troops to reinforce areas under heavy attack or make a flanking move on enemy artillery or logistics.
Most analysis is realtively easy. E.g. enemy artillery is a good target:

  • if its close to own units
  • if there are not many enemies around to defend it

The harder part is making decisions among all possible options.

For attack scenarios, define the targets as target sectors. Evaluate the current situation and assign values to all fields. Assign “costs” to the fields. When a field can be attacked by an enemy, add a cost. For each enemy and artillery that can attack a field, add costs. So fields are more “expensive” when there are more enemies that can attack there. Reduce costs for usefull terrain. Reduce costs for weak enemy units, etc. So your units should use the fields which cost less, so they wont be attacked much, attack only weak enemies, use terrain advantages, etc. Reduce costs for fields next to own units that already moved, so your units are likely to stay together.

This are just ideas for starters. In the end you have to make it uo yourself, but I suppose

  1. Evaluate each field with good and bad factors, evaluate which enemies to attack and which to avoid, weak and strong defended areas, etc. This is all easy to calculate. This will give you a so called “influence map”. Influence Map means that you have a value for each field. A high value can be good, a low value can be bad, or the other way.
    A multi layered influence map has several values for each field. For example one value for own strength, one for enemy strength, one for artillery support, one for terrain, etc. The value of a field is the weighted sum of all single values. So bad terrain can be outweight by good artillery support and many friendly units around, while the enemy is only weakly present. You can assign different weights to the values based on your aim. Defensive play may put higher weight on artillery support and terrain while offense values own units in the area higher.
    Google for “influence map” youll probably find more.

  2. Choose best options based on the evaluation. Google for goal oriented behaviour or decision making. Visit the Gamasutra and Gamedev website and read articles. If your strongly interested in AI, consider the books “AI game programming Wisdom”

-JAW