Jump to content


Photo

Skirmish AI 3.0 Beta 2 - Post Comments In Thread!


167 replies to this topic

#141 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 24 March 2008 - 09:54 AM

Think replacing losses by reinforcing of depleted squads can be a major improvement.

Some more facts for my argument to raise army strength requirements in BOs :

Two dark eldar mandrake squads (6 troopers each) are worth 540 strength points. Archon + 2 incubus is worth 975.
Sum is > 1500. This is a basic weak T1 army but will be enough for fixed build orders to allow all researches/buildungs/addons nearly up to T3.

#142 thudo

thudo

    Wacko AI Guy!

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

Posted 24 March 2008 - 01:27 PM

Well I'm open to adding ArmyStrength into the DynamicResearches and DynamicBuilding script as another option ontop of what we currently have.

I simply have no clue why, Larkin, you think that having a specific research set to be buildable ONLY when, say, > 3 squads of a type relevant to the research + 6 Minimum Squad Cap is not enough or that its the same as just giving the research away without restrictions? Logically, that makes absolutely no sense because the restriction on building the research IS THE # of CURRENTLY ACTIVE SQUADS + the SquadCap needed. I sincerely don't think you want to go back to the static, rigid researches we had directly in our buildprograms? No... of course not. Its a lot better than what it was before because now we can control how important each research is based on what squads use it. Nevertheless, if Arkhan is fine with it, I would like to add ArmyStrength as another factor to consider for dynamic research.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#143 Smokeskin

Smokeskin
  • Members
  • 127 posts
  • Location:Denmark
  • Projects:Soulstorm Advanced AI betatester

Posted 24 March 2008 - 02:07 PM

I've been trying to modify the AI a bit, but there's just too much code to learn compared to the time I can realisticly put into it.

So here's some pseudocode that hopefully shows what it is I mean.

The code snippets need to go into proper Reinforce or Update calls etc. under the AI for the proper unit/building in bold, and have the usual checks for upgradeability and such that you have in the normal code.

It should do the following:

- reinforce squads taking losses
- if the AI gets low on troops compared to the enemy, it will dynamically reinforce squads to larger size and build more units. This will both be beneficial if it takes losses, but also if the enemy rushes, it will dynamically build more units to counter it, or if the enemy techs it will accept a lower number of own units and so have more resources to tech itself
- if the AI gets high on resources, it builds and reinforces units. It should stop floating very efficiently.
- it can stop power float by recognizing it and prioritizing vehicle building.

How it all interacts with the parts of the AI that determines research is ofc very important. The way I imagine it would work is that the code here will build units if it is weaker than the enemy - this will prevent resources being spent on research. When it gets strong enough, it has resources free to resume reseaching - if it while researching accumulates resources, it will build more units along the way.

I don't know how the BO in strategyinfo and the dynamic researches in buildbasestrategy fit together, or how it will work together with this. I think a good way to do it was to modify the code handling the BOs in strategyinfo by saying that at the specified army strength it MUST start it (and so block resource spending in the code I have below too), but if it has excess resources then it advances along the BO tree (since that will only happen if the AI has sufficient troops). That would let you specify necessary buildings, researches and units with proper army strengths so it does a good, strong, tight BO, while less essential upgrades get artificially high army sizes so they only get done if the AI gets ahead.

CPU MANAGER

-- if high on power, build vehicles
if (iPower>powerThreshold) then
	buildVehicle = true
	-- ensure that infantry building doesn't drain req - once a vehicle is building, next code 
	-- pass will again allow infantry
	if (vehicleBuilding or vehicleCapIncreasing) then
		allowInfantry = true		
	else
		allowInfantry = false
	end
else
	-- if we don't have power, we don't want to build vehicles or block infantry
	buildVehicle = false
	allowInfantry = true
end

-- build infantry if high on req
if (iReq>reqThreshold) then
	buildInfantry = true
else
	buildInfantry = false
end

