Jump to content


Photo

Multiple AI Tactics


34 replies to this topic

#1 giskard

giskard
  • Members
  • 155 posts

Posted 18 February 2005 - 06:51 PM

Hello all.

Rather than argue over turrets which is really one tactic open to the AI and it should have many tactics and not just one. I thought id start a thread aimed at producing an AI that is smarter than any typical RTSGs AIs (Total War has the best battle AI ive ever seen so this is my target, doubtful i can match it but trying will be fun).

My objective here
Have the AI choose a tactic, build queue and armylist that compliment each other rather than the same build queue and then choose a tactic approach.

Helpful clues that exist already to aid me in this effort.

Check out the difficulty level files, especially the insane ones and look for the script that calls these.

I believe its the buildbasestrategy that does all the work here so thats the file that will need to do most of the work but there are other files too that may be of help.

Theories on how to achieve this

In CPU manager check out this function

function CpuManager:Initialize()

In paticular these bits.

self.player_stats:GetPlayerRaceName() == "ork_race" or
  self.player_stats:GetPlayerRaceName() == "chaos_marine_race" or
  self.player_stats:GetPlayerRaceName() == "eldar_race") then


Notice how the race VAR matches the name of a race used in the difficulty level scripts such as BuildOrderStrategyInfo for Advanced. So what i think we are looking at is a method of controling the initial build queue. The AIs starting queue.

Perhaps some kind of array may work here to allow multiple starting queues.

EG chaos_marine_race(1) or chaos_marine_race(2) then have the array choose the initial build queue and carry the array value over for the update section too which calls individual race functions to build stuff.

(It should be noted that the squadlimits var falls under the same race var name used above. So control one and you control all entries that use the race vars)

So all you need really is multiple entries for various build queue items. One AI might want 3 vehicle labs where as another might not build any.

The advanced stuff is done via the update entries in various files so this part is dead easy.

Linking it to an army list however is the tricky part but again a global var may work here.

Giskard

Edited by giskard, 18 February 2005 - 06:54 PM.


#2 giskard

giskard
  • Members
  • 155 posts

Posted 18 February 2005 - 07:07 PM

Scratch that, found a way to control what the AI initially does.

Checkout the CPU manager function called...

function CpuManager:LoadStrategyInfo()

function CpuManager:LoadStrategyInfo()

	local settings = self.cpu_player:GetDifficultyLevel()
	
	if settings == CpuPlayer.AD_Easy then
  import( "Strategies/Easy/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Easy/AttackStrategyInfo.ai" )
  import( "Strategies/Easy/BuildOrderStrategyInfo.ai" )
  print( "loading easy AI" )
	elseif settings == CpuPlayer.AD_Standard then
  import( "Strategies/Standard/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Standard/AttackStrategyInfo.ai" )
  import( "Strategies/Standard/BuildOrderStrategyInfo.ai" )
  print( "loading standard AI" )
	elseif settings == CpuPlayer.AD_Hard then
  import( "Strategies/Hard/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Hard/AttackStrategyInfo.ai" )
  import( "Strategies/Hard/BuildOrderStrategyInfo.ai" )
  print( "loading hard AI" )
	elseif settings == CpuPlayer.AD_Advanced then
  import( "Strategies/Advanced/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Advanced/AttackStrategyInfo.ai" )
  import( "Strategies/Advanced/BuildOrderStrategyInfo.ai" )
  print( "loading advanced AI" )
	elseif settings == CpuPlayer.AD_Insane then
  --still uses advanced logic
  import( "Strategies/Advanced/BuildBaseStrategyInfo.ai" ) 
  import( "Strategies/Advanced/AttackStrategyInfo.ai" )
  import( "Strategies/Advanced/BuildOrderStrategyInfo.ai" )
  print( "loading insane AI" )
	else
  dbBreak()
	end
	
end

Add a few random statements and copy and edit the existing scripts so even at various difficulty levels the AI does slightly different things and you have full control over the AIs initial choises.

It should be possible to turn the random function into a global var and use it in the update sections too.

Im going to give this try.

Something simple at first, like no vehicle labs for one AI and adjust the army lists to reflect this.

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 18 February 2005 - 07:12 PM

This is perhaps one of the more important aspects of AI building! If we can get the AI to choose from different templates (or personality matrixes) then imagine the possibilities?! I mentioned in my latest Objectives List what we can work towards although its probably a much harder task to code factional tactics (as its hardly ever been done in the RTS genre).

I think it would be beyond cool to have AI personalities do different things - troop only building, mix troops/vehicles, mass siege units behind a line of troops..
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 giskard

giskard
  • Members
  • 155 posts

Posted 18 February 2005 - 07:33 PM

Well im looking closely at the function CpuManager:LoadStrategyInfo() and i think i see a way of doing it.

That function calls the difficulty level files which is great because you might now want a smart AI on easy difficulty. You may want it to get smart at hard or over only.

So lets take a look some files now.

Advanced AIstrategyinfo file.
This can be used to tweak an AIs willingness to fight to the last man. Extra entries in the CPU manage function would be all thats needed for all of the following ideas.


--ADVANCED
AttackStrategyInfo = 
{

	eldar_race =
	{
  --my prorate against yours before I stop attacking you and retreat
  stop_attack_rating = -200,
  min_units = 2,
	},
	
	chaos_marine_race =
	{
  --my prorate against yours before I stop attacking you and retreat
  stop_attack_rating = -200,
  min_units = 2,
	},
	
	ork_race =
	{
  --my prorate against yours before I stop attacking you and retreat
  stop_attack_rating = -200,
  min_units = 2,
	},
	
	space_marine_race =
	{
  --my prorate against yours before I stop attacking you and retreat
  stop_attack_rating = -200,
  min_units = 2,
	},
	
}

Advanced BuildBaseStrategyInfo

I wont quote the entire file, just a few areas of interest here. Again we could add an extra entry to the CPU manager and since this file controls the army list and research list its probably one of the most important files to edit.

Aside from all the stuff at the top that has a big effect on how the AI behaves generally which i wont go into because you know it from our previous chats, theres these sections.

ResearchOrder =
  {
  	"eldar_research_infantryhealth_1",
  	"eldar_research_infantryaccuracy_1",
  	"eldar_farseer_ability_research_3",
  	"eldar_plasma_grenade_research",
  	"eldar_requisition_research_1",
  	"eldar_power_research_1",
  	"eldar_research_infantryhealth_2",
  	"eldar_research_infantryaccuracy_2",
  	"eldar_haywire_bomb_research",
  	"eldar_requisition_research_2",
  	"eldar_power_research_2",
  	"eldar_research_farseerhealth_1",
  	"eldar_research_farseerhealth_2",
  },

Tweaking the research queue will definately have an effect on the AIs game and will do so right away. It is perhaps the one area suitable for normal difficulty tweating too. You can enable or limit an AI from here very easily and this will have an effect on tactics.

