Search the Community
Showing results for tags 'autocombat'.
Found 1 result
-
Disabling “AUTOCOMBAT” for AI-only groups (Issues & Solutions)
madrussian posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I’m happy BIS introduced the ability to disable AI component “AUTOCOMBAT” a while back (via disableAI command). It’s quite useful in getting the AI moving and avoiding getting bogged down in COMBAT, but apparently only in very specific circumstances for AI-only groups. Like getting the AI to run somewhere fast (as in flee) and while not stopping to shoot back at any enemies. Old Painless has an excellent formula for exactly this case that he detailed over on the Dev Branch AI thread. It really works great in my tests! My dream is a little different, but seems like it should be doable: You know how as a player (leading our AI group), we can move around and our AI will keep up formation and shoot at the enemy, scooting along and shooting as they go? That is, until they sense a certain level of danger and all go into COMBAT? Even before we had ability to disable “AUTOCOMBAT”, this has always been possible for player-led groups. For lack of better terminology, I’ll call it AWARE scooting with shooting. Seems like this same thing ought to be possible with an AI as group leader (especially now that we can disable “AUTOCOMBAT”). Here’s what happens when I try it. First, I disable “AUTOCOMBAT”, like this: { _x disableAI “AUTOCOMBAT”; } foreach (units _group); Good to go so far, give that AI-only group a WP and they happily move toward it. When they discover an enemy, they (sometimes some, sometimes all) stop, turn and fire, as expected. And here’s where the trouble starts. When the enemy is neutralized (or teleported away), the stopped AI don’t start moving again. Often, they don’t start moving again ever. It doesn’t matter what code I run on them to try and get them moving again. I tried all this: { _x doWatch objNull; _x forceSpeed -1; _x stop false; _x disableAI "TARGET"; _x disableAI "AUTOTARGET"; _x disableAI "COVER"; _x disableAI "SUPPRESSION"; _x enableAttack false; _x doFollow (leader _group); } foreach (units _group); (in various combinations / orders) They start moving again for a moment and then stop again. (which makes me think maybe the AI group leader is ordering them to stop again repeatedly). I tried disabling various AI components of all subordinates before they ever find an enemy to begin with. I tried disabling various components of specifically the group leader’s AI, including “ALL”. I tried using a game logic as the leader of the group. [I did notice that the stuck guys do "Return to Formation", if the group leader comes close to them at some point in the future. (Obviously, this isn't a practical solution though for real-world missions.)] Eventually, I used marks to track the expectedDestination (composed of [position, planningMode, forceReplan]) on each of the units, and noticed that all the units (including the stuck guys) are where their expectedDestination wants them to be at (which makes me think maybe the group leader is ordering them to those locations). I also noticed the stuck guys are in their own formation, distinct from the moving guys formation (even though they are all in the same group). [I’m using an automatic marker system to view and track all this.] I experimented with using FSMs to modify their expectedDestination, and those stuck AIs stayed stuck. For the life of me though, I can’t get those stuck guys moving again! The one thing that works is to disable their native FSMs via: _x disableAI “FSM”; But then they only move, and don’t turn or stop to shoot at enemy. (Which turns out to be similar to Old-Painless’s cocktail from the AI dev thread mentioned above, useful but not what we’re looking for here.) I don’t want to write a full-blown FSM to do targeting, cover, etc (although it would really just be targeting and moving, as cover seems to apply only to Combat mode). I want to piggy-back off the native solider combat and formation FSMs, and let those do the stopping / shooting, but unfortunately those FSMs don’t seem to account for an AI-only group with “AUTOCOMBAT” disabled. Steps To Repeat: Create an AI-only group in the editor Disable “AUTOCOMBAT” on all units in the group (via disableAI) Give group a waypoint semi-far away Give group a temporary threat, ideally small threat that AI-only group will shoot at but which won’t shoot back (I was using myself as the different-side player with allowDamage false, teleporting in, getting them shooting at me, then teleporting out). Fire up mission. Observe, AI-only group moving towards WP normally Have AI-only group run into temp threat, observe AI-only group stop and shoot at enemy. Observe AI-only group remains in AWARE mode and does not enter COMBAT mode, as expected. Have threat be eliminated (or disappear or get teleported away, etc). Observe stuck AI-only group units (whoever stopped to fire when threat was present) Experiment with dozens or even hundreds of commands (in various combinations) to try and get stuck AI to “Return to Formation” and resume movement quickly This type of Ai-only Aware-only scoot-and-shoot would allow AI to cover ground more quickly (much like the player can) and would be awesome for all sorts of missions! I feel like we were let down a bit, regarding the (implied) promise of disabling “AUTOCOMBAT”, as it doesn’t seem to work out-of-the-box with AI-only groups. (Best outcome - I'm not sure whether this is really a bug per say, but maybe BIS can provide a quick fix?) I know it’s a long shot, but has anyone got anything like this Ai-only Aware-only scoot-and-shoot working? Any ideas? (P.S. I’d be very happy for now with a way to simply get the stuck guys to “Return to Formation”. Thanks!)