-- if we're weaker than the enemy, we need troops, no matter the resource situation
-- overPowerFactor could be set at 1 or whatever seems beneficial - tech strategies might set it
-- lower (we're ok with being a bit low on strength until we get our uber units out) and rush 
-- strategies higher (we need to overpower the enemy now) for example
if (enemyArmyStrength*overPowerFactor > ownArmyStrength) then
	buildInfantry = true
	buildVehicle = true
end

-- if we have power for vehicles and aren't building any yet we're short on req, don't build 
-- infantry until vehicles are under construction 
if (not allowInfantry) then
	 buildInfantry = false
end

INFANTRY BUILDING
-- if we've globally decided to build infantry, do it
if (buildInfantry) then
	if (noSquadCap) then
		increaseSquadCap = true
	else
	build something
	end
end

SQUAD CAP RESEARCH BUILDING
if (increaseSquadCap) then
	research squad cap
end

VEHICLE CAP RESEARCH BUILDING
if (increaseVehicleCap) then
	research vehicle cap
end

INFANTRY SQUAD
-- if below minimum strength or we're globally decided to build infantry, reinforce squad
-- minNumber is a variable that needs to be set per squad type (or perhaps 
-- just initial size or something like that)
if (number<minNumber or buildInfantry) then
	reinforce
end  

VEHICLE BUILDING
-- if we've globally decided to build vehicle, do it
if (buildVehicle) then
	if (noVehicleCap) then
		increaseVehicleCap = true
	else
	build something
	end
end

Edited by Smokeskin, 24 March 2008 - 02:36 PM.


#144 Smokeskin

Smokeskin
  • Members
  • 127 posts
  • Location:Denmark
  • Projects:Soulstorm Advanced AI betatester

Posted 24 March 2008 - 02:30 PM

Well I'm open to adding ArmyStrength into the DynamicResearches and DynamicBuilding script as another option ontop of what we currently have.

I simply have no clue why, Larkin, you think that having a specific research set to be buildable ONLY when, say, > 3 squads of a type relevant to the research + 6 Minimum Squad Cap is not enough or that its the same as just giving the research away without restrictions? Logically, that makes absolutely no sense because the restriction on building the research IS THE # of CURRENTLY ACTIVE SQUADS + the SquadCap needed. I sincerely don't think you want to go back to the static, rigid researches we had directly in our buildprograms? No... of course not. Its a lot better than what it was before because now we can control how important each research is based on what squads use it. Nevertheless, if Arkhan is fine with it, I would like to add ArmyStrength as another factor to consider for dynamic research.


I think what is needed is a relative army strength gauge.

So if the AI is weak on army compared to the enemy, it focuses on building more units.
If it is equal or better, it does a balance between more units while researching.

#145 thudo

thudo

    Wacko AI Guy!

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

Posted 24 March 2008 - 02:36 PM

Agreed. My problem is even if I stop all dynamic researches that DOES NOT whatsoever guarantee a big army. On the contrary, its the the ArmyStrength in the Buildprograms that controls that. I find the AI still builds/techs in the buildprogram so its not just the dynamic researches that would cause small AI armies. I've disabled dynamic researches and still the AI had small armies so don't think by further restricting the researches based on army size you will get large armies. No no.. its the buildprograms.

Currently here is how a general layout of ArmyStrength in the buildprograms is marked out:

Tier1
===
0-900

Tier2
===
1000-2000

Tier3
===
2000-2500

Tier4
===
2500-4000

So what would happen if we bump up all these values by 1.5 or 2x? I might run a test.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#146 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 24 March 2008 - 02:48 PM

I simply have no clue why, Larkin, you think that having a specific research set to be buildable ONLY when, say, > 3 squads of a type relevant to the research + 6 Minimum Squad Cap is not enough or that its the same as just giving the research away without restrictions?


I did give you the example with eldars. Eldars will build three guardian squads at game start. That is num_infantry_squads > 2 and 6 pop, satisfying all needs for researches without having a real fighting force. My suggestion is to use real army power OR to count guardians/rangers as half a squad or to distinguish betwen light/heavy infantry like you did with chaos

No problem, I will shut up as I think we just have different preferences. :rolleyes:

#147 Smokeskin

Smokeskin
  • Members
  • 127 posts
  • Location:Denmark
  • Projects:Soulstorm Advanced AI betatester

Posted 24 March 2008 - 02:57 PM

Agreed. My problem is even if I stop all dynamic researches that DOES NOT whatsoever guarantee a big army.


I think you need some dynamic unit building and reinforcement code. I've been looking for it, and I can't really find anything that does it.

In the pseudocode I posted, I have two global flags, buildInfantry and buildVehicle. I then have some code in squads and barracks so when they see buildInfantry == true, they reinforce and build squads. Likewise with buildVehicle.

You can then control army strength from cpu_manager or whatever, while low on relative army strength, just flip those flags to true, and you get a bigger army. Need to research (or just want to because you're now strong enough), flip them to false and you can save up resources for teching. If you're floating, flip them to true.

Edited by Smokeskin, 24 March 2008 - 02:57 PM.


#148 thudo

thudo

    Wacko AI Guy!

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

Posted 24 March 2008 - 02:57 PM

Wait a sec.. those 2-3 Tier1 Guardian Squads you mentioned will 9/10 times get nuked before they reach Tier2 thus NOT triggering such things like plasma grenade (which those squads can use anyway). However, the researches run when 3 or more of those 5 kinds of squads are present in game so those initial guardian squads will likely be dead before then in almost all games thus replaced by better squads (which then properly trigger the researches). I don't see the problem here because dynamic researches specifically target improvement to those affected squads.

Why not just increase the needed # of squads to 4-5? I still don't think this is all about dynamic researches but the buildprograms.. Try disabling all dynamic researches - does that guarantee larger AI armies? There is more here "at play" then researches because the buildprograms chew up plenty more cost due to mines, turrets, addons, buildings that get build. Perhaps the solution is to increase the # of squads a research needs AND upping all armystrength values in the build programs?

And Larkin your opinions are VERY valuable no matter what I say -- you've been at this since Day 0 and hopefully we'll have your skills when DoW2 arrives.

@Smokeskin - we'll have to see what Arkhan thinks. Really appreciate your involvement -- this is what beta testing is all about.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#149 Smokeskin

Smokeskin
  • Members
  • 127 posts
  • Location:Denmark
  • Projects:Soulstorm Advanced AI betatester

Posted 24 March 2008 - 03:32 PM

This is from \core

[codebox]function InfantryTactic:Reinforce()

-- Check resources
local iRequisition = resource_manager:GetResourceAmount():Get(ResourceAmount.RT_Requisition)
if ((iRequisition < 800 or self.m_bPowerCost) and (not Tactic.Options.can_reinforce or not self:CanSpendMoney())) then
return
end[/codebox]

I think CanSpendMoney() returns false most of the time, probably all buildings need to be researching something like that for it to return true.
So you're only going to be reinforcing when >800 req (which btw is also much too high imo).

If there's something like that in the code that decides to build units, I think you have your culprits.

If the AI loses its units and falls below opponent strength, it needs to rebuilt and reinforce, no matter what, except some force tech overrides perhaps. And in general, not reinforcing squads when they're close to destruction is a bad idea.

BTW, can someone tell me where the code that controls unit production from buildings?

Edited by Smokeskin, 24 March 2008 - 03:35 PM.


#150 Semiphar

Semiphar
  • Members
  • 11 posts

Posted 24 March 2008 - 03:52 PM

Since we're speaking about cpu_manager, would it be possible to add a slider for offense/defense? Sometimes it's a load of fun having a huge base while getting attacked by some ultra-offense, and sometimes the other way around.

#151 Smokeskin

Smokeskin
  • Members
  • 127 posts
  • Location:Denmark
  • Projects:Soulstorm Advanced AI betatester

Posted 24 March 2008 - 11:55 PM

Tau Commander should upgrade to missile launcher at t2 ASAP. Good disruption and some needed AV.

Tau Commander should upgrade to plasma rifle ASAP at t3.

Crisis suits should be more likely to upgrade to flamers, they are vicious.

We can't specify upgrades (Unfortunately).


I used this code to get battle sister squads to upgrade:

local class_type = cpu_manager:FindClosestEnemyPlayer():GetMajorityClassType()
self.squad_ai:DoBestUpgrade( class_type )

At tier2 against chaos and space marines, they went for heavy bolters.
However against imperial guard they go for flamers.

I'm thinking you could control upgrades by feeding squads the proper class_type argument to the DoBestUpgrade function?

#152 thudo

thudo

    Wacko AI Guy!

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

Posted 25 March 2008 - 02:27 AM

I've tried all that but the Sisters are so weak against SM in Tier3 it ain't funny - I've tried various scenarios and more times then not the SM hardware in Tier3+ just rolls over em. Very frustrating. I tried forcing BattleSister squads to reinforce and upgrade and it works up to late Tier2 then they just can't compete with SM's juggernaut.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#153 Smokeskin

Smokeskin
  • Members
  • 127 posts
  • Location:Denmark
  • Projects:Soulstorm Advanced AI betatester

Posted 25 March 2008 - 07:32 AM

I'd need to see a replay or have a description of what the force compositions are and what units are troubling.

I do think that a good vs all unit like the SM dreadnought would be a big advantage for the AI - it doesn't suffer from the AI not being able to target intelligently, but an enemy like SoB can't focus fire its dedicated AV units on it, and you really need that to keep a dreadnought from walking all over you.

Celestian squads are great AV though - tough, good damage, and even better krak grenades that WILL hit the right target (and that at least gets them in the right area). Check the replay I've attached here, while it is a bit onesided at the end there are some dreadnoughts that get worked over fast by my celestians at early/mid of t2.

I can't see your replays since I just have beta 2, right?

Attached Files



#154 thudo

thudo

    Wacko AI Guy!

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

Posted 25 March 2008 - 01:44 PM

Had some moderate success with Sisters last night tweaking the Battle Sisters Upgrade() and Reinforce() -- these guys clearly lack some good Tier2+ hardware to compete against some of SM's finest machines as SM can easily steamroll over em. Lightning Fighters are surprisingly good actually thats why I find the Lightning BO does the best. Looks like I have more to incorporate into Beta3. :p
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#155 troubadour

troubadour
  • Members
  • 88 posts

Posted 25 March 2008 - 02:10 PM

Maybe Arkhan or Larkin could have a look at this one because as Smokeskin said the 800 req is huge.
I understand it was done on purpose to save req for teching. But the 800 req value need to be adjusted according to BO, Tier and even
to enemy army strength, not an easy task
For a first try,i changed it down to 300, will keep you posted about significant change in AI behavior.

#156 thudo

thudo

    Wacko AI Guy!

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

Posted 25 March 2008 - 02:19 PM

For SM it generally works perfectly.. but for Sisters, reinforcing and upgrading them quickly does little to make them more effective on the battlefield. As mentioned, I've tweaked the Battle Sisters Upgrade() and Reinforce() and it seems to be a little better now. Also forced the Immolator to wait til Tier3 to decide whether to upgrade to Meltas or not. Sisters are quite delicate as a single SM dread (not upgraded) can wreck absolute havoc in the Sister's base since all their buildings have the consistency of poo :p
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#157 troubadour

troubadour
  • Members
  • 88 posts

Posted 25 March 2008 - 02:47 PM

DE BO at Relic news forums :
Interesting BOs for DE to adapt/custom to meet AI need, sorry if you already know

**** Full credits go to Cake ****
link to full post : http://forums.relicn...ad.php?t=186591

STANDARD BUILD ORDER :
Dark Foundry
2xMandrakes
Plasma Generator
Assign ctrl for builder (9), Kabal Fortress (0), Dark Foundry (7)
Put builder near 1st point
Cap 1st point with 1st drakes, LP it
Queue 1xHellions and build Haemonculus Laboratory
Cap a 2nd point with 1st drakes and a 3rd with 2nd drakes, LP them
Continue capping points with 2nd drakes
Attack with 1st drakes as soon as they finish capping their 2nd point, and with Hellions
Build Reaver Jetbikes up to 3 of them and LP capped points (no rule here, map dependant)
Reinforce 1st drakes and Hellions, try to decap and kill/destroy as many things as possible, starting with builders/cappers
Tech to Tier2 (you'll often have to get another gen before)
Build Hall of Blood
Research Soulseeker Ammunition
Build Slave Chamber
Research Reaver Targeting Module and Night Shields
2xScourges
3xReaver Jetbikes
Leader and reinforce Scourges to the max
Build Wych-Cult Arena
1x Scourge (Wych if you need detection)
Your base army should consist of 3 Scourges squads fully reinforced and 6 Reaver Jetbikes

MIRROR BUILD ORDER :
3xMandrakes
Hall of Blood
Plasma gen
Research Infiltration
Cap 1 point with 1st drakes, LP it
Attack with 1st drakes and 2nd drakes as soon as they are here and reinforce 1 unit in each of these 2 squads
Cap points with 3rd drakes, LP them
Build Slave Chamber
1xWarriors
Build Haemonculus Laboratory
1xWarriors
Haemonculus (Attach him to a warrior squad)
Get the 2warriors leaders
Plasma gen
Tech to Tier2
Research Soulseeker Ammunition, Poisoned Blades, Daemonic Touch and maybe Wraithbone Woven Battlesuits

Edited by troubadour, 25 March 2008 - 04:25 PM.


#158 Smokeskin

Smokeskin
  • Members
  • 127 posts
  • Location:Denmark
  • Projects:Soulstorm Advanced AI betatester

Posted 25 March 2008 - 02:52 PM

I'm dying to see the behaviour with the new code :p

Is your impression the AI overall became tougher?

#159 ArkhanTheBlack

ArkhanTheBlack

    title available

  • Members
  • 814 posts

Posted 25 March 2008 - 03:22 PM

Just wanted to say that I'm back now from my easter holidays. I'll try to get the next beta ready, now, by merging my own and Thudo's AI changes.

Further, don't jump too quick to conclusions just by reading the core code. The economic problems we have at the moment are caused by inefficient parameter settings and not by buggy core code like the harassing/movement problems. The 800 req restriction is only used if the build manager is trying to save resources for a certain build item. In this case, the build manager has already checked the the army strength and decided it's okay to restrict unit building / reinforcing or the build manager is in a force tech phase which pretty much means the AI is far behind in teching and has to solve that problem now or it's dead anyway. The value of 800 ensures that the AI can rebuild a detroyed HQ.

#160 Smokeskin

Smokeskin
  • Members
  • 127 posts
  • Location:Denmark
  • Projects:Soulstorm Advanced AI betatester

Posted 25 March 2008 - 04:27 PM

Missionaries attaching to squads: Since he can't use his Faith abilities when attached, there's no reason to attach him except for detection purposes. Unless you need detection, he should be a dedicated capping unit that never attaches.



Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users