I don't know how the current AI is designed, so I don't know if my idea of a self-improving AI is applicable at all. Anyway - here it is:
My suggestion is to use an genetic algorithm to improve the behaviour of the computer controlled aliens (for the sake of briefness I use bots from here on). Genetic algorithms (or more general "evolutionary programming) have been around since the early 60ies. The idea is to use some of the mechanisms found in evolution to search a space of possible solutions for the (hopefully) best solution.
Genetic algorithms have been more or less succesfully used on a wide range of problems, from optimising a jet-engine outlay to aligning DNA sequences. I used it once for a set of differential equations that described the metabolism of a bacteria.
Here is the basic idea:
First one would need a way to descipe the behaviour of the bots in a sequential way. A program is a set of sequential orders, so one could run the genetic algorithm directly on the code. However, this would be rather inefficient and would lead to a lot of problems. A much better way is to implement the behaviour in an abstract way. Every bot would have a set of "genes", each gene describing how a bot reacts under certain circumstances. For instance an extremely simple set of genes with very abstract reaction schemes would be:
gene : possible reactions
[under fire] : attack/hide/play dead/lay low/find cover/run away/find ally
[wounded] : attack/hide/play dead/lay low/find cover/run away/find ally
[spotted enemy] : attack/hide/play dead/lay low/find cover/run away/find ally
[been spotted] : attack/hide/play dead/lay low/find cover/run away/find ally
[match start] : attack/hide/play dead/lay low/find cover/run away/find ally
Every bot would then have a set of rules, for instance:
[under fire] : attack
[wounded] : hide
[spotted enemy] : find ally
[been spotted] : hide
[match start] : find cover
(Of course the reaction schemes would have been much more detailed, this is just to make the point.)
For the first fight all bots would have a random set of genes, their "genome". However, for the second fight those genomes with a "higher fitness" would have a higher chance to be drafted for the fight again. Fitness is a measurment of how well the bot performed in the last battle, e.g. damage inflicted + survival time.
So the genomes of those bots that did well have a higher chance to become the genome of a bot in the next fight than those genomes of bots that didn't perform well.
The important part is now that some genomce are changed. Each gene has a certain chance of spontabious mutation, say 0.1%. In addition there are other operations possible, for instance cross-overs between genomes.
An example would look like this:
Imagine 5 bots with the genomes A,B,C,D,E. After the first battle a fitness for each genomce based on the performance of the bots is calculated, and you get something like this.
A - fitness 0.4
B - fitness 0.15
C - fitness 0.1
D - fitness 0.05
E - fitness 0.3
In the next round 10 bots are needed. For each bot a dice is rolled what genome it gets. By chance you would expect something like 4 x A, 1 x C, 3 x E, 2 x B and 0 x D. These genome then undergo mutation, so for instane in one A genome the gene for [wounded] is mutated from "hide" to "attack". In addition information between some genomes is exchanged by crossing over.
After the battle is over, fitness is calculated and the whole thing starts over again.
In practise you would probably need different genome classes for different aliens - a psi-fighter with a genome optimised for a sniper wouldn't do any good.
The genetic algorithm has the advantage that the AI would adapt to different styles of different players. In addition it fits quite nicely into the background story - first the aliens have no clue how to fight the humans, but with more and more battles they learn and "genetically modify" their soldiers to fight better against their enemy.
Edited by Isebrand, 09 November 2003 - 02:34 PM.