Very interesting topic.
I'll put my two cents in:
Context
is everything. Figuring out how something happened is the biggest barrier to AI learning. What is an "event" is much harder than interpreting it once you have it.
If 20 peewees, 10 Hammers, a Jethro, and a flea are ordered to attack a LLT position and there are two mexxes and two HLTs nearby that wipes them all out, while a couple AKs and a storm die two, how would that get boiled down? What happened? Would the AI say that attacking LLTs with those units was a mistake? That AKs should be feared? That mexxes were the deciding factor?
A human can say that the couple HLTs were all important, and that the few enemy kbots were irrelevant, as were the mexxes, but an AI has trouble with this, as well as figuring out how similiar, but differently composed groups might have handled it. What about 15 peewees and 15 hammers? Or two more Jethros? What if a Bulldog was added to the mix?
Before any serious learning can be done, the AI's have to have a way of figuring out what happened, how to understand what went wrong. That might be by seeing which types of units inflicted the most damage, and targeting those kind first next time.
I'd say some more comprehensive form of unit value is needed. Something like:
Code: Select all
Value = (Damage + D) / (TimePerShot) * (Speed + S) / (Cost + C) * (Health + H) / (BuildTime + BT)
And then additional values for workertime, flight, weapon range, etc. could be added to it.
D, S, C, H, and BT would be set to decrease the impact of certain stats. We might put S at 10 if we wanted a unit with 20 Speed to be twice as valuable as a unit with only 5 Speed, all else being equal.
Of course, health and damage are subject to changes, via armor.txt, so they might have to be taken into consideration on a case-by-case basis.
Anyway, we can then create an aggregate value for a group of units. Something like this:
Code: Select all
for each unit
TotalValue += UnitValue
TotalValue *= 1.00 - (NumUnits) // Or something better
TotalValue is reduced to compensate for the inherently lower efficiency of a swarm of units that all get in each other's way.
Then, we would have to have the AI track the life and death of this squad of units as it is built, organized, deployed, and destroyed and remember how all of these things happened so that it will do better next time.
Assuming all of that is possible, the AI will have to rate the squad versus all of the groups it faced and grade the encounter. Absurd ones would have to be ignored.
Code: Select all
If(EnemyValue < MyValue / 10)
Ignore
else
Grade = EnemyLosses/(MyLosses + EnemyLosses)
20 Peewees kill 1 AK, little damage: (Ignore)
20 Peewees kill 1 Mex: (Ignore)
20 Peewees kill 1 LLT, lose two peewees: B
etc, etc.
When the squad's gone, all of it's grades are tallied up and reified. If the squad did poorly vs. air units, it's likelyhood of being built in response to air attacks would be reduced. If it did well, it would be increased. A log of all recent grades would be kept and averaged for each encounter type. The oldest grades would be tossed out to prevent overtraining.
Most of the groundwork for this would have to be laid by the programmer and/or modmaker.
Also, squads could be formed into armies to simplify things. If air units are expected, an AA squad could be attached to it. If defenses are, artillery could be added. Scouts could be added, as well, though rating how good they are at scouting would be difficult. Attempts could be made to hold formation, but clogging is always a problem.
Anyway, that's what I think would need to be done before any serious AI learning is possible.