ra2 icon indicating copy to clipboard operation
ra2 copied to clipboard

Make the AI replace harvesters and capture tech buildings

Open Mailaender opened this issue 4 years ago • 10 comments

Adds https://github.com/OpenRA/OpenRA/issues/4561 and https://github.com/OpenRA/OpenRA/issues/15962 here.

Mailaender avatar Mar 22 '20 10:03 Mailaender

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.

MustaphaTR avatar Mar 22 '20 12:03 MustaphaTR

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.

pchote avatar Mar 22 '20 12:03 pchote

add engineer to ExcludeFromSquadsTypes: so AI won't attack with them.

Done.

Mailaender avatar Mar 22 '20 12:03 Mailaender

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.

MustaphaTR avatar Mar 22 '20 12:03 MustaphaTR

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.

Mailaender avatar Mar 22 '20 12:03 Mailaender

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.

MustaphaTR avatar Mar 22 '20 12:03 MustaphaTR

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.

Base Profile Screenshot 2020 03 22 - 13 04 23 59 Base Profile Screenshot 2020 03 22 - 13 10 25 79 Base Profile Screenshot 2020 03 22 - 13 12 43 99 Base Profile Screenshot 2020 03 22 - 13 13 45 40

sorcerer86pt avatar Mar 22 '20 13:03 sorcerer86pt

Tweaked the rules a bit to combat refinery spam.

Mailaender avatar Mar 22 '20 20:03 Mailaender

Tweaked the rules a bit to combat refinery spam.

will test that now.

sorcerer86pt avatar Mar 22 '20 20:03 sorcerer86pt

The new definitions definitely worked: Base Profile Screenshot 2020 03 22 - 22 13 53 18 Base Profile Screenshot 2020 03 22 - 22 15 55 15 Base Profile Screenshot 2020 03 22 - 22 15 59 85 Base Profile Screenshot 2020 03 22 - 22 13 48 10

Now after the first refinery either builds a defensive building or a barracks, then after the 2nd refinery it builds the war factory.

sorcerer86pt avatar Mar 22 '20 22:03 sorcerer86pt