Page 1 of 1

scouting

Posted: 28 Jan 2006, 15:55
by greenail
I would like to discuss how people have implemented scouting in their AI, I'm only looking for theory if you have a code example and you can comment your code in such a way that it is easy to see how your code matches your theory.

As a benchmark, I was wondering if we could develop a test to prove which approach conconsistantly better. perhaps "a find the last unit" test. This may end up as the first match in the "AI War" mod.

Posted: 28 Jan 2006, 17:14
by AF
None of them can be counted as the voerall best they all have their pros and cons.

First LOS used in a skirmish AI:

LOS based, JCAI:

JCAI kept a grid of sectors each with a value signifying how long ago it was last in LOS. A scout would constantly be re-assigned a new position based on a simple algorithm that gaged where to go according to the value and its distance from the scout. It was very effective at creating search sweeps with aircraft, but it didnt take into account land/sea and how it affected ground units.

Random AAI/OTAI:

Units where sent to random positions to look for the enemy.

Random NTAI:

A sector grid was setup and scouts would goto each sector one by one but a random large number of sectors was missed eachtime


Startpos OTAI & NTAI

First sued by NTAI the modified CSunParser class was used to read off the starting positions of the players and scouts where sent directly to each one in turn.

Mexes NTAI:

Scouts visited each and every mex in turn then started over again, working on the promise that the enemy will build mexes and thus they can be found near mex spots.

NTAI and JCAI have specific untis it scouts with, such as JCAI's aircraft and NTAI's freakers, the other AI's seem to just use any unit they have that is an attack unit and sends it out to scout, exept OTAI which I'm unsure of lately. KAI searches out randomly then units commune on any found location before swarming randomly again.

As i said no one algorithm is the best, hence why NTAI uses 3 different scouting algorithms

Posted: 28 Jan 2006, 18:50
by submarine
AF wrote:
Random AAI/OTAI:

Units where sent to random positions to look for the enemy.
sorry but i would appreciate if you let me explain my ai myself, especially if you dont have clue how it works...

aai does not send scouts randomly around, it decides where to send its scouts based on the time that elapsed since the last scout has been sent there and the importance of the location (-> how often it scouted units/buildings) there)

Posted: 28 Jan 2006, 18:51
by greenail
code and comments?

Posted: 09 Feb 2006, 22:49
by Veylon
Mine isn't entirely random, either. It won't send them if they can't go there (land/water issues) or if there is already LOS there. More to the point, it uses a custom random number generating class that I found in a book to get random numbers without getting the same ones over again until all of them are gotten, so it won't check the same place twice for quite a while, except at the beginning when it's looking at start locations.

Also, it's more likely to scout where enemies have been seen before.