5 Matrix AI proposal [Comments and Criticism encouraged]
Posted: 21 Mar 2005, 18:10
In response to other AI proposals, I am bringing this one to the table. In order to provide a suitable challenge for an opponent, an AI must be able to both attack and defend itself. In keeping with TA's online community, I propose this AI be able to defend itself with mobile units. Choosing what and where to defend will be a product of the Threat, Value, and Defensive matrices. Where and when to attack, and what to attack, will encompass the Value, and Offensive matrices. Building will occur using the Value, Threat, and Defensive matrices, as well as the Build Matrix.
Threat Matrix: This is the unit/building value command center. This keeps track of all units in the game, with individual tags denoting which AI's can see them, and which cannot. From here, values are determined including health, type, position, and experience. Health and type determine defensive value, type and experience determines offensive value. See Note 1. These two values are determined for each side, and each sector. So that:
[Sector X,Y]
Combat 1= OffValA XX DefVal ZZ
Combat 2= OffValA XX DefVal ZZ
etc...
As well, this keeps track of who has what units in a sector, and provides a control percentage, those with allied controls of 50% or less, are considered hot combat zones.
Value Matrix: This is the matrix that keeps track of the metal and energy that can be harvested from the square, if it were entirely covered with Metal Extractors, or Solar Collectors, or Tidal Generators. This generates values for the defensive matrix, including defensive value of the square, as in how much resources are there, and how valuable it is, and offensive value of the units inside it. The latter is modded by how much the AI can see in the square. See also Note 1. The values are determined for each sector, but only offensive values are determined for each side, so:
[Sector X,Y] Value: AA
Combat 1=OffvalB XX
Combat 2=OffvalB XX
and so on...
Offensive Matrix: This is the combat control matrix, which processes relevant information, and uses it to direct forces offensively against any and all opponents. Offensive values, both A, and B, are taken into account, as well as the Defensive values. Values for attacking forces are calculated for each unit to be brought to bear into battle. If the defensive values of the opposing forces, are overwhelmed by the offensive values of the attacking forces then the attack goes ahead. If the values are within fifty points of each other, then the combined known offensive values of the opposition is compared to the defensive values of the allied attacking units. If the defensive number is within fifty of the offensive number, the attack goes ahead. If it's greater than fifty, then it goes ahead. If less than fifty, then additional forces are called from nearby factories, or locations. If the defensive value of the opposing force is fifty or more greater than the offensive value of the attacking force, then additional forces are called up. See also Note 1. So:
[Sector X,Y] DefVal XX
If AttOffVal > +50 [Sector X,Y] DefVal
Then attack.
If AttOffVal > +50/-50 [Sector X,Y] DefVal
Then check Sector OffVal >< AttDefVal.
If AttOffVal -50 < [Sector X,Y] DefVal
Then Call Forces
Defensive Matrix: This is the base defense control matrix. This locates high value areas, with low offensive values, and looks for areas with low value, high offense, and mobile units to be moved into the higher value areas. If none are found within range, then the build matrix receives the go ahead to build standing defenses, in the form of Missile Towers, and guardians, or what have you... Defensive units are also called up from this matrix, taking advantage of close by plants, that might be inactive, or in the process of being down graded. Plants exist in three call stages. Active Combat, Active Build, Inactive Salvage. Active Combat plants are those within two screens of a hot zone, and producing combat units. Active Build plants, are considered to be outside the hot zone, but under control of the Build Matrix, and creating defensive, or construction units. Inactive Salvage plants are free for whoever takes them, be it the Build Matrix, Defensive Matrix, or the Offensive Matrix, or even the construction units reclaiming it. The Defensive Matrix also controls combat patrol, and combat guard order assignment.
Build Matrix: This is the command and control center of the AI. It's the overlord of everything. Modifying this changes the entire strategy of the AI system. All other Matrix grids are one full screen in size, but the Build Matrix deals with grids the same size as the foot print of a Dragon's Tooth. Each square includes certain information about itself in a packet that is updated when the information changes, and is used to determine if an area is suitable to be built on. These include the following parameters:
Terrain Type
Elevation
Slope
Metal
Features
Obstructions
Terrain Type is obvious, since you can't build Tidals on land, or Solars on the sea.
Elevation is determined on all four sides, in relation to adjoining squares.
Slope is the difference in each side, and is also effected by cross joined squares, such as those on an angle.
Metal is a yes or no question.
Features are things such as Geothermal vents as well as Mexx radii. The latter has two variables. Mex, and Moho. If Mex is tripped, the Moho will still be built by the AI. If Moho is tripped, Mex is tripped by default.
Obstruction is simple, and complex at the same time. An obstructed square can be one of two things. Obstructed Reclaimable (OR), or Obstructed Unreclaimable (OU). OR objects are trees, rocks, unit wrecks, enemy buildings. OU objects are friendly buildings, anything without an assigned metal or energy value, and certain units, like the commander.
The Build Matrix also controls patrol and guard orders for construction vehicles, and is the final authority on build requests, with direct command over dispensation of resources. The Matrix also directs the other Matrices in where to go next during neutral phases, and controls scouting, and radar/sonar coverage. Units detected on Radar and Sonar are determined to have a single value for offense, and defense, until they are in sight. Radar values, are different from units only on Sonar. This Matrix also controls the final strategy of the entire AI. If the Build Matrix is balanced to build naval units, then the entire AI is naval. If it is balanced towards air, then the AI is an air power.
This AI has two known flaws, that I cannot see a way around, though I am not a programmer. It also has one major flaw.
The first of the lesser flaws, is radar and sonar. Because it cannot see everything it has to rely on radar, and sonar, and the blanket values are not very accurate, where as a human has the ability to guess what's there.
The second of the lesser flaws, is working around Springs collision, and strike detection system. With TA's bounding boxes, this wouldn't have been a problem, but the radial damage detection is problematic.
The Major Flaw, is combat control. I don't have any way to make the units fight other units, without slamming head first into that bloody friendly fire problem.
Help with any, and all of these flaws, as well as pointing out any I missed, would be very much appreciated.
Threat Matrix: This is the unit/building value command center. This keeps track of all units in the game, with individual tags denoting which AI's can see them, and which cannot. From here, values are determined including health, type, position, and experience. Health and type determine defensive value, type and experience determines offensive value. See Note 1. These two values are determined for each side, and each sector. So that:
[Sector X,Y]
Combat 1= OffValA XX DefVal ZZ
Combat 2= OffValA XX DefVal ZZ
etc...
As well, this keeps track of who has what units in a sector, and provides a control percentage, those with allied controls of 50% or less, are considered hot combat zones.
Value Matrix: This is the matrix that keeps track of the metal and energy that can be harvested from the square, if it were entirely covered with Metal Extractors, or Solar Collectors, or Tidal Generators. This generates values for the defensive matrix, including defensive value of the square, as in how much resources are there, and how valuable it is, and offensive value of the units inside it. The latter is modded by how much the AI can see in the square. See also Note 1. The values are determined for each sector, but only offensive values are determined for each side, so:
[Sector X,Y] Value: AA
Combat 1=OffvalB XX
Combat 2=OffvalB XX
and so on...
Offensive Matrix: This is the combat control matrix, which processes relevant information, and uses it to direct forces offensively against any and all opponents. Offensive values, both A, and B, are taken into account, as well as the Defensive values. Values for attacking forces are calculated for each unit to be brought to bear into battle. If the defensive values of the opposing forces, are overwhelmed by the offensive values of the attacking forces then the attack goes ahead. If the values are within fifty points of each other, then the combined known offensive values of the opposition is compared to the defensive values of the allied attacking units. If the defensive number is within fifty of the offensive number, the attack goes ahead. If it's greater than fifty, then it goes ahead. If less than fifty, then additional forces are called from nearby factories, or locations. If the defensive value of the opposing force is fifty or more greater than the offensive value of the attacking force, then additional forces are called up. See also Note 1. So:
[Sector X,Y] DefVal XX
If AttOffVal > +50 [Sector X,Y] DefVal
Then attack.
If AttOffVal > +50/-50 [Sector X,Y] DefVal
Then check Sector OffVal >< AttDefVal.
If AttOffVal -50 < [Sector X,Y] DefVal
Then Call Forces
Defensive Matrix: This is the base defense control matrix. This locates high value areas, with low offensive values, and looks for areas with low value, high offense, and mobile units to be moved into the higher value areas. If none are found within range, then the build matrix receives the go ahead to build standing defenses, in the form of Missile Towers, and guardians, or what have you... Defensive units are also called up from this matrix, taking advantage of close by plants, that might be inactive, or in the process of being down graded. Plants exist in three call stages. Active Combat, Active Build, Inactive Salvage. Active Combat plants are those within two screens of a hot zone, and producing combat units. Active Build plants, are considered to be outside the hot zone, but under control of the Build Matrix, and creating defensive, or construction units. Inactive Salvage plants are free for whoever takes them, be it the Build Matrix, Defensive Matrix, or the Offensive Matrix, or even the construction units reclaiming it. The Defensive Matrix also controls combat patrol, and combat guard order assignment.
Build Matrix: This is the command and control center of the AI. It's the overlord of everything. Modifying this changes the entire strategy of the AI system. All other Matrix grids are one full screen in size, but the Build Matrix deals with grids the same size as the foot print of a Dragon's Tooth. Each square includes certain information about itself in a packet that is updated when the information changes, and is used to determine if an area is suitable to be built on. These include the following parameters:
Terrain Type
Elevation
Slope
Metal
Features
Obstructions
Terrain Type is obvious, since you can't build Tidals on land, or Solars on the sea.
Elevation is determined on all four sides, in relation to adjoining squares.
Slope is the difference in each side, and is also effected by cross joined squares, such as those on an angle.
Metal is a yes or no question.
Features are things such as Geothermal vents as well as Mexx radii. The latter has two variables. Mex, and Moho. If Mex is tripped, the Moho will still be built by the AI. If Moho is tripped, Mex is tripped by default.
Obstruction is simple, and complex at the same time. An obstructed square can be one of two things. Obstructed Reclaimable (OR), or Obstructed Unreclaimable (OU). OR objects are trees, rocks, unit wrecks, enemy buildings. OU objects are friendly buildings, anything without an assigned metal or energy value, and certain units, like the commander.
The Build Matrix also controls patrol and guard orders for construction vehicles, and is the final authority on build requests, with direct command over dispensation of resources. The Matrix also directs the other Matrices in where to go next during neutral phases, and controls scouting, and radar/sonar coverage. Units detected on Radar and Sonar are determined to have a single value for offense, and defense, until they are in sight. Radar values, are different from units only on Sonar. This Matrix also controls the final strategy of the entire AI. If the Build Matrix is balanced to build naval units, then the entire AI is naval. If it is balanced towards air, then the AI is an air power.
This AI has two known flaws, that I cannot see a way around, though I am not a programmer. It also has one major flaw.
The first of the lesser flaws, is radar and sonar. Because it cannot see everything it has to rely on radar, and sonar, and the blanket values are not very accurate, where as a human has the ability to guess what's there.
The second of the lesser flaws, is working around Springs collision, and strike detection system. With TA's bounding boxes, this wouldn't have been a problem, but the radial damage detection is problematic.
The Major Flaw, is combat control. I don't have any way to make the units fight other units, without slamming head first into that bloody friendly fire problem.
Help with any, and all of these flaws, as well as pointing out any I missed, would be very much appreciated.