Jump to content


Photo

AI personalities


16 replies to this topic

#1 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 01 March 2005 - 07:57 AM

I think its a good idea to have diversity BUT there is a big problem at harder/insane. Players choosing these skill levels usually know what they are doing and have good playing skills. AI personalities add diversity but are weaker than a single optimized AI. Selecting AI to be 'platoon' (more infantry/less vehicles) is a limitation and you should know that. It doesn't make the AI stronger at all and it will be beaten more often. Also think about different AIs as allys. If their personalities differ they are not good in supporting each other.

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 giskard

giskard
  • Members
  • 155 posts

Posted 01 March 2005 - 06:05 PM

Yup Ballancing is the key.
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 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 01 March 2005 - 09:31 PM

Actually, Larkin, I play with a guy WHO ONLY PLAYS SM and who only only builds Scout, Marine Squads, and Dreads and thats it! He will deepstrike the occasional Terminator squad or Dread but this would be a cool prime example of an AI selectively using more troops than vehicles as a PLATOON PERSONALITY. I was thinking about it on the way to work this morning after I read this thread and thought: hey, my buddy builds only troops and a few dreads so why not try to concentrate there? I'm testing it and it should be damn cool.

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.

Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#4 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 01 March 2005 - 09:50 PM

If your buddy only builds scouts, space marines and dreads he will most likely loose to many competent players. So will an AI doing the same.

Edited by LarkinVB, 01 March 2005 - 09:50 PM.


#5 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 02 March 2005 - 12:18 AM

I doubt it bud. Squads (armed with multiple weapons + snipers) and Dreads are well rounded. LandRaiders and Preds are nice and all but throw in a FC with Oribital Bombardment and Librarian for Morale boosting and you got a force to be reckoned within. Even you can admit, that its NOT THE FORCE you use but HOW its used and pure Infantry with some vehicles can win. I've seen it. Vehicles (aka Dreads) do figure in though so its not pure infantry although 8-10 squads of multi-functional infantry can be castrophic. No?
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#6 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 02 March 2005 - 07:10 AM

Well. Its just my oppinion but - no. Ask in the relic forum if you can win with such a force against good players if you don't trust me. A good player can be dangerous with such a force but the AI isn't a good player. Therefore you force a limitation which will make the AI weaker. But it will loose with personality and style :unsure:

#7 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 02 March 2005 - 01:29 PM

It certainly will have "personality'. :unsure:
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#8 giskard

giskard
  • Members
  • 155 posts

Posted 02 March 2005 - 03:51 PM

Thudo:

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 giskard

giskard
  • Members
  • 155 posts

Posted 02 March 2005 - 03:56 PM

Actually if you want my advice, take a look at my cpu manager code that called the AI for a way to test them one at a time.

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 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 02 March 2005 - 04:39 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.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 = 100
The 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 cost
The 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.

Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#11 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

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.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..


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 = 100
The 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.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 cost
The 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 giskard

giskard
  • Members
  • 155 posts

Posted 02 March 2005 - 06:23 PM

Hello Thudo.

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 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

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 giskard

giskard
  • Members
  • 155 posts

Posted 02 March 2005 - 08:55 PM

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

#15 Guest_Guest_*

Guest_Guest_*
  • Guests

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

<{POST_SNAPBACK}>


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 giskard

giskard
  • Members
  • 155 posts

Posted 03 March 2005 - 10:10 AM

Larkin:

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_*

Guest_Guest_*
  • Guests

Posted 03 March 2005 - 10:37 AM

If you follow this thread closely you will notice I answered his question non argumentative. Reads my answer just below his question. Then I commented on your answer as it was wrong (non argumentative again) and showed proof with a code snippet. Whats your problem here ?

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