Then we have the army lists.

 SquadLimits =
  {
  	fire_vypers =
  	{
    eldar_squad_farseer =1,
    eldar_squad_bonesinger = 0,
    eldar_guardian_squad = 3,
    eldar_squad_banshees = 2,
    eldar_squad_dark_reapers = 4,
    eldar_squad_falcon_grav_tank = 2,
    eldar_squad_fire_prism = 4,
    eldar_squad_grav_platform = 3,
    eldar_squad_grav_platform_brightlance = 3,
    eldar_squad_rangers = 2,
    eldar_squad_seer_council = 1,
    eldar_squad_vypers = 3,
    eldar_squad_warp_spider = 3,
    eldar_squad_wraithlord = 0,
  	},
  	
  	fire_wraith =
  	{
    eldar_squad_farseer =1,
    eldar_squad_bonesinger = 0,
    eldar_guardian_squad = 3,
    eldar_squad_banshees = 2,
    eldar_squad_dark_reapers = 4,
    eldar_squad_falcon_grav_tank = 2,
    eldar_squad_fire_prism = 4,
    eldar_squad_grav_platform = 3,
    eldar_squad_grav_platform_brightlance = 3,
    eldar_squad_rangers = 2,
    eldar_squad_seer_council = 1,
    eldar_squad_vypers = 0,
    eldar_squad_warp_spider = 3,
    eldar_squad_wraithlord = 2,
  	},
  	
  	fire_wraith_no_banshees = 
  	{
    eldar_squad_farseer =1,
    eldar_squad_bonesinger = 0,
    eldar_guardian_squad = 3,
    eldar_squad_banshees = 0,
    eldar_squad_dark_reapers = 4,
    eldar_squad_falcon_grav_tank = 2,
    eldar_squad_fire_prism = 4,
    eldar_squad_grav_platform = 3,
    eldar_squad_grav_platform_brightlance = 3,
    eldar_squad_rangers = 2,
    eldar_squad_seer_council = 1,
    eldar_squad_vypers = 0,
    eldar_squad_warp_spider = 3,
    eldar_squad_wraithlord = 2,
  	},
  	
  	wraith_vypers = 
  	{
    eldar_squad_farseer =1,
    eldar_squad_bonesinger = 0,
    eldar_guardian_squad = 3,
    eldar_squad_banshees = 2,
    eldar_squad_dark_reapers = 4,
    eldar_squad_falcon_grav_tank = 2,
    eldar_squad_fire_prism = 1,
    eldar_squad_grav_platform = 3,
    eldar_squad_grav_platform_brightlance = 3,
    eldar_squad_rangers = 2,
    eldar_squad_seer_council = 1,
    eldar_squad_vypers = 3,
    eldar_squad_warp_spider = 3,
    eldar_squad_wraithlord = 4,
  	}
  },
	},

Instead of having all possible army lists in one file, if our AI was a tank freak we may have several Army lists that are biased towards vehicles in this one and cut back on the infantry a bit. On the other hand, we may want fewer vehicles and more troops. Its an easy thing to do here.

It should be noted that the AI usually builds more than the figures listed here, i think its a ratio rather than an actual limit.

Next we have buildorderstrategyinfo.

This file controls what the AI builds initially and thus whats available at the start of the game.

BuildOrderStrategyInfo =
{
	space_marine_race =
	{
  { "flag_capture" }, { "post_builder" },
  { "flag_capture" }, { "post_builder" },
  { "squad", "space_marine_squad_scout" },
  { "squad", "space_marine_squad_scout" },
  { "squad", "space_marine_squad_servitor" },
  { "building", "space_marine_barracks", true },
  { "squad", "space_marine_squad_force_commander", true },
  { "squad", "space_marine_squad_tactical" },
  { "squad", "space_marine_squad_tactical", true },
	},
	
	ork_race =
	{
  { "building", "ork_waagh_banner" },
  { "squad", "ork_squad_grot" },
  { "flag_capture" }, { "post_builder" },
  { "flag_capture" }, { "post_builder" },
  { "squad", "ork_squad_slugga" },
  { "building", "ork_boy_hut", true },
  { "building", "ork_waagh_banner" },
  { "squad", "ork_squad_mek_boy", true },
  { "building", "ork_mek_shop" },
	},
	
	chaos_marine_race =
	{
  { "flag_capture" }, { "post_builder" },
  { "flag_capture" }, { "post_builder" },
  { "squad", "chaos_squad_cultist" },
  { "squad", "chaos_squad_cultist" },
  { "squad", "chaos_squad_slave" },
  { "building", "chaos_temple", true },
  { "squad", "chaos_squad_lord", true },
  { "squad", "chaos_marine_squad" },
  { "squad", "chaos_marine_squad", true },
	},
	
	eldar_race =
	{
  { "flag_capture" }, { "post_builder" },
  { "flag_capture" }, { "post_builder" },
  { "squad", "eldar_guardian_squad" },
  { "squad", "eldar_guardian_squad" },
  { "squad", "eldar_squad_bonesinger" },
  { "building", "eldar_aspect_portal", true },
  { "squad", "eldar_squad_farseer", true },
	}
}

