Posted: Wed Jun 10, 2020 6:47 pm Post subject:
AI Picking Up Random Specific Targets
Tried to summarize the main issue in the subject name.
So this is something I'm pretty sure is not the case in vanilla RA2 or even YR for that matter, and I'm curious to know if anything I've fiddled with may have caused this, or if anyone else has noticed this before. I've noticed it with more recent versions of Ares, but I'd have to test old versions to see if there's any correlation. Again, it could just be something I did.
In general with vanilla TS or RA2, when a script type tells a unit to attack vehicles (0,5), defenses (0,7), or even all (0,1), the AI will indeed follow those specific target orders. From my understanding however, it has always been to attack the nearest target that fulfills the requirement (as in 0,5 has AI teams hunt down vehicles, with each new target being the next closest vehicle to destroy -- that's common sense stuff and all).
For the longest time, that's how my mod has ran, and I would assume pretty much all mods. Unless there's a specific value change I made, or something got changed with the targeting in Ares recently, I'm not sure what's going on.
The AI will attack far away, specific targets for no apparent reason. I doubt it's threat rating related, cause it's often very weak units such as Initiates or IFVs being targeted. In some cases, construction yards or random defenses also.
I can't think of a simple way to explain this. Let's say the map is Heck Freezes Over. You have an AI in the bottom left, middle left, and top left spots battling, and one lone AI in the top right corner hardly being attacked. The AI on the bottom left is primarily targeting the middle left player (that is, their "House Enemy" who they use super weapons on and gather units to attack by). Typically, you could expect that if the top right AI sends some tanks near the bottom left, Harriers from the bottom left player would attack the tanks (assuming you don't set the Harrier TeamType with OnlyTargetHouseEnemy=yes, which in that case would lead them to only attack the middle left player for as long as they're alive or if they suddenly decide another player is a larger threat), since the vanilla Harrier attack is scripted with 0,5, indicating they will attack whichever vehicles are closest to them. The bottom left player is effectively taking out any enemy that comes near, That's good. I want the AI to do that as they always have. Now I'm not saying they don't do that at all, but here's where the problem comes in.
Now, that same harrier attack from the bottom left player with no script or teamtype changes in my mod will target a very specific unit in the back of the top left player's base, or even the top right player's base, completely disregarding the middle left player who's actually attacking them. Those other players are nowhere near them, nor can they be perceived as a threat at the moment, since neither are actually attacking the bottom left player.
Another example shows that it seems to affect all AIs the same. Although AIs tend to favor attacking human players, I have seen this same issue in AI testing maps. It is easy to see when playing as Yuri. I pop up a Psychic Radar in an 8-player free-for-all, I will have dozens of unit lines from all seven AI players (infantry, vehicle, aircraft -- all unit types) targeting this one specific Initiate or Lasher Tank. I could be on a map where everyone else is in one place and I am in the far away isolated spot on the map, not threatening anyone, and they could still decide my one Initiate is more of a threat. In fact, I could place the Initiate in a bio reactor (thus hiding him from the map), and all those lines would suddenly disappear, or in some cases pick up a new random target in my base.
Basically, I have units disregarding their nearest enemies (following typical attack scripts), and traveling anywhere and everywhere to attack one unit that should be of a zero concern to them, often getting themselves destroyed by ACTUAL threats along the way. This is especially annoying with aircraft flying over enemy bases (often getting shot down) on their way to some random target on the complete opposite end of the map. Now this obviously only happens on teams with OnlyTargetHouseEnemy=no, meaning they can target any enemy player, but even then, in the vanilla game, this would just mean they would attack whichever enemies were closest (snipers hunting down any nearby infantry, Tank destroyers hunting down any nearby tanks, Kirov Airships targeting the nearest factories, Harriers targeting the nearest enemy vehicles). They would never decide to target some player on the other side of the map (unless they were actually their house enemy, but that will almost always be the nearest opponent engaging with them).
If I can TL;DR this, it'd be AI picking up specific faraway targets and disregarding the targets right next to them (generally ones which are far more threatening).
I could just make sure teams don't have Suicide=yes and will retaliate to anything attacking them (applies more to aircraft), but that doesn't explain why they want to attack something on the opposite side of the map in the first place. It is indeed the case that "attack this" scripts (0,x) are supposed to have them attack the nearest target that fulfills this, right? _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
Maybe they are targeting the one with smallest ID (created earliest)? From what I can remember, AI will do that in a certain situation (can't remember which). QUICK_EDIT
Just set TargetDistanceCoefficientDefault=-1 in rules.
Have given full explanation on the effect of TargetDistanceCoefficientDefault on 0,n attack targettype script actions at ModEnc. Also have given the difference between move and attack script in Aggressive and Suicide teamtype flags.
Hunt script can target any, not limited to only enemy. OnlyTargetHouseEnemy limits it to target only the house that the AI considers as enemy.
You guys are indeed right about the distance coefficient. I can't say I ever knew it had such a significant purpose. Never looked into it before!
And Virgil, from what E1 linked, it appears that's how they choose targets when they are outside the scanning range set by the distance coefficient. That also explains why it was generally weak/starting units being randomly targeted, because those starting units would count as the "first created."
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum