Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Apr 18, 2024 5:59 pm
All times are UTC + 0
Why does the AI obsess over Aircraft?
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [8 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
PePsiCola
Cyborg Specialist


Joined: 28 Dec 2010
Location: The United States

PostPosted: Wed Jun 19, 2019 4:13 am    Post subject:  Why does the AI obsess over Aircraft? Reply with quote  Mark this post and the followings unread

It is probably well known that when it comes to RA2 AI, aircraft will be the most important target to AA units if it is an option. This problem occurs unless the AI units are scripted to attack specific objects such as factories, infantry, or vehicles.

However, if a script type specifies that AI units should attack everything (the script code 0,1) then they will always choose aircraft as their first target. And I mean they will allow aircraft to interrupt their attack pattern. For example, if a group of IFVs are instructed to attack everything, they will attack the nearest units/structures as expected, but should a spy plane or paradrop plane spawn, or have enemy units present on an airpad or in flight, the IFVs will cease whatever they are attacking and immediately go after said aircraft.

I spend a lot of time testing and balancing the AIs, and I find it really kills their efficiency in destroying an opponent if their AA capable units keep wandering off to attack some spy plane on the complete other side of the map that doesn't even threaten them, often getting their units destroyed in the process. As such, I am forced to keep AA units scripted to attacking only vehicles, structures, or whatever else, despite that they would be far more effective against their opponent if they targeted everything (for example, an Apocalypse).

Has anyone ever found a solution to this, or will we have to wait for something like Ares to implement a fix? It's quite obnoxious to watch. I will say CanApproachTarget does not help this, as it only keeps them from following nearby aircraft across the map when in guard mode around their base.

_________________
Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Wed Jun 19, 2019 4:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Try if setting TargetDistanceCoefficientDefault=-1 helps. More details at ModEnc.

You should also check if any AI TeamType needing the same set of units has higher Priority= and recruiting those specific units and assigning them to its own missions. Check with Tutorial.

Back to top
View user's profile Send private message
PePsiCola
Cyborg Specialist


Joined: 28 Dec 2010
Location: The United States

PostPosted: Wed Jun 19, 2019 4:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

I can't say I saw any difference, as AA units told to attack everything still went out of their way to chase Spy Planes and literally the rockets from a V3 being launched at other opponents on the other side of the map.

_________________
Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Wed Jun 19, 2019 6:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

You could try DistributedFire on AA units so if they manage to fire on the aircraft they'll turn to something else?

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
m7
Commander


Joined: 17 Apr 2009

PostPosted: Wed Jun 19, 2019 9:38 pm    Post subject: Reply with quote  Mark this post and the followings unread


Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Wed Jun 19, 2019 11:55 pm    Post subject: Reply with quote  Mark this post and the followings unread

Try by setting AreTeamMembersRecruitable=no for the TeamTypes being tested. Can achieve the same by setting Priority to the highest value being used in the TeamTypes.

If you are not sure of the teamtype being tested is the same one executing attack anything script, could increase the units in taskforce or add some unique unit to the taskforce to identify or even test it on SP map.

Back to top
View user's profile Send private message
WoRmINaToR
Rocket Cyborg


Joined: 31 Oct 2008
Location: AKA Sir Prize

PostPosted: Thu Jun 20, 2019 5:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

m7 wrote:
Giving AA related units CanApproachTarget=no to prevent them from chasing units across the map according to ModEnc.

https://www.modenc.renegadeprojects.com/CanApproachTarget


As I understand, that only stops units from chasing after they have already acquired a target, or from closing the distance when in guard mode and acquiring a target that's outside their weapon range. That doesn't affect target selection on the Attack Anything script action.

That said, I've never observed AA units prioritizing AircraftTypes over VehicleTypes on an Attack Anything mission. Do your taskforces have exclusively AA units, or a mix? Generally the order of threat scanning on Attack Anything goes VehicleTypes, AircraftTypes, InfantryTypes, and then BuildingTypes last.

Back to top
View user's profile Send private message YouTube User URL
PePsiCola
Cyborg Specialist


Joined: 28 Dec 2010
Location: The United States

PostPosted: Sat Jun 22, 2019 2:37 pm    Post subject: Reply with quote  Mark this post and the followings unread

G-E wrote:
You could try DistributedFire on AA units so if they manage to fire on the aircraft they'll turn to something else?


That is generally what happens anyway. They will leave their current target to destroy a single particular aircraft, and once it is gone they will return to their primary mission. Although if there are many aircraft present, they made end up going around in circles chasing them all down.

I've already had CanApproachTarget=no attached on just about every AA unit, but as Worm pointed out, that has to do with chasing an acquired target. Say they are sitting in their base on guard mode and a spy plane flies by, CanApproachTarget=no just prevents them from traveling to chase it down.

But yeah, this issue has entirely to do with the actual target selection priorities. I can only imagine it has something to do with AircraftTypes themselves.

_________________
Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
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


Powered by phpBB © phpBB Group

[ Time: 0.1622s ][ Queries: 11 (0.0073s) ][ Debug on ]