AI personalities
#1
Posted 01 March 2005 - 07:57 AM
Just my 2 cents and please don't just reply with 'I checked and the platoon AI was a blast'. This is very subjective. For one its a blast, for the other is a failure.
My suggestion is to be very carefull in balancing the personalities. Don't be too restrictive in SquadLimits for example.
#2
Posted 01 March 2005 - 06:05 PM
Which is why i had to put so much effort into mine. Took forever to get them how I wanted them.
Thankfully I didnt have any problems with the infantry AI at all, it could not only take out a base, it could take out a base with 20+ turrets around it. NP.
Taking on vehicles with infantry was a riot too.
However with the infantry AI the squad limits need to be increased because by default the AI simply doesnt have enough infantry to do the job most of the time.
Giskard
#3
Posted 01 March 2005 - 09:31 PM
Giskard.. I noticed your Infantry Personality is this for SM:
SquadLimits = { standard = { space_marine_squad_force_commander = 1, space_marine_squad_librarian = 1, space_marine_squad_apothecary = 4, space_marine_squad_servitor = 0, space_marine_squad_scout = 0, space_marine_squad_assault = 3, space_marine_squad_tactical = 5, space_marine_squad_devastator = 5, space_marine_squad_terminator = 5, space_marine_squad_terminator_assault = 4, space_marine_squad_dreadnought = 1, space_marine_squad_dreadnought_hellfire = 1, space_marine_squad_rhino = 0, space_marine_squad_whirlwind = 2, space_marine_squad_land_raider = 1, space_marine_squad_land_speeder = 5, space_marine_squad_predator = 1, space_marine_squad_skull_probe = 0, }, assault = { space_marine_squad_force_commander = 1, space_marine_squad_librarian = 1, space_marine_squad_apothecary = 4, space_marine_squad_servitor = 0, space_marine_squad_scout = 1, space_marine_squad_assault = 3, space_marine_squad_tactical = 7, space_marine_squad_devastator = 5, space_marine_squad_terminator = 4, space_marine_squad_terminator_assault = 5, space_marine_squad_dreadnought = 1, space_marine_squad_dreadnought_hellfire = 0, space_marine_squad_rhino = 0, space_marine_squad_whirlwind = 0, space_marine_squad_land_raider = 0, space_marine_squad_land_speeder = 5, space_marine_squad_predator = 1, space_marine_squad_skull_probe = 0,Is "7" the max # that should be used?
Two questions:
1) What does that # equal to? Does it mean # of that squad type at one time in play? If I made all units = 7 (except Commander and uber-units) would that totally overburden the squad limit but force the AI to build everything randomly?
2) Does the AI pick between Standard= and Assault= but not both per game? We can a fourth, firth, sixth, etc right? Assault= is a value not in the scripts right? Standard= the same.. So why did you call it Assault= ? Maybe Infantry= as it is, after all, the Infantry Personality?
Thanks!
Edited by thudo, 01 March 2005 - 09:50 PM.
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#5
Posted 02 March 2005 - 12:18 AM
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#6
Posted 02 March 2005 - 07:10 AM
#7
Posted 02 March 2005 - 01:29 PM
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#8
Posted 02 March 2005 - 03:51 PM
The army list should be seen more as build ratios than actual numbers. The unit cap usually stops it from building them all anyway. I increased mine so mine allows for more but most mods wont have that.
I dont think there is a limit to how high those figures can be set to be honest.
In the above example the AI will try and build 7 tactical for every 3 assault upto the limit defined in the squads own config file. Which for a commander is 1, for medics is 4 i think.
So you bias the AI towards a unit by increasing its value. The bigger the difference from it and the nearest popular unit the more it will make compared to the next popular unit. If you give them all the same value then you basically say "This AI has no preference".
The AI randomly choses its units to build but will never exceed the ratios above. EG if it builds 1 scout first and scouts are set to 1 and the assault has a value of 5, it wont build any more scouts until it has 5 assault squads in play or the first scout dies.
So this system is at least as good for limiting the numbers of certain troops as it is for increasing the amount of other troops. You need to think about both ends of the scale when making a personality.
So think, what do i want to limit, then set those to a low figure, then think what do i want more of and increase that number. If you want the AI to build 2 types of units in even numbers give them both the same number.
You wont garrantee they will build them in exactly the same numbers or alternatively build one then the other. But you do set the AIs target to build equal numbers eventually. Depending how long it takes, the first unit build may still be alive and there for still count towards the total.
Its at this point the other values in the info files come in hardy, you can force the AI to retreat before it loses all its men, thus making sure it always has a few units and can add to them and you can tell it not to attack until it has force of a certain size thus making sure it has a ballanced force when it does attack.
It all works together to make the AI work as a true personality.
Giskard
Edited by giskard, 02 March 2005 - 03:53 PM.
#9
Posted 02 March 2005 - 03:56 PM
Then design your army lists first, test them to make sure the AI starts building because 1 error and it wont do a dam thing. Then tweak the other files to make the AI wait or attack quickly. Stating its min force size for example or setting when it should retreat.
Then move on to the next AI.
Giskard
#10
Posted 02 March 2005 - 04:39 PM
Just to clarify a few things before I finish a 5 HARD Personalities:
attackstrategyinfo.ai
stop_attack_rating = -200,Is the tolerance the AI's squads have before retreating. The lower the # (especially into the negatives) the more likely they will retreat with..
min_units = 2,..this many units still alive in the squad (based on a re-evaluated attack_rating when doing badly in a fight). So if I boost the min_units then they will start retreating when that # is met?
buildbasestrategyinfo.ai
ETA = cost = 150,Never fully understood this value. Need firm clarification on what is ETA and how a higher/lower value changes the AI.
attack_rating = 100The lower this value (even into the negatives) the more likely the AI will not wait to gather forces but will just always attack. Higher the value, the AI will gather its forces until the attack_rating value mentioned above is met, then will attack. Just clarifying.
math.random( 15,20 )How random is this? Does it always work reliability and randomly? Seems the AI goes for the higher values OR is there a case where this script is disallowed to make variables random? Random between those two variables should be random.
Finally..
cpu_manager.ai
function CpuManager:GetDefensiveBuildingsCostAt( player, pos, tolerance ) profile_start( "GetDefensiveCost" ) local cost = 0 local tolerance_sqr = tolerance*tolerance --for every defensive building in range, add 250 for building in player:GetBuildingsWithGuns() do  if distance_sqr( building:GetPosition(), pos ) < tolerance_sqr then  cost = cost + 250  end end profile_end( "GetDefensiveCost" ) return costThe higher the "cost + xxx" the less likely the AI will attack when it sees too many enemy turrets its target enemy has. This is based on the cost = line mentioned above in buildbasestrategyinfo.ai? Basically, want to ensure some personalities see a turret and act fearless running into them as if suicidial. heheh.
Otherwise, understand your comments and will ensure they get done.
Edited by thudo, 02 March 2005 - 04:47 PM.
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#11
Posted 02 March 2005 - 06:17 PM
Essentially.. I've about finished the 5 HARD personalities and will now endeavour to do the HARDER/INSANE ones (both are together so in total its 30files to edit.. better than 45.. esssh!).
Just to clarify a few things before I finish a 5 HARD Personalities:
attackstrategyinfo.aistop_attack_rating = -200,Is the tolerance the AI's squads have before retreating. The lower the # (especially into the negatives) the more likely they will retreat with..
Yes. Its pro rated so a basic marine squad is worth 450. If you set it to -450 it translates to : Retreat if my army is one marine squad less worth than enemies.
min_units = 2,..this many units still alive in the squad (based on a re-evaluated attack_rating when doing badly in a fight). So if I boost the min_units then they will start retreating when that # is met?
No. Minimum number of squads I need to attack.
buildbasestrategyinfo.ai
ETA = cost = 150,Never fully understood this value. Need firm clarification on what is ETA and how a higher/lower value changes the AI.
You have to understand the concept of BuidNow() and BuildLater(). Its not that easy. ETA only affects BuildLater() and the AI has to have ETA amount of req to build stuff for later. BuildNow()/Later() are used to evaluate what squads to build. BuildLater() will allow to build squads which have prerequisites like aspect stones not already build. I lowered ETA for eldar so they have easier access to BuildLater().
attack_rating = 100The lower this value (even into the negatives) the more likely the AI will not wait to gather forces but will just always attack. Higher the value, the AI will gather its forces until the attack_rating value mentioned above is met, then will attack. Just clarifying.
Comparable to stop_attack_rating its the pro rated value to initiate attacks. A value of 450 translates to "attack when my army is one marine squad stronger than enemy"
math.random( 15,20 )How random is this? Does it always work reliability and randomly? Seems the AI goes for the higher values OR is there a case where this script is disallowed to make variables random? Random between those two variables should be random.
It should work, giving random from 15 to 20.
Finally..
cpu_manager.aifunction CpuManager:GetDefensiveBuildingsCostAt( player, pos, tolerance ) profile_start( "GetDefensiveCost" ) local cost = 0 local tolerance_sqr = tolerance*tolerance --for every defensive building in range, add 250 for building in player:GetBuildingsWithGuns() do  if distance_sqr( building:GetPosition(), pos ) < tolerance_sqr then  cost = cost + 250  end end profile_end( "GetDefensiveCost" ) return costThe higher the "cost + xxx" the less likely the AI will attack when it sees too many enemy turrets its target enemy has. This is based on the cost = line mentioned above in buildbasestrategyinfo.ai? Basically, want to ensure some personalities see a turret and act fearless running into them as if suicidial. heheh.
2 turrets/defensive buildings are worth about a basic marine squad. If you want the AI to ignore them set 250 to 0. If you want to be atracted by turrets set it to -250
#12
Posted 02 March 2005 - 06:23 PM
Question1
stop_attack_rating = -200,
This is AIs attack rating vs its opponent, so in this case it retreats when it is -200 pts below the enemy rating. EG when the enemy out number it. If it has a stop attack rating of +200, it would retreat before it became weaker than the enemy.
Question 2
min_units = 2,
Basically right but the 2 units here may not part of the attack force, he may be using them else where and thus have no effect on any single battle. Of course it may use them in a battle too and thus have an effect.
Question 3
ETA =
cost = 150,
This is used to calculate the time it takes to build a unit based on several factors. If a unit takes too long it uses the ETA to skip production. Or something like that.
The ETA is linked to the Build later function which i set to true all the time in my mod so ETA becomes a little obselete in my mod.
Question 4
attack_rating = 100
High values raise the rating needed before the AI is allowed to attack. Try setting this to 500 and then watch how the AI avoids combat in the early game. Ive seen AIs ive tested run right past each other without firing a shot with a rating of 500. At 100 they start shooting with the first squad of scouts. At 500 the AI still defends it base but can be seen to move a safer area when fighting back rather than starting in the middile of the line of fire of several enemy units. EG it moves to the side to focus on one unit at a time and reduce the fire it takes back.
I think the unit cost is the rating used here, Larkin should have a better understanding of this to be honest since he delved into the rating system deeper than i did. EG his pro rating threads.
Question 5:
math.random( 15,20 )
Yes this works pretty well, it always choses a number between those values randomly. I ran several tests and always got a different result both low and high. No pattern that i could see. The random seed is taken from the players own motherboards current time and multiplayed by another value to create the random functions.
Question 6
Just looked at code, and I watched the AIs reaction to lots of turrets so i'll answer using what ive seen the AI do.
Before building turrets the AI would throw anything at my front line, 1 squad of scouts or something equally as weak.
After building turrets it would generally not attack without anything but a decent size force. Something that could actually damage my base.
So i think your right, certainly reads that way but im not 100% sure.
Giskard
Edited by giskard, 02 March 2005 - 06:24 PM.
#13
Posted 02 March 2005 - 06:34 PM
Question 2
min_units = 2,
Basically right but the 2 units here may not part of the attack force, he may be using them else where and thus have no effect on any single battle. Of course it may use them in a battle too and thus have an effect.
No. He isn't basically right :
--attack if I have enough people if num_at_gather_pt >= self.min_units then Plan.SetState( self, "Attack!", AttackPlan.Attack ) return end
As you can see its the minimum number of units at gather point needed to initiate attack.
#14
Posted 02 March 2005 - 08:55 PM
But it is a check for all attacks and sometimes its completely ignored depending on the type of game being played. You should have quoted the entire function and the calling function to show how it worked.
EG
self.attack_plan = AttackPlan( enemy, self.enemy_pos, start_pos, min_units, self.info.max_army_percentage )
self:AddPlan( self.attack_plan )
from attackstrategy.ai
Thudo would then have been able to trace it him self.
Giskard
#15 Guest_Guest_*
Posted 03 March 2005 - 06:35 AM
Yup you are right Larkin.
But it is a check for all attacks and sometimes its completely ignored depending on the type of game being played. You should have quoted the entire function and the calling function to show how it worked.
EG
self.attack_plan = AttackPlan( enemy, self.enemy_pos, start_pos, min_units, self.info.max_army_percentage )
self:AddPlan( self.attack_plan )
from attackstrategy.ai
Thudo would then have been able to trace it him self.
Giskard
Its only ignored while taking back a victory location which is unimportant regarding his question. Why shall I quote the entire function and the calling function ? Like you did for your exlpanation ? Lets stop this now. It seems you don't like being corrected even if the style is not rude .
#16
Posted 03 March 2005 - 10:10 AM
I see you being as helpful as ever. Same old Larkin that said Thudo couldnt code and then said I couldnt code. There seems to be pattern here.
Just like in my personalities thread, your response is not helpful, its arguementive.
You have said im wrong and left Thudo to find the file you got your examples from on his own.
Where as I was answering direct questions he asked using quotes he supplied. So he already knew where they came from.
You see, unlike you I believe Thudo can code and if he sees the function your refering too will be able read it him self and see exactly how it works and perhaps even god forbid improve on the idea i first presented as a result.
Its called Respect, in this case, respecting Thudo own abilities without question. If he needs help he will get a respectful answer from me and no judgement will be made as to his abilities when I do answer his question.
He can be as noobish or as expert has he likes.
Im not his judge and im not in compition with him.
I am however enjoying the experience of sharing ideas with Thudo.
So please leave your ego at home.
Giskard
#17 Guest_Guest_*
Posted 03 March 2005 - 10:37 AM
Thudo had questions, I had answers. Its easy as this. Btw nobody can leave his/her ego at home, its always in your back even if you don't notice ;-)
Reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users