I was looking at the Sempf ai thread and was going to post there but then I started wandering all over on various issues with the Ai so I decided to start a new thread so I do not derail his
.
Sonsalt wrote:
Results Test games Sempf AIX vs. Sorian AIX (latest version)
Con Sempf:
- Builds too few bombers too late
- Wastes its Fighters over the enemies base
- Commander is moving too far out of the base
- Uses T1 Fighters and Bombers too long into the game
- Building template for forward bases is faulty. It should start with defences instead of factories.
Most of these seem to be common problems that carry over from the stock AI. There used to be a commander leashing code but that seems to have been left out of the single player AI. I remember seeing it somewhere in the OPAI though. The fighter over enemy bases is actually something that all the units will do if given the opportunity. If a unit locks on a target it follow the target all the way back to its base or if the target is destroyed and a new target is available close by then it will lock on that getting closer and closer to the enemy base.
There is an avoid bases function in the Guard marker ai in Platoon lua. I have not had time to check that out properly but I was planning on seeing if that could be used to keep designated platoons from running into enemy bases.
T1 units will be used in late game if the the economy can not support building T2 or T3 units.
Same with the defenses. If you are calling for an expensive weapon like T2 artillery and you have the priority at 1000 but the economy is low it is going to build a cheaper factory instead even if that factory priority is set at 300.
If you try to use the build conditions to make the AI build that T2 artillery first then it may not build that expansion base at all.
The biggest problem I see with the commanders is the lock up bug. This happens when the commander is called to defend the base. He goes from being a builder unit to a combat unit. Part of the problem at least seems to be here in the commander thread function found in AI behaviors,
Code:
#call platoon resume building deal...
if not cdr:IsDead() and cdr:IsIdleState() then
if not cdr.EngineerBuildQueue or table.getn(cdr.EngineerBuildQueue) == 0 then
local pool = aiBrain:GetPlatoonUniquelyNamed('ArmyPool')
aiBrain:AssignUnitsToPlatoon( pool, {cdr}, 'Unassigned', 'None' )
elseif cdr.EngineerBuildQueue and table.getn(cdr.EngineerBuildQueue) != 0 then
if not cdr.NotBuildingThread then
cdr.NotBuildingThread = cdr:ForkThread(platoon.WatchForNotBuilding)
end
end
end
end
end
Even if the commander does return to the base most of the time he does not get reassigned to a build platoon. I tried changing the 'Unassigned' and 'None' to various specific commander support platoons but still he does not reassign and the WatchForNotBuilding Thread does not even notice it. I opened all the debug comments in both the Sorian and the GPG and it does not matter if it is Sorian or GPG code the results are the same. Occasionally the commander will actually fork back to support and go about assisting and building but then another attack comes and he goes back into combat mode and sooner or later he will get stuck in combat mode and not come out of it.
Using the Sorian ai the commander is not actually idle. He goes into the commander hiding which keeps looping and he just sits there in the base until he is called to go fight again. I never followed up completely on this because I decided to actually play all the factions in campaign mode because I wanted to see how well the commander Ai worked in that AI and found another weird bug in the campaign totally unrelated to the commander and I have been trying to figure that out ever since. Keep getting side tracked trying to figure out one problem I always find another problem somewhere else
Moe