Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  nOOb going doing an AI to an computerized war boardgame, yeah sure..  (Read 3410 times)
0 Members and 1 Guest are viewing this topic.
Offline NewOnJava

Junior Devvie

1970 born Java game hobbyer.

« Posted 2007-05-21 12:34:10 »


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..

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..

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..


JariTapio / Helsinki
Offline JAW

Senior Devvie

Medals: 2

« Reply #1 - Posted 2007-05-25 13:03:00 »

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"

Pages: [1]
  ignore  |  Print  

EgonOlsen (42 views)
2018-06-10 19:43:48

EgonOlsen (22 views)
2018-06-10 19:43:44

EgonOlsen (43 views)
2018-06-10 19:43:20

DesertCoockie (197 views)
2018-05-13 18:23:11

nelsongames (124 views)
2018-04-24 18:15:36

nelsongames (123 views)
2018-04-24 18:14:32

ivj94 (863 views)
2018-03-24 14:47:39

ivj94 (125 views)
2018-03-24 14:46:31

ivj94 (768 views)
2018-03-24 14:43:53

Solater (140 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!