Dawn Of Skirmish SS v3.10 AI Mod is now LIVE!
#63
Posted 01 May 2009 - 01:35 PM
That... is a VERY good question. Same goes for the BT. However, if you wait, the AI does possess the Lord to become the DP and random chaos marine sargs to become the BT so the DoPossess() code must be somewhere running generically. If not, likely a built-in Relic AI call somewhere outside the scripts.My question was more like this: Where is DoPossess() called for the chaos lord in the current code of the skirmish AI mod ? As far as I can see it is NOT called at all for him. Therefore I wonder how he manages to transform at all.
Going forward, I would probably put the DoPossess() code into both the Chaos Lord and Marine Squads that require it as its 10000x more efficient in conjuring either the DP or BT.
BooyyahhH! Awesome news!!! Fingers crossy'ed!Good news: I had no crash with mapdb and the new compass move - yet.
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#64
Posted 01 May 2009 - 06:19 PM
#65
Posted 01 May 2009 - 06:25 PM
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#67
Posted 01 May 2009 - 06:53 PM
Good observation. At that place there was obviously a misunderstanding. Fortunately in most other places, it's used correctly.More problems. Ability.DoAbilityArea and possibly other abilities are not handled right sometimes. Check the code below. The coder is using the last number as if it is the threshold of units to trigger but in fact it is the range. It makes no sense to reduce range in case the unit is dying.
I reworked them a bit so they won't crash. This way mods that use those methods won't get any execution errors.1. First the Filters using iCount within won't work as expected and should be removed or reworked.
That is CloseInfiltrator, CloseBroken, CloseInfantryEnemyCC, CloseVehicleHighEnemy, CloseMonsterHighEnemy, CloseMonsterEnemy
They have different meanings. The count returns a certain number of troopers, regardless if they belong to the same squad or not. Some abilities are directed on squads and should have a certain troop count to be worth to be used. A successfull count of 1000 gives you no guaranty that the 1000 guys are individuals or part of one or several squads. That's the reason for the additional squad trooper count check.2. Why is CloseSquadEnemy = function( position, tolerance, count ) using an additional check for 4 troopers, rendering the count parameter useless ?
Hmm, it 'shouldn't' work, but I'm sure I saw a DP the last time when I tested them. I'm also pretty sure that the testers would have noticed that very fast. Anyway, I've added the Possess code to the Chaos Lord so it makes sense. Maybe the DP morph also works with squad champs?!? Not sure, it's quite some time.DoPossess() is called in InfantryTactic but chaos lord is not using this. Is this intentional ? I guess he won't morph into daemonprince because of this, right ?
Not sure if the AE code can cause an 'auto-possess'. That's more a question for the AE coders.
At last... some good news.Good news: I had no crash with mapdb and the new compass move - yet.
#68
Posted 02 May 2009 - 08:14 AM
I reworked them a bit so they won't crash. This way mods that use those methods won't get any execution errors.1. First the Filters using iCount within won't work as expected and should be removed or reworked.
That is CloseInfiltrator, CloseBroken, CloseInfantryEnemyCC, CloseVehicleHighEnemy, CloseMonsterHighEnemy, CloseMonsterEnemy
Wouldn't it be better to remove them as they simply don't work ? Or do they work at all ?
CloseBroken = function( position, tolerance, count ) functor = function(oSquad, iCount) return (oSquad:IsBroken() and iCount ~= nil and oSquad:GetNumTroopers() >= iCount) end return cpu_manager:GetClosestSquad(position, tolerance, functor) end,
Since GetClosetSquad() is using functor with just oSuad but not iCount it won't work, right ?
Can we make them work by adding count functionality to cpu_manager:GetClosestSquad(position, tolerance, functor, count) ?
function CpuManager:GetClosestSquad( pos, range, functor, count ) local squad_ai = nil local current_pos = nil local range_sqr = sqr(range) for squad in military_manager:GetSquads() do --fulfills requirements if squad:IsValid() and functor( squad, count ) then local squad_pos = squad:GetPosition() --is in range if distance_sqr( squad_pos, pos ) <= range_sqr then --check if it's closer if squad_ai == nil or distance_sqr( current_pos, pos ) > distance_sqr( squad_pos, pos ) then squad_ai = squad current_pos = squad_pos end end end end return squad_ai end
Then we can use them like this and they should work :
CloseBroken = function( position, tolerance, count ) functor = function(oSquad, iCount) return (oSquad:IsBroken() and iCount ~= nil and oSquad:GetNumTroopers() >= iCount) end return cpu_manager:GetClosestSquad(position, tolerance, functor, count) end,
Since it is core code I'd like to get a fix and functionality won't hurt these filters.
Edited by LarkinVB, 02 May 2009 - 08:37 AM.
#69
Posted 02 May 2009 - 08:33 AM
They have different meanings. The count returns a certain number of troopers, regardless if they belong to the same squad or not. Some abilities are directed on squads and should have a certain troop count to be worth to be used. A successfull count of 1000 gives you no guaranty that the 1000 guys are individuals or part of one or several squads. That's the reason for the additional squad trooper count check.2. Why is CloseSquadEnemy = function( position, tolerance, count ) using an additional check for 4 troopers, rendering the count parameter useless ?
Ok. In this case it does not make much sense to call it with less than 4 as count. Check the archons use of his abilities. He is also calling CloseSquadEnemy and CloseInfantryEnemy on the same ability.
Edited by LarkinVB, 02 May 2009 - 08:36 AM.
#70
Posted 02 May 2009 - 08:52 AM
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#71
Posted 02 May 2009 - 11:35 AM
Most should work. However there's indeed something fishy with the ones that call the cpu_manager:GetClosestSquad() method.Wouldn't it be better to remove them as they simply don't work ? Or do they work at all ?
Yes, I think that's the better way. However I'd improve the speed a bit by using this code:Can we make them work by adding count functionality to cpu_manager:GetClosestSquad(position, tolerance, functor, count) ?
function CpuManager:GetClosestSquad(vPosition, iRange, oFunctor, iCount) -- Init variables local oCurrentSquad = nil local vCurrentPos = Vector3f() local iCurrentDistanceSqr = 0 local iRangeSqr = sqr(iRange) if (iCount == nil) then iCount = 1 end -- Compute all squads for oSquad in military_manager:GetSquads() do -- Check requirements if (oSquad:IsValid() and oFunctor(oSquad, iCount)) then -- Check if squad is in range local vSquadPos = oSquad:GetPosition() local iDistanceSqr = distance_sqr(vSquadPos, vPosition) if (iDistanceSqr <= iRangeSqr) then -- Check if it's closer than the last one if (oCurrentSquad == nil or iDistanceSqr < iCurrentDistanceSqr) then oCurrentSquad = oSquad vCurrentPos = vSquadPos iCurrentDistanceSqr = iDistanceSqr end end end end return oCurrentSquad end
I'm not sure if squads that 'touch' the range are counted as full, but usually 1 doesn't make much sense. However it's not really important, it doesn't have any negative consequences.Ok. In this case it does not make much sense to call it with less than 4 as count. Check the archons use of his abilities. He is also calling CloseSquadEnemy and CloseInfantryEnemy on the same ability.
Yes, fixed the Archon problems!Ok. In this case it does not make much sense to call it with less than 4 as count. Check the archons use of his abilities. He is also calling CloseSquadEnemy and CloseInfantryEnemy on the same ability.
Know issue! Dark40K tried a complex workaround sometime, but even he didn't find a satisfying solution.Massive Battles SCAR game mode -- a user noted that when it comes to Orks it ONLY applies to vehicles but not the infantry (should be 150 but instead its the vanilla default of 100). Can be fixed?
#73
Posted 12 May 2009 - 01:44 PM
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#77
Posted 15 May 2009 - 08:27 PM
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#78
Posted 16 May 2009 - 08:45 AM
Same here.. no crash. Specific map this is reproducible?
I haven't been able to reproduce it, but it has been my second crash ever since 3.10 has been released. The problem I believe comes from the fact that both maps on which I've had a crash are custom maps, so don't worry I don't even want support for custom maps, I know what is represents, under those conditions it's irrelevant. But my crashes are extremely rare (as I mentioned, two times only), and it happened after a good two hours of skirmish (big maps, seven A.I players).
I was just wondering if code-wise the A.I was still sensible about elevated terrain, custom maps involved or not, because both of the maps I play in question do have elevated terrain and perhaps a difficult layout especially for teleporting and/or jet-packing units. In terms of the hardware side of things none of it is over-clocked, absolutely nothing, and all drivers are official, etc. But anyway, I don't want to create any panic about that.
Edited by Zenoth, 16 May 2009 - 08:45 AM.
#80
Posted 17 May 2009 - 09:25 AM
CheckSquadCap and CheckSupportCap can cause problems. The function will SaveResources before checking wether threshhold is reached at all. The checks should be switched, first threshhold, than resources. It caused some headache with DoWPro.
-- Arkhan 10.2005: Calculates, if more squad cap is needed function BuildBaseStrategy:CheckSquadCap(iMinRequisition, iMinPower) -- Check requisition local iRequisition = resource_manager:GetResourceAmount():Get( ResourceAmount.RT_Requisition ) / self.m_iTechBreak local iPower = resource_manager:GetResourceAmount():Get( ResourceAmount.RT_Power ) / self.m_iTechBreak if (iRequisition < iMinRequisition or iPower < iMinPower) then self:SaveRessources(true) return false end -- Check squad cap local iSquadCapTotalMax = build_manager:GetSquadCapTotalMax() local iSquadCapLeft = self:GetSquadCapLeft() local iSquadCapCurrentMax = self:GetSquadCap() + iSquadCapLeft if (iSquadCapLeft <= self.info.squad_cap_threshold and iSquadCapCurrentMax < iSquadCapTotalMax) then return true end return false end
Bump. Please fix.
Reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users