Universal AI Mod Support
Moderator: Moderators
Universal AI Mod Support
Right now I have a system devised for universal dynamic building in NTAI that isnt mod dependant and doesnt need config files.
I'm going to give every unit type a score of how well ti fits a purpose.
Purposes/types of untis such as
ARTILLERY, SCOUT, CON, ENERGY etc.
While some such as energy are simply a combination of their output weighted by their cost, others are more problematic.
For exampel I need to take into acocunt trajectory possibilities, fire rate, how many weapons, weapons range, speed etc for attack units.
Moreover how do i distinguish a scout from an attack unit? If that scouter ahs a light weapon that that makes a very eays job a lot more cumbersome.
So are there any thigns I should know before I get to work on algorithms, as I'm not an expert at all in this particular part, and someone who'se balanced or made a mod might knwo a lot more about it. So what sort of algorithms would generalize the sorts of thigns I should be using?
I'm going to give every unit type a score of how well ti fits a purpose.
Purposes/types of untis such as
ARTILLERY, SCOUT, CON, ENERGY etc.
While some such as energy are simply a combination of their output weighted by their cost, others are more problematic.
For exampel I need to take into acocunt trajectory possibilities, fire rate, how many weapons, weapons range, speed etc for attack units.
Moreover how do i distinguish a scout from an attack unit? If that scouter ahs a light weapon that that makes a very eays job a lot more cumbersome.
So are there any thigns I should know before I get to work on algorithms, as I'm not an expert at all in this particular part, and someone who'se balanced or made a mod might knwo a lot more about it. So what sort of algorithms would generalize the sorts of thigns I should be using?
no idea...maybe e income >10 should work for energy. has nanolathe, not stationary should work for builders range >1000 should be mostly arty (and merls etc, u know kind of arty) scouts have the highest speed rate of their unit class. support units/skirmishers have middleish HP moderate range and a moderately powerful weapon as their primary. super-heavy units have a high HP and powerful weapon, cannon fodder have high HP and weak weapon, LRPCs obviously have a huge range >3000 ish and cruise missiles have slightly longer range, nukes have 32,000 range, comms have a DGun as their weapon.
thats all i could think of, sorry about the lack of figures
thats all i could think of, sorry about the lack of figures
commanders are easy there's a tag for them.
The engine sorta allieviates the mex bit, as metal extractors u->extractsmetal=true.
The energy bit would leave carriers being built primarily for energy, aswell as a few construction untis that produce 10+ energy.
The spy kbot may not show up as a scout if I simply go for the fastest. And zippers and freakers have uses other than scouting.
The engine sorta allieviates the mex bit, as metal extractors u->extractsmetal=true.
The energy bit would leave carriers being built primarily for energy, aswell as a few construction untis that produce 10+ energy.
The spy kbot may not show up as a scout if I simply go for the fastest. And zippers and freakers have uses other than scouting.
Scout units can be determined by their speed. Whatever the fastest unit is in a given menu, it's a scout. IMO, spy kbots won't be used properly by an AI anyway. How can you tell the AI to try to avoid enemy contact while searching for high-value structures? If that's possible, you could tell a spy kbot because it will have cloaking and no weapons.
For weapon value, take the weapons a unit has and figure out their combined damage per second. Make sure to take into account weapons which have burst firing. Aironly weapons on ground units should be disregarded from the equation. You can tell for sure if something is an air unit or not because only air units will have "canfly=1;" in their fbi.
Also you need to make it so that there's a tag we can put in FBI files which will force the AI engine to ignore them. Sort of like how you could set the weight and limit in a TA fbi file to 0.
Any mobile unit that has a hightrajectory tag will be artillery. Any unit equipped only with a vertical-launch rocket is rocket artillery.
Obviously any unit with builder=1; is a con unit.
The AI can determine what would be the best energy structure in a given situation to built if it's low on energy by dividing the building's metal cost by its energy output. The lower the number, the better.
Any anti-air unit will have either missiles with a high turn rate or a line of sight plasma gun with high velocity (650+) and burnblow=1;.
In the early game the ai should built short-ranged units preferentially over ranged units with a 2:1 ratio. In the late game this should eventually swing over to 1:1.5.
I don't know if this is possible, but can you tell the AI to occasionally choose paths with high movement cost, especially for cheap level 1 kbots? For instance, on a map like small divide this might tell it to attack over the mountain rather than through the ravine with a couple dozen AKs or peewees.
No idea how you'd tell the AI to build a fusion reactor even though ultimately it's the most expensive way to get energy if you're talking straight statistics. Maybe by putting a unit's footprint into the equation somehow?
For weapon value, take the weapons a unit has and figure out their combined damage per second. Make sure to take into account weapons which have burst firing. Aironly weapons on ground units should be disregarded from the equation. You can tell for sure if something is an air unit or not because only air units will have "canfly=1;" in their fbi.
Also you need to make it so that there's a tag we can put in FBI files which will force the AI engine to ignore them. Sort of like how you could set the weight and limit in a TA fbi file to 0.
Any mobile unit that has a hightrajectory tag will be artillery. Any unit equipped only with a vertical-launch rocket is rocket artillery.
Obviously any unit with builder=1; is a con unit.
The AI can determine what would be the best energy structure in a given situation to built if it's low on energy by dividing the building's metal cost by its energy output. The lower the number, the better.
Any anti-air unit will have either missiles with a high turn rate or a line of sight plasma gun with high velocity (650+) and burnblow=1;.
In the early game the ai should built short-ranged units preferentially over ranged units with a 2:1 ratio. In the late game this should eventually swing over to 1:1.5.
I don't know if this is possible, but can you tell the AI to occasionally choose paths with high movement cost, especially for cheap level 1 kbots? For instance, on a map like small divide this might tell it to attack over the mountain rather than through the ravine with a couple dozen AKs or peewees.
No idea how you'd tell the AI to build a fusion reactor even though ultimately it's the most expensive way to get energy if you're talking straight statistics. Maybe by putting a unit's footprint into the equation somehow?
Last edited by Caydr on 09 Nov 2005, 00:28, edited 1 time in total.
- Lindir The Green
- Posts: 815
- Joined: 04 May 2005, 15:09
If its damage per second is less than some value based on the median hp of units AND it can't build anything AND it can move THEN it is a scout.
If it can build anything THEN it is a construction unit.
If it has a +10 energy income AND it can't build anything THEN it is an energy unit
If it can't move AND it can't build anything AND it doesn't have a +20 energy income AND it has a weapon THEN it is a defensive structure.
you could probably come up with a raw cost of something by using (metal cost + 60 * e cost) and then use it along with HP and (median HP of units in mod/damage per second) and (median speed of moving units in mod/speed) and (median range of attacking units/range) to classify a unit as artillary/assault/heavy assault ect.
edit: I think that fusions are actually cheaper for the amount of e they produce, otherwise people wouldn't build something that comes online so long after you start constructing it.
If it can build anything THEN it is a construction unit.
If it has a +10 energy income AND it can't build anything THEN it is an energy unit
If it can't move AND it can't build anything AND it doesn't have a +20 energy income AND it has a weapon THEN it is a defensive structure.
you could probably come up with a raw cost of something by using (metal cost + 60 * e cost) and then use it along with HP and (median HP of units in mod/damage per second) and (median speed of moving units in mod/speed) and (median range of attacking units/range) to classify a unit as artillary/assault/heavy assault ect.
edit: I think that fusions are actually cheaper for the amount of e they produce, otherwise people wouldn't build something that comes online so long after you start constructing it.
yay! I'll experiment around but those are much better starting points, much much better.
^_^
As for pathfinding, what you suggested by making untis go over the mountain is possible by fiddling the pathfinding functions. However I have feature splanned all the way up too 0.5, so by 0.5 the AI will know what path the enemy is likely to take, what path is the quickest, which path is the least likely to be seen, and the path the enemy has the least amount of firepower against. e.g over the mountains....
^_^
As for pathfinding, what you suggested by making untis go over the mountain is possible by fiddling the pathfinding functions. However I have feature splanned all the way up too 0.5, so by 0.5 the AI will know what path the enemy is likely to take, what path is the quickest, which path is the least likely to be seen, and the path the enemy has the least amount of firepower against. e.g over the mountains....
- GrOuNd_ZeRo
- Posts: 1370
- Joined: 30 Apr 2005, 01:10
Well, I guess yuritch is right, high LOS means scout unit.
Please keep real life mods in account and other mods, many units in TA:FF have alot of energy production for example.
Zippers and other fast units could be used by the AI as Artillery and Sniper spotters, so can Scout/Recon units.
But how would it keep into account mods with very high weapon damages or extremes rather? well, I guess i'll just have to see how it goes...
Please keep real life mods in account and other mods, many units in TA:FF have alot of energy production for example.
Zippers and other fast units could be used by the AI as Artillery and Sniper spotters, so can Scout/Recon units.
But how would it keep into account mods with very high weapon damages or extremes rather? well, I guess i'll just have to see how it goes...
what if instead of using these universal unit-class definitions suggested above, each mod-maker has the option of being able to define these classes himself, uniquely for the mod?Ground Zero wrote:Please keep real life mods in account and other mods, many units in TA:FF have alot of energy production for example.
...
But how would it keep into account mods with very high weapon damages or extremes rather? well, I guess i'll just have to see how it goes...
Due to an AI itnerface, it should be easy to add AI tags that only the AI reads. As long as your units fbi has the same name as it does in the engine, so no CORGOL taking the filename goliath.fbi type things.
Maybe I should set up 2 tags, type= and score =.
If not you could always use the TEDClass tag to apssover info.
How its done I'll leave for you to decide what suites you best.
Maybe I should set up 2 tags, type= and score =.
If not you could always use the TEDClass tag to apssover info.
How its done I'll leave for you to decide what suites you best.