ra2
ra2 copied to clipboard
Make the AI replace harvesters and capture tech buildings
Adds https://github.com/OpenRA/OpenRA/issues/4561 and https://github.com/OpenRA/OpenRA/issues/15962 here.
There is a reason why CaptureManagerBotModule isn't used in the main mods. The AI is still gonna build that 1 engineer even after it captures everything it can. The trait probably should be revoked to ask the UnitBuilderBotModule to build the engineer, like HarvesterBotModule does, instead of UnitBuilderBotModule building the Engineer by itself and CaptureManagerBotModule finding and using the Idle Engineer.
If you still wanna keep the CaptureManagerBotModule. At least add engineer
to ExcludeFromSquadsTypes:
so AI won't attack with them.
IMO that really isn't good enough. The fundamental issue is that the AI builds single engineers and then fires the at a tech structure with zero logic as to what is between the barracks and target. A single pillbox/guard tower along the route is enough to turn this feature into a significant AI regression.
This feature needs to be implemented properly, with logic to guard the engineer and path around danger, which will be possible once someone finally implements the AI team plumbing.
add
engineer
toExcludeFromSquadsTypes:
so AI won't attack with them.
Done.
IMO that really isn't good enough. The fundamental issue is that the AI builds single engineers and then fires the at a tech structure with zero logic as to what is between the barracks and target. A single pillbox/guard tower along the route is enough to turn this feature into a significant AI regression.
This feature needs to be implemented properly, with logic to guard the engineer and path around danger.
Maybe a range limit too, so AI won't try to capture something at the other side of the map? But still capture stuff in/really close to its base.
The AI will target oil derricks in the vicinity first so this works surprisingly well even with such a simple implementation. I doubt we want to copy the CaptureManagerBotModule
here and try fixing the issue so this is an upstream engine problem.
I doubt we want to copy the CaptureManagerBotModule here and try fixing the issue so this is an upstream engine problem.
Yes, i just commented here first, because i saw the PR here first. You should handle those concerns in OpenRA/OpenRA#17831.
ok, the harvester being replaced works (as the AI builds the harvester if one is killed). My question is that the build order for AI is a bit skewed for refineries. Before it even tries to build vehicle production it always tries to build 4 ore refineries.
It also captured the refinery.
Tweaked the rules a bit to combat refinery spam.
Tweaked the rules a bit to combat refinery spam.
will test that now.
The new definitions definitely worked:
Now after the first refinery either builds a defensive building or a barracks, then after the 2nd refinery it builds the war factory.