Adding an extra post builder could make our AI a resource freak early on, perhaps a good plan for a rusher AI or even a serious base builder AI. We may not want a farseer right away so we remove it and add howlinbanshees. This makes the AI's starting forces a lot tougher than the basic troop types we see for the first few minutes of the game. Adding a turret in here forces it to build 1 turret in its base right away, which is good for a base builder type of AI or a defensive AI.

From here we need to link the initial script choices with the update section of the strategies buildbasestrategy.ai so the choices made above are reflected in the updates it can do.

This may be as simple as adding a var to each of the difficulty level files setting the tactic and then doing an if tactic = in the update section of the cpu manager file mentioned above and listing what updates its allowed to make with that armylist and initial build queue.

The updates are configured in each races own build files, so you just copy and paste an entry a few times, change it to suit the tactic being used and then add a function in the cpu manager to call it and add that to the update section.

Assuming the global var idea works this should also work.

Giskard

Edited by giskard, 18 February 2005 - 07:40 PM.


#5 giskard

giskard
  • Members
  • 155 posts

Posted 19 February 2005 - 04:32 AM

Ok Ive had some success with this.

I still need to link up the build queue that comes in the update stage but this is half the job the done already.

What i am about to explain was setup to choose a special set of difficulty files per race. So all teams in that race should use the same tactic. However....when i tested it i thought i saw 2 ork teams using 2 different initial build queues, so it may actually work the way i wanted it too totally by accident.

I test on Hard so the first thing i did was copy the hard folder and call it hardrusher. I then editing the files in that folder to create a quick rusher AI. For this test i just had it build lots of basic units right away and not much else so i can see early on if the AI was actually using my hardrusher settings.

I forced the AI to use them for the first test to see how it should behave then for the second test i allowed it to randomly choose between my default difficulty settings and the new rusher settings.

All races build a load of basic units and charged at each other. everything that was not on the initial build list was later build at random locations around the map anyway. Eg an Armour build at a post far away from the base is a dead give away the new rusher AI is being used since this simply doesnt happen with the default AI.

To enable it properly after editing the hardrusher folders files i simply had to edit the following function in the cpu_manager.ai file.

function CpuManager:LoadStrategyInfo().

Theres a call to this function half a page up in the previous function, thought id mention this since i had the idea of moving the loadstrategy down the AI queue a bit into another file to give me better control over it. Something I have not tried YET.

I'll show you one entry i did, you need one of these for each race in the function named above. Please note that the new choice of difficulty files is only enabled for the Hard setting in this example so look at that hard setting and ignore the rest.

if  self.player_stats:GetPlayerRaceName() == "space_marine_race"  then
        local sprand = math.random(1,2)

	if settings == CpuPlayer.AD_Easy then
  import( "Strategies/Easy/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Easy/AttackStrategyInfo.ai" )
  import( "Strategies/Easy/BuildOrderStrategyInfo.ai" )
  print( "loading easy AI" )
	elseif settings == CpuPlayer.AD_Standard then
  import( "Strategies/Standard/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Standard/AttackStrategyInfo.ai" )
  import( "Strategies/Standard/BuildOrderStrategyInfo.ai" )
  print( "loading standard AI" )
	elseif settings == CpuPlayer.AD_Hard then
                if sprand == 1 then
       	 import( "Strategies/Hard/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Hard/AttackStrategyInfo.ai" )
  import( "Strategies/Hard/BuildOrderStrategyInfo.ai" )
  print( "loading hard AI" )
  end
  if sprand == 2 then
                import( "Strategies/HardRusher/BuildBaseStrategyInfo.ai" )
  import( "Strategies/HardRusher/AttackStrategyInfo.ai" )
  import( "Strategies/HardRusher/BuildOrderStrategyInfo.ai" )
  print( "loading hardrusher AI" )
  end
	elseif settings == CpuPlayer.AD_Advanced then
  import( "Strategies/Advanced/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Advanced/AttackStrategyInfo.ai" )
  import( "Strategies/Advanced/BuildOrderStrategyInfo.ai" )
  print( "loading advanced AI" )
	elseif settings == CpuPlayer.AD_Insane then
  --still uses advanced logic
  import( "Strategies/Advanced/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Advanced/AttackStrategyInfo.ai" )
  import( "Strategies/Advanced/BuildOrderStrategyInfo.ai" )
  print( "loading insane AI" )
	else
  dbBreak()
	end
