A "real" AI cheat

At any rate, here's my postulization: As I think about it, I clearly notice this behavior occuring in a very specific situation, and there is no doubt that it is happening. When I have a unit on sea patrol (guarding a sea resource) and an attack sub comes to pillage that resource, a game mechanism prevents the attacking sub from actually pillaging that resource and instead initiates a battle between that foraging sub and my "on-call" defensive naval unit. Of course, for this exploit, the attacking sub loses and withdraws, and still possesses movement points. It then immediately attempts to pillage that very same resource again (or another next to it) and the game mechanism again takes over to prevent the pillaging and re-initiates combat. Hence, a second combat. Now, in this scenario, it should be clearly understood that the attack sub is not directly attacking my defensive naval unit but is instead attempting to pillage a resource that my naval unit is "on patrol" to protect; it is the multiple attempts at pillaging the same resource that initiates what appears to be multiple instances of attack, withdraw, attack, withdraw, attack...

Understand me?

(I've been silently following this thread.)

I think this could theoretically be bug-like behaviour in the game. I've never encountered it, but that doesn't mean it doesn't exist. The patrol function is clearly less tested than normal attack routines. It could induce bug-like behaviour.

I don't it is an AI exploit. From what I understand, it is the patrol function that allows ships to repeatedly initiate combat with hostile enemy units which try to pillage stuff close to the unit(s) on patrol duty. When AI units are on patrol protecting AI resources, then I see no reason why human units couldn't try to repeatedly pillage these AI resources and this would allow these units to repeatedly initiate combat.

It's a bit hard to find a perfect solution for this weird behaviour of the patrol function. You can't stop the patrol function from initiating repeated combat because that would stop the function from doing what it says it does: protect the resources. I also wouldn't be in favour of removing the ability of multiple move units to pillage more than once or to attack and pillage. It is one of the great advantages of fast units and it would especially hurt the fast land units. They wouldn't be able to move in a large stack and pillage or attack and pillage. You could change the patrol unit into the attacker and thereby deny the pillager the possibility to retreat but that would give the pillager the defencive terrain bonus of coastal terrain which I personally think is a bad idea. The advantage should be towards the defender.
If this bug-like behaviour really exists, then I would disallow a unit who is in combat with a patrol unit the possibility to retreat. It's a special case rule, but in my opinion the best way to solve the strange bug-like behaviour.

But first things first. We need a controlled environment test that can show whether this issue with the patrol function really exists. I don't have the time to do that now so I hope Psyringe has the time and willingness to set up a world builder scenario again. Luckily, it's much easier to prove a bug than to disprove it. You just need one repeatable instance of the bug to prove its existence.
 
Doesn't sound like a "a real AI cheat" at all. It's simply using the game mechanics that any player can use. That's what sea-patrol is for. If you don't like using sea-patrol, then just park your ships right over the resource.

Seems silly to use a game feature, then state it's a cheat because you don't understand the feature.
 
It's certainly an interesting proposition, and from what I read, it shouldn't be too difficult to make a testbed for it. I doubt that I'll find the time for it today, but tomorrow seems feasible.
 
I just read the thread and I noticed one thing; The OP was originally stating that this happened for Horse Archers and other multiple move-AI units. This should not be possible with the new found example. Perhaps this does not occur, perhaps it occurs when the AI wants to pillage a tile with a mounted unit without visuals of the area so that it simply tries to do the same thing as the subs do, with horses. I am more to the solution that it simply does only occur with subs, though.
 
It works:
Gave Hannibal 2 Attack Subs with Flanking I + II + GG-Tactics (total of 110% Withdrawal Chance) on my Fishing Boats surrounded by my patrolling Missile Cruisers.
First Sub wins vs my MC and then retreats 5 times (gain 10XP), second Sub retreats 7 times (gain 7 XP).

 

Attachments

  • pillageBlitz.CivBeyondSwordSave
    14.1 KB · Views: 50
(I've been silently following this thread.)

I don't it is an AI exploit. From what I understand, it is the patrol function that allows ships to repeatedly initiate combat with hostile enemy units which try to pillage stuff close to the unit(s) on patrol duty. When AI units are on patrol protecting AI resources, then I see no reason why human units couldn't try to repeatedly pillage these AI resources and this would allow these units to repeatedly initiate combat.

It's a bit hard to find a perfect solution for this weird behaviour of the patrol function. You can't stop the patrol function from initiating repeated combat because that would stop the function from doing what it says it does: protect the resources. I also wouldn't be in favour of removing the ability of multiple move units to pillage more than once or to attack and pillage. It is one of the great advantages of fast units and it would especially hurt the fast land units. They wouldn't be able to move in a large stack and pillage or attack and pillage. You could change the patrol unit into the attacker and thereby deny the pillager the possibility to retreat but that would give the pillager the defencive terrain bonus of coastal terrain which I personally think is a bad idea. The advantage should be towards the defender.

If this bug-like behaviour really exists, then I would disallow a unit who is in combat with a patrol unit the possibility to retreat. It's a special case rule, but in my opinion the best way to solve the strange bug-like behaviour.

It gives the AI a significant advantage in naval warfare when using attack subs. The reason it remains entirely an AI exploit is simply that the AI never uses the Patrol function to protect its own resources. At this point, I would even doubt that it's in the AI programming. I've played countless games on archi/Island maps and have never seen the AI do it. Of course, I don't really spend much time pillaging, so my experience might not be the best on this point. The AI doesn't seem to protect its resources at all. In fact, I was shocked to see the AI park 2 destroyers on a oil platform the other day when I was playing a pangea map (so much so, that I wondered if it had something to do with the new update including new naval tactics). Hence, for this simple reason, we humans can't reciprocate the tactic.

As to fixing it, I don't think we can, I think the patrol feature is basically broken once attack subs arrive on scene.
 
Doesn't sound like a "a real AI cheat" at all. It's simply using the game mechanics that any player can use. That's what sea-patrol is for. If you don't like using sea-patrol, then just park your ships right over the resource.

Seems silly to use a game feature, then state it's a cheat because you don't understand the feature.

That's not a very helpful comment. It's not a mechanic that any player can use; it's a mechanic that only the AI can use against the human. I don't play mp, so I can't speak to that. As to parking ships on a resource, well, that's a very rudimentary technique that lacks the sophistication of the "patrol" function. Quite simply, if I have 3 or 4 resources within one square of some central location, the patrol function permits me to protect all 3 or 4 resources at the same time. The advantage to that possiblity should be obvious. That's the very reason for the existence of the patrol feature.
 
I agree with Roland Johansen to disallow withdrawal for pillagers that attack patrols. It should not be too complicated to implement, something similar to the new "No withdrawal to the sea for land units" rule.
 
Thanks Dan, for demonstrating that I'm not entirely crazy. ;)

As to thinking that horse archers could perform the same trick, well, in archi/Island games I just never see horse archers. I just started playing pangaea maps, and had a city attacked by horse archers. I saw a full strength horse attack and then withdraw. And then I immediately saw a wounded horse archer attack (1 unit in animation as opposed to the healthy 3) and simply assumed I was seeing the same behaviour I've grown so accustomed to in my naval combats. That assumption caused me such frustration that I thought I'd post about it. I was thinking, first it was subs, now it's horse archers too.

In another post, when I stated that the behavior isn't consistent and I cannot account for why sometimes it happens and why other times it does not...well happily, after a little bit of meditation on the matter, I can now account for it.

Hence, at this point, I think it should be noted that we've isolated the problem and can rule out mounted units and simply blame fast attack naval units enabled with either inherent flanking or its enhancing promotions.

So, I'm not entirely crazy, just partially so. I think I will now edit the OP in order to reflect our discovery.
 
It is not only linked to extreme withdrawal chances, but then you will notice it more often. The problem is that the unit can engage multiple combats whenever it comes out alive and has movement points left to "pillage" again. If you patrol with Triremes the Attack Sub will blitz them away!

As there is no patrol command for land units this will never occur for mounted units.
 
It is not only linked to extreme withdrawal chances, but then you will notice it more often. The problem is that the unit can engage multiple combats whenever it comes out alive and has movement points left to "pillage" again. If you patrol with Triremes the Attack Sub will blitz them away!

As there is no patrol command for land units this will never occur for mounted units.

And too bad too. It would be cool if we could have units that were based inside a city tasked to defend cottages, irrigation and resources.

Yes, actually now that you mention it, I do remember seeing missile cruisers and battleships attack me multiple times too. I can remember a single missile cruiser that fired guided missiles at the three missile cruisers I had patrolling a resource, it then proceeded to kill all three ships. That really sucked. It happened on a large scale once before too. I had a large stack (twenty-five ships) patrolling a fishery just off the coast of the Viking mainland. They dow'd, hit my stack with dozens of guided missiles, and then sent a handful of stealth destroyers in to kill the entire stack. Wow, the patrol function really kinda makes naval combat murder. I'll be certain to never use it again. Might simply have to resort to "parking" now, or just letting the AI kill the fisheries.

Is the patrol feature available on MP and do the mechanics work the same? That'd be a great exploit to use on MP.
 
It's a bit hard to find a perfect solution for this weird behaviour of the patrol function.
Why not treat the pillage as an attack? Then on the mouseover for a pillage that can be intercepted, show a line from the patrol boat to the target tile.
 
You guys should report this to Solver.
 
I made some extra testing based on Dan's scenario, with Attack sub vs trirremes and vs destroyers and found 2 things:
- It seems that this happens a lot less if the sub wins a battle ( :dunno: )
- (Probably irrelevant) The subs seems to have a definite preference for attacking units to the NW ( :dunno: )

Start saves and below
 
I added the following code to bool CvUnit::canPillage(const CvPlot* pPlot) const

Code:
if (pPlot->isWater())
{
	CvUnit* pInterceptor = bestSeaPillageInterceptor(pPlot);
	if ((NULL != pInterceptor) && isMadeAttack())
	{
		return false;
	}
}

This prevents a unit to pillage (and thus engage another combat) if there is a protecting patrol nearby and the pillager has already fought a combat during its turn.

Test worked fine with my above attached testbed. If anybody is interested I will attach the modified dll as well.

Is this a viable solution to this problem? What do you guys think?
 
- It seems that this happens a lot less if the sub wins a battle ( :dunno: )

If it wins it will automatically advance to the tile of the patrolling defender (all single units in my scenario). It will then return to the Fishing Boat and try to pillage which costs of course movement points. If the patrolling units were all stacked on one tile the Subs wouldn't waste movement points.

- (Probably irrelevant) The subs seems to have a definite preference for attacking units to the NW ( :dunno: )

I guess NW is the first adjacent tile in a (X=-1:1; Y=-1:1)-loop over the directions.
 
If it wins it will automatically advance to the tile of the patrolling defender (all single units in my scenario). It will then return to the Fishing Boat and try to pillage which costs of course movement points. If the patrolling units were all stacked on one tile the Subs wouldn't waste movement points.
Not that. In both my tests I putted more than 1 unit in every tile ( 5 for the trirremes and 2 for the destroyers ) exactly to prevent it.
I guess NW is the first adjacent tile in a (X=-1:1; Y=-1:1)-loop over the directions.
In fanc it is a little diferent from that. It starts attacking in the SW if avaliable and then locks on NW. I even continued the test some more turns and the pattern holded.

P.S Your solution holds vs blitz promo?
 
P.S Your solution holds vs blitz promo?

Aahh, good point, it should do now:
Code:
if (pPlot->isWater())
{
    CvUnit* pInterceptor = bestSeaPillageInterceptor(pPlot);
    if ((NULL != pInterceptor) && (isMadeAttack() && !isBlitz()))
    {
        return false;
    }
}
ps. in your version 2 the Big Cheaters switch positions which costs movement points :lol:.
 
It seems you're complaining that using sea patrol gives an enemy player (such as the AI or another human in MP) a way to get a "free temporary" blitz if attempting to pillage resources. That's really the only "exploit" you're complaining about, isn't it?

I'm not entirely convinced that isn't intended behavior. By stopping them from attempting a second pillage, you're breaking the way pillage works. Even if they won the battle with almost full health, you're saying, "No, you can only pillage once per turn per unit." That's not the way pillage is supposed to work.
 
Top Bottom