Page 1 of 2

Characteristics of AI's

Posted: 12 Jul 2007, 10:34
by sanderbakkes
I am writing an article on AI research that is performed in the Spring game. It will be published in the book AI Game Programming Wisdom 4. My editor suggested to elaborate on the Spring AI's that were used in the research.

So, let's make that part of the text open-source shall we! Of the following AI's: AAI, TSI, CSAI, RAI (I would love to mention all the other great AI's as well, but this is what we limited the research to due to compatibly reasons), I am interested to know:

- who developed the AI?
- what you think the general characteristics of this AI are?

Thanks for your contribution!

Posted: 12 Jul 2007, 11:58
by DJ
If I were you I would use AAI, KAI, RAI, and NTai. Not offend the other AI developers but these are the most developed.

Ask Ivory King about KAI if you want a profile of it, it was developed by Krogoth and has been taken on by Kloot I believe. As an AI it was brilliant, it used cheating to identify your weakest areas and take them down. It also has its own path finder for defense placement.

RAI is developed by Reth and seems to be very well written. It doesn't require configs and yet seems to play a pretty good game no matter what you throw at it. It's hard to give a profile of RAI really but it seems to try to establish several small bases and grow them, it also uses unit groups quite well.

AAI is a config based AAI developed by Submarine, another excellent AI with good group handling it can be configured to expand quite rapidly and as such can produce a large number of units. It also learns to some extent about the efficiency of units in a mod and the positions on the map in which it has been attacked.

NTai is the most configurable of the AI's and is written by AF. It implements a load of clever features but has been dogged by performance problems. The longest running AI and arguably the strongest -dependant on whether KAI is restored to its former glory

CSAI was written by hugh perkins in about 4 days I believe, then the interface changed and broke all his work. I'm not sure its ever really been resurected as I think Hugh has been doing more work on the interface and CSAI was more of a proof of concept for a C# AI.

TSI seems to have died although it was quite a promising AI. I think it was a config based AI. You can find the authors by searching the forum.

I haven't been here that long but that's what I know of the AI's in spring.

Posted: 12 Jul 2007, 13:20
by yuritch
My opinion on RAI: it doesn't have the concept of 'base' at all, it builds things when it needs them and where its builders are at the moment. Also it makes way more factories that it can provide the resources for. This makes its economy quite hard to defend as it's too large, but at the same time quite hard to take out because of the same. It tries to micromanage units (for ex. moving them out of enemy range if they are focused on), but this gives it problems with units that have to stop in order to fire or have limited fire arcs. RAI seems unable to mass any sighnificant number of strategic units (like aircraft), instead it builds a bit of everything.
AAI behaves quite differently, if not in exactly opposite manner. It has a clearly defined base that it tries to defend, it places buildings in some orderly manner, it doesn't do much micromanagement on AI level but relies more upon engine Fight command (this works better for units with limited fire arcs or that need to stop than RAI method). Also it does something RAI cannot, like massed air strikes. It builds better ecenomy in the long run, replacing metal extractors with more efficient ones and building better power sources.
Overall on small maps RAI approach seems to work better (it beats AAI more often than not), but on larger maps (or just more complex ones), where AAI has the time to get its economy running, the result if often different.

Posted: 12 Jul 2007, 16:07
by 1v0ry_k1ng
the most interesting AI's to study for this would be:

NTAI, for its ULTRA customiseable configs and flexibilty

RAI for its ability to play virtually any mod, no configuration needed

AAI for its learning abilities

KAI for its unit micromanagement and battlefield awaresness, NOTE: wait until the next SVN release where victors KAI patch makes it work, atm its broken

the rest of the AI's stopped development some time ago or are behind these four in terms of features

Posted: 12 Jul 2007, 16:15
by Kloot
@IK

Just to clear things up, Viktor's patches all concerned KAI 0.22, not 0.12 (which I intend to get back to when 0.75 is released).

Posted: 12 Jul 2007, 23:43
by jcnossen
Kloot what's the reason you're not working on 0.22 instead of 0.12? Doesn't 0.22 have more potential?

Posted: 13 Jul 2007, 02:30
by Kloot
It does yeah, it's just that I'd like to eliminate a few lingering issues with 0.12 (a crash-bug or two, the apparently broken LOS hack, and the too heavy reliance on the commander for early expansion) before working on 0.22 exclusively.

Posted: 13 Jul 2007, 14:53
by 1v0ry_k1ng
fixing the LOS hack will make it actually play decently again

Posted: 13 Jul 2007, 16:34
by sanderbakkes
all thanks a lot for your efforts, this is what i have got so far. if you feel the text can be enhanced, i appreciate adjustment.

├óÔé¼┬ó AAI is a config based AI developed by `Submarine'. It features good group handling that can be configured to expand quite rapidly and as such can produce a large number of units. It also learns to some extent about the efficiency of units in a mod and the positions on the map in which it has been attacked.

├óÔé¼┬ó TSI is a config based AI developed by [information soon available, thanks a lot tow_dragon!]

├óÔé¼┬ó CSAI was a proof of concept for a C#-based AI. It was developed by Hugh Perkins in less than a week. By default, CSAI utilises a very strong `rush' strategy.

├óÔé¼┬ó RAI is developed by `Reth'. It does not require configs. Features of RAI are rapid construction and expansion of small bases, and the effective use of unit groups.

Recently, C++ developer `AF' released his highly configurable NTai, that was well received within the Spring community. Additionally, the Spring community anticipates the re-release of KAI, a strong AI that was originally developed by `Krogoth'.

Posted: 13 Jul 2007, 18:35
by Neddie
NTai was recently rereleased into beta, if I recall. He has had a number of working versions in the past.

Posted: 13 Jul 2007, 18:36
by imbaczek
I suggest to elaborate on those AIs that are open source. Take some time to read the code and note what methods and algorithms the AI uses to:
- build the base
- lay out defenses
- harvest resources (mexes, reclaim, energy)
- determine where to attack and with what
- determine if it tries to guess where it is going to be attacked and if it reacts
- determine the initial build order
- determine usefulness of units
- micromanage units in combat

Also, some important questions to be asked - bonus points for sharing answers:
- in what mods some of the above fail and why (bugs, wrong assumptions, documented and/or intentional deficiencies?)
- does it learn, what methods of machine learning it uses and how could they be improved?

Hm, guess this is quite a lot for an article. Maybe write a research paper? ^_^

Posted: 13 Jul 2007, 19:07
by Neddie
sanderbakkes wrote: ├óÔé¼┬ó AAI is a config based AI developed by `Submarine'. It features good group handling that can be configured to expand quite rapidly and as such can produce a large number of units. It also learns to some extent about the efficiency of units in a mod and the positions on the map in which it has been attacked.

├óÔé¼┬ó TSI is a config based AI developed by [information soon available, thanks a lot tow_dragon!]

├óÔé¼┬ó CSAI was a proof of concept for a C#-based AI. It was developed by Hugh Perkins in less than a week. By default, CSAI utilises a very strong `rush' strategy.

├óÔé¼┬ó RAI is developed by `Reth'. It does not require configs. Features of RAI are rapid construction and expansion of small bases, and the effective use of unit groups.

Recently, C++ developer `AF' released his highly configurable NTai, that was well received within the Spring community. Additionally, the Spring community anticipates the re-release of KAI, a strong AI that was originally developed by `Krogoth'.
This is how I would rephrase what you've said. I'm not sure how much text you desire, but I feel that this should present the different AI in more depth and in a more honest light.

├óÔé¼┬óAAI is a configuration file based skirmish AI developed by 'Submarine' - also known as Alexander Seizinger. It features powerful group handling, streamlined economy management and the ability to learn and adjust behavior on the basis of gameplay experience. It can interpret zones of conflict, and the configuration files allow game makers to tweak rates of expansion and production. It is currently licensed under GPL and configuration files can be developed to offer support for most games on the Spring engine. Under active development.

├óÔé¼┬óTSI is a configuration file based skirmish AI developed by <Insert Handles and/or Names>.

├óÔé¼┬óCSAI was developed by Hugh Perkins as a proof of concept for a C# based skirmish AI. While it was developed in less than a week, it proved viable at the time, utilizing a rapid 'rush' or 'surge' strategy. Somewhat aggressive, but highly experimental, CSAI leaves a lot of room for growth but is worthy of examination - no license is specified, so any activity should be preceded by making contact with Hugh Perkins. Windows support only at the current time, no longer under development.

├óÔé¼┬óRAI is a generalized skirmish AI, developed by 'Reth'. It adapts dynamically to the game being played on the engine and requires no specific augmentation. RAI features effective unit handling of individuals and groups, rapid construction and the ability to erect secondary bases of operation. Windows support only at the current time, under active development.

Personally, I don't think there is enough data on TSI available to include it in your write-up. I'm unsure what your requirements are, but I strongly advise you to replace TSI with either KAI or NTai, and would be willing to do a full write up for either or both.

Posted: 13 Jul 2007, 19:28
by AF
AAI tchnically is a config based AI btu for all intensive purposes thats meaningless and it should be cosndiered a dynamic AI. The vast majority fo whats in the config is not required and is used as a crutch, for example all the data on what units are commanders and how many sides there are can be gotten dynamically via the AI interface.

AAI was the 4th major skirmish AI released. OTAI was the third, NTai the second, and JCAI the first.

As a note, I have not 'recently' released NTai, considering that in the last 3 years I've made 150+ releases of numerous versions and builds of NTai, coding since March/May 2005(before JCAI was started ironically).

Also I would move away from calling AAI a learning AI, as its misleading. What it does is it maintains efficiency values for units in tables, of which it has several tables for different purposes. As units kill eachother it tweaks the values and uses the values to judge what attacker units it should build.

All AIs use a dynamic rules based system to guide their cosntruction process, augmented with efficiency based statistics for choosing attack units and numerous other little special case things such as defences.

NTai and OTAI are the only AIs to break away from this. NTai implemented originally a task based model loading from files and then implemented keywords that had the same behaviour as the other AIs. OTAI moved the other way around and added simple build lists to its data files for NTai style configs, but veylon dissapeared from the forums not long later.

Posted: 13 Jul 2007, 19:30
by AF
All AIs use the same basic attack targetting mechanism except KAI, a threat matrix where untis threat values are added to a grid representign the map and the grid sector with the highest threat is the target.

The AIs then start to differ in how exactly they maintain and act upon this information, namely in how they handle the units after a targets been found.

Posted: 13 Jul 2007, 19:33
by Neddie
If AF provides the raw data, I can process and write it for you sander. Everything I pulled is based on forum threads and the wiki, but input from actual AI developers will double or triple the accuracy and quality of the information I present.

Posted: 15 Jul 2007, 15:50
by tow_dragon
The History of The TSI (promised to sanderbakkes :-) )

The history of TSI begins about one year ago. At first project has been developed exclusively by Tow.Impono - he wanted to improve his skills in C++ programming. He thought it's too hard for him to develop such a big project form scratch, so he decided to continue improving one of abandoned AIs - SAI. When he reached some minor sucesses, I decided to help him. This was our first project, so developing it (unless we had then some programming skills) was very slow. We didn't know very much about creating game AIs, so we just try to make it play better. For a long time TSI just tried to build as big army as it could in very short time, take the control over the whole map and destroy enemies by endless flood of units. This strange tactic was very effective - TSI usually won with other AIs.
But none of these "post-SAI" versions of TSI was publicly released. Engine of SAI was inefficient and hard to extend. That's why Tow Impono decided to write new engine from scratch. It took month, but finally, at 30 August, first version of TSI based on the new engine was published. Alas, it was playing poorly and was buggy.
In that time, TSI supported only one mod - Absolute Annihilation. There was not to much to do with such a simple AI, and every other AI for Spring supported more than one mod, so we decided to add support for other mods to ours. We have done it by eliminating unit lists used by SAI and putting them into mod - dependent files. Unfortunetly new TSIs played poorly, much worse than first versions, mostly because of dumb army handling. The only interesting thing in that version of TSI is choosing the best config file, if there is no file for currently played mod (e.g. when the new version of a mod is released) - TSI counts Levenstein's distance between mod's names and config file's names and chooses one with the least.
Few months later we made another decision. We thought that if TSI had some innovative algorithms, it would play better and be more popular. We didn't like learning algorithms, so we decided to make TSI look down on the ground :-). I wrote quite advanced pathfinding system, that depends on a grid of nodes. All units in mod are divided into a few classes with different slope tolerantion and ability to hover. Then, for every class the whole map is divided for separated areas, mutually inacessible. It allows for quick check, if a destination can be reached by a unit. The pathinder calculates the best way using Dijkstra algorithm. I have also written detecting coasts, calculating distance to coast and detecting chokepoints. The last thing is, I think, the most interesting. Chokepoints are detected independently for every self - accesible section on a map by invoking pathfinder for every two opposite nodes in currently handled section. Every node has its own 'chokepoint number'. If a path calculated by pathfinder contains a certain node, its chokepoint number is incremented. The higher the number is, the more narrow the place is. All these features can be prewieved by typing .printchoke, .pcoastdist or some other commands in Spring console when TSI 0.24 is running. However most of them are not, or only partially used.
When we have tested TSI 0.24, it usually won with other AIs. But soon later we suspended developing TSI 0.3. Why? For several reasons - lack of time, little people interest, rising another AIs, slower development of Spring and plans for creating OSRTS. Now we have moved to something more interesting than TSI, and if it succeeds, will be more appreciated.

Posted: 16 Jul 2007, 03:22
by AF
Whats your new project?

Most ppl are unaware TSI has KAI style pathfinders, mainly because nobody can read your codebase, prhaps it would have been more popular as a result..

Posted: 16 Jul 2007, 13:57
by tow_dragon
We are not going to reveal what we are currently working on while we have not too much to show. When first tech demo is finished, we will present our program.

Posted: 16 Jul 2007, 15:28
by AF
See that cna be a big problem because that encourages multiple rival projects all being developed without knowledge of eachothers existence, meaning lots of wasted development time and lots of code being sidelined due to lack of popularity resultign in demotivation and possible loss of developers.

It also means a group can go barking up the wrong tree and find out its all for nothing after several months when they could easily have been told in a thread the day they started the project and averted months of wasted time, or sped up development time 100x.

Posted: 16 Jul 2007, 16:56
by tow_dragon
That project has nothing to do with Spring. Anyway, I'm sure that there is no project like ours - the only serious group of people who could do that knows what we are doing.

PS: Let's stop this offtopic, if you have further questions / doubts, please PM.