end


As you can see i now have this function check the race. The reason i do this is because without some check in place, what ever set of files is chosen is applied to all races on all teams in the current game. Making it check seems to have made it more random even between teams of the same race, an unexpects side effect im happy about.

Now this system works, it gives the AI a choice of difficulty files at every difficulty level you care to impliment it on. Its not the best way to do it but its the only way that i could get to work at the moment.

Now i need to set a function that will remember what set of files is being used and rework the update states to use that as a guide and this idea will be working as i want it to work.

The thing to note here is all the other files read the difficulty file settings in order to get their instructions. So you can now send them different instructions on a per difficulty level basis and even different instructions within the same difficulty level.

Giskard

#6 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 19 February 2005 - 07:18 AM

Wicked! I totally see the logic with the script structure yer doing. That would mean you've made one step closer to a distinct AI personality (Attacker/Rusher, Defender/Turtler, Sieger, Balancer). I like the check for race type meaning it allows multiples of the same race to still have random build and unit queues in the same game. So imagine 4-5 personalities where you never know what to expect? math.random() is such the powerful script to say the least!

Once you can perfect it we can discuss some of the cool stuff like:

1) Build queues (how base/ expansions are built + priority research tree)
2) Unit queues (infantry or vehicle or both combos or even AI that are soley interesting in building to their uber-units!)
3) Squad Tactics and behaviours (personality-level traits which seem near unpredictable ie. squads that don't retreat)

Edited by thudo, 19 February 2005 - 07:19 AM.

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

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#7 phordicus

phordicus
  • Members
  • 17 posts

Posted 19 February 2005 - 08:41 AM

a random AI with options as to its build preferences is of very limited benefit (and mostly mid-game only). thought should be given to the same options a player would use.

i hope i can illustrate what i can't seem to say in one statement.

a preference towards vehicles or infantry is relevant only mid-game; every player and AI builds to their cap when resources allow it so all that coding effort will only produce a marginal payoff.

imo, the choices the AI makes need to be based upon its opponent(s) more than some random number determined arbitrarily at the game's start. to illustrate, here's some basic strats concerning weapon options if i'm SM based on what race my nearest (or most immediate) enemy is:

if eldar are my enemy, i'll give two squads 2 heavy bolters and the remaining squad a flamer and hbolter.

if orks, 2 squads with flamer+hbolter and one with 2xhb.

if chaos or sm, one squad with 1 hb, one with 1 flamer, and one with no upgrades. this is to save space for plasma guns, a much more effective weapon against these races.

---

i have no idea if it's possible or easy for the AI to determine what enemy race it should build against, but if so this seems better than a random strategy function which will inherently have a huge varation in competetiveness.

---

random question: is there a way to get units to shoot things that they're most effective against? like, why does a brightlance platform shoot infantry instead of a dreadnought just as targetable?

#8 giskard

giskard
  • Members
  • 155 posts

Posted 19 February 2005 - 08:23 PM

Phordicus:

Most of what your talking about are existing Relic features that have existed since day one. They use the Rating system but thats a little wacked which is why you may not see them as features but instead believe they are bugs.

EG the Brightlance is a good example of a wacked rating system.

The AI does build units its opponent is least effective against too.

Its all default AI stuff.

i have no idea if it's possible or easy for the AI to determine what enemy race it should build against, but if so this seems better than a random strategy function which will inherently have a huge varation in competetiveness.


The AI by default does this using the first enemy it finds but since an AI has to chose its tactics at the start of a game, I dont think its possible to have it change tactics after it starts building its base. We should be able to change its unit build queue though.
---

random question: is there a way to get units to shoot things that they're most effective against? like, why does a brightlance platform shoot infantry instead of a dreadnought just as targetable?

See above, its just a wacked rating system.

I have actually done some work on it already my self and i believe i understand how to read the rating system. Im just not sure how they get the overall rating figures.

Thudo:

Personalities are already possible with the above changes. Only custom build queues remain and i have an idea about how to make them work.

Once i have the build queues working on a per AI basis this little idea will be complete and it will be time to look at AI tactics in battle.

Giskard

Edited by giskard, 19 February 2005 - 08:28 PM.


#9 giskard

giskard
  • Members
  • 155 posts

Posted 20 February 2005 - 08:34 AM

Ive had no luck what so ever getting the Buildstrategy files to use self.info.myvar to read back the stategy name being used.

I had expected it to work nicely but it seems the game hates new vars being added to those info files. Well you can add them, it just doesnt like reading them back.

Giskard

#10 giskard

giskard
  • Members
  • 155 posts

Posted 20 February 2005 - 10:32 PM

Ok Been running some test games with a full set of AI files for Hard to see what AIs got used and it appears the AI does chose a different set of AI files for each team if a set is available. So all that per race stuff above is not needed.

All thats needed is this and 5 copies of the hard difficulty folder, suitably renamed and setup so the AIs are different.

function CpuManager:LoadStrategyInfo(setstrategychoice)

	local settings = self.cpu_player:GetDifficultyLevel()
	setstrategychoice = math.random(1,5)

	if settings == CpuPlayer.AD_Easy then
  import( "Strategies/Easy/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Easy/AttackStrategyInfo.ai" )
  import( "Strategies/Easy/BuildOrderStrategyInfo.ai" )
  print( "loading easy AI" )
	elseif settings == CpuPlayer.AD_Standard then
  import( "Strategies/Standard/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Standard/AttackStrategyInfo.ai" )
  import( "Strategies/Standard/BuildOrderStrategyInfo.ai" )
  print( "loading standard AI" )
	elseif settings == CpuPlayer.AD_Hard then
       if setstrategychoice == 1 then
  import( "Strategies/Hard/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Hard/AttackStrategyInfo.ai" )
  import( "Strategies/Hard/BuildOrderStrategyInfo.ai" )
  print( "loading hard AI" )
       elseif  setstrategychoice == 2 then
  import( "Strategies/Hardrusher/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Hardrusher/AttackStrategyInfo.ai" )
  import( "Strategies/Hardrusher/BuildOrderStrategyInfo.ai" )
  print( "loading Hardrusher AI" )
       elseif  setstrategychoice == 3 then
  import( "Strategies/HardVehicle/BuildBaseStrategyInfo.ai" )
  import( "Strategies/HardVehicle/AttackStrategyInfo.ai" )
  import( "Strategies/HardVehicle/BuildOrderStrategyInfo.ai" )
  print( "loading HardVehicle AI" )
       elseif  setstrategychoice == 4 then
  import( "Strategies/HardAssault/BuildBaseStrategyInfo.ai" )
  import( "Strategies/HardAssault/AttackStrategyInfo.ai" )
  import( "Strategies/HardAssault/BuildOrderStrategyInfo.ai" )
  print( "loading HardAssault AI" )
       elseif  setstrategychoice == 5 then
  import( "Strategies/HardInfantry/BuildBaseStrategyInfo.ai" )
  import( "Strategies/HardInfantry/AttackStrategyInfo.ai" )
  import( "Strategies/HardInfantry/BuildOrderStrategyInfo.ai" )
  print( "loading HardInfantry AI" )
       end
	elseif settings == CpuPlayer.AD_Advanced then
  import( "Strategies/Advanced/BuildBaseStrategyInfo.ai" )
  import( "Strategies/Advanced/AttackStrategyInfo.ai" )
  import( "Strategies/Advanced/BuildOrderStrategyInfo.ai" )
  print( "loading advanced AI" )
	elseif settings == CpuPlayer.AD_Insane then
  --still uses advanced logic
  import( "Strategies/Advanced/BuildBaseStrategyInfo.ai" ) 
  import( "Strategies/Advanced/AttackStrategyInfo.ai" )
  import( "Strategies/Advanced/BuildOrderStrategyInfo.ai" )
  print( "loading insane AI" )
	else
  dbBreak()
	end
	
end

These give me the following AI Personalities

1 Default AI.
1 Rusher, just builds lots of cheap units.
1 Vehicle AI, prefers big vehicles if can get them but builds a few basic troops too.
1 Infantry AI, builds heavy infantry and some light vehicles.
1 Assault AI, builds assault troopls for close combat and assault vehicles such as dreadnoughts.

Each AI has 2 army lists it can currently choose from which are chosen randomy at the start of the game. So even if the same AI is used by 2 teams, the chances are 50/50 the troops they build willl be different anyway.

I may add more later but first i need to fine tune the AI files for each of those 5 new AI peronalities i have. So they operate at their best.

Giskard

Edited by giskard, 20 February 2005 - 10:38 PM.


#11 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 20 February 2005 - 11:09 PM

Are you sure that players can really benefit from different AI personalities while playing at this level ? The AI has to choose the best strategy/tactic from start to be a challenge. An infantry AI won't survive very long. The AI must choose its units on its opponent, not on presets to be successfull. Just my 2 cents.

#12 quiet_man

quiet_man
  • Members
  • 33 posts

Posted 20 February 2005 - 11:35 PM

Are you sure that players can really benefit from different AI personalities while playing at this level ? The AI has to choose the best strategy/tactic from start to be a challenge. An infantry AI won't survive very long. The AI must choose its units on its opponent, not on presets to be successfull. Just my 2 cents.

<{POST_SNAPBACK}>


yes and no, the ai should keep presure on the player but should also be fun to play.

Many good players can tell you that ladder games become boring very fast because of fixed strategies and that it is much more fun to play fungames with noobs, who do unexpected things.

so a certain chance for the ai to do something unexpected would be good. You can make it dependend on the difficulty level.

quiet_man

#13 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 21 February 2005 - 07:28 AM

Unexpected things are very nice but are they nice too if they will make the AI loose much more often ? Doing an infantry personality isn't very unexpecting. I understand the ratio behind it but this should be used for lower AI levels just played for fun, not competition.


I have anidea : How about shifting the AI levels, dropping the first two and inserting two new ones. The easiest AI levels are just pathetic and someone using the mod won't be interested in them at all IMO.

Now level 1 will use the hard scripts
Level 2 will use the advanved scripts with personalities
Level 3 will use the advanced scripts tweaked for success
Level 4 will use the advanced scripts with personalities + req bonus
Level 5 will use the advanced scripts tweaked for success + req bonus

How about this ?

#14 phordicus

phordicus
  • Members
  • 17 posts

Posted 21 February 2005 - 09:51 AM

i think you could drop the lvl 2. like you said, people with this mod won't be that impressed by the variety of the AI if it isn't a challenge to play against. further, why worry about anything other than advanced? people can improve their skill level in preparation for this mod just by playing the default AI. or is that too elitist?

#15 giskard

giskard
  • Members
  • 155 posts

Posted 21 February 2005 - 10:58 AM

Larkin:

Thats a standard feature of the Relic AI. Half the AI code is geared up to doing just that. Its impossible for an AI not to do that without completely rewriting the AI code first and I doubt it would work afterwards.

Thats the only thing Relics AI does though, it doesnt do anything else.

Its certainly not as smart as you guys believe it is.

Ive been studying the code all week for 10 hours each day ive come to understand how it works and in all honesty it looks like a feature relic didnt finished.

Theres support there for doing what im doing but relic never bothered to do it. They half did it on insane level but the other levels dont use half the features insane uses. Theres even some redundant vars kicking around that dont appear to have any uses except perhaps for Nerfing certain AIs.

And ive not even gotten to all the Nerfing functions Relics are using on their own AI to tone it down so the average player could beat it.

So you might call my tweaks an UN-NERFING Exersize.

Giskard

#16 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 21 February 2005 - 11:25 AM

Did you really study it that much ? If yes you should have noticed that insane is just giving req bonus and therefore your statement

They half did it on insane level but the other levels dont use half the features insane uses.


is obviously wrong. Insane is using the same scripts as advanced.

I'm also staring a lot at the code so we must see different things sometimes :p

Edited by LarkinVB, 21 February 2005 - 11:50 AM.


#17 giskard

giskard
  • Members
  • 155 posts

Posted 22 February 2005 - 12:39 AM

Ive not seen any bonus being award to any AI at all yet.

On the contery, the AIs have a set of vars that prevent them from having or doing too much. Those restrictions are relaxed more and more as you go up the difficulty levels.

Thats how Relic controls its AI.

Not with Bonuses but with penalities.

What ive done is increase the AIs options by a factor of 10, tweaked the AIs so it does more things each minute and then removed the nerf code that was holding it back.

Most of which has been posted in here already by me.
The changes needed to make it fast have not been posted because im still testing them.

However i will post them once i know there are no side effects.

Here are some screenshots from my old Rogue Trader 1.2 mod that contained the un-nerfing changes and additional army lists but nothing else.

This AI is as slow as the Relic AI but builds a more ballanced force. For example, take a look at the troops the Edlar actualy built in these pics. Its not just Banshees and Guardians, it has all those plus Warp Spiders and Reapers too.

You may notice it beat me so it must have had a force capable of taking out tanks, infantry and lots of turrets on its own.

Rogue trader 1.2 pics

http://www.respawn.c...rt12attack1.jpg

http://www.respawn.c...rt12attack2.jpg

Now heres my Vehicle AI from my new 1.3 dev code.

http://www.respawn.c..._typical_ai.jpg

The new AI is 10 times more effective than this one, it can do this within 20 minutes now. Within 10 it can have 4 defilers blowing your base away easily. And thats not rare, thats common for the vehicle AI.

I may have to nerf it a bit so players stand a chance of winning. Or tell them to play at easy difficulty level lol :huh:

Giskard

Edited by giskard, 22 February 2005 - 12:43 AM.


#18 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 22 February 2005 - 05:44 AM

The AI doesn't cheat in yours right unless its on INSANE with that 1.2% Resource bonus? If not, I'd love to see what you've done: having a balanced force especially for Eldar would be a treat! Down the road, personality AI templates would be one road to follow.

We'll have to have a major pow-wow after v1.0 is out. Looking forward to it!
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#19 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 22 February 2005 - 07:23 AM

Its obvious that you can speed up AI phases but you can't speed up resource income. If it uses up all resources at 'slow' whats the use in speeding ticks ?

Can you please list the limitations you lifted for harder/insane (same set of scripts) AI ?

Edited by LarkinVB, 22 February 2005 - 07:47 AM.


#20 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 22 February 2005 - 07:29 AM

Its my understanding that INSANE gets a resource bonus as Relic officially stated:

/W40k.sga/attrib/tuning/ai_player.lua
----------------------------------------
-- File:  'ai_player'
-- Created by:	AttributeEditor v1.0
-- Note:  Do NOT edit by hand!
-- (c) 2001 Relic Entertainment Inc.

GameData = Inherit("tuning_types")
GameData["res_renew_bonus_insane"] = 1.250000
GameData["res_gather_bonus_easy"] = 0.3000000
GameData["res_renew_bonus_standard"] = 0.8000000
GameData["res_gather_bonus_standard"] = 0.8000000
GameData["res_gather_bonus_hard"] = 0.9000000
GameData["res_renew_bonus_hard"] = 0.9000000
GameData["res_renew_bonus_advanced"] = 1.000000
GameData["res_gather_bonus_advanced"] = 1.000000
GameData["res_renew_bonus_easy"] = 0.3000000
GameData["res_gather_bonus_insane"] = 1.250000

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

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users