Jump to content
Sign in to follow this  
rejenorst

Moving units out of combat (fleeing not working well enough)

Recommended Posts

I've been experiment around with various commands to try and get ai groups to disengage and run away out of a combat situation.

allowfleeing 1 is ok if the enemy has vehicles but in infantry engagements the AI seems to pause for a lengthy while before moving (if they even bother moving).

I've tried various iterations of setBehaviour (AWARE AND CARELESS),

I've tried various iterations of setcombatmode (BLUE IN PARTICULAR),

_group enableAttack false,

And various combinations of the following:

{_x setunitPos "UP"; _x disableAI "AUTOTARGET";_x doWatch objNull;_x doMove _targetPos,_x allowFleeing 1} forEach units _group;

In some cases some of the AI will get up and run while others will stand there and not move at all. I've also tried playing around with disabling "FSM" and "TARGET" to no avail.

I am just wondering if someone has found a good way to make the AI move in a timely manner the hell out of combat area or if they know why the AI units will just stand there even if a doMove order has been given?

Thanks in advance. I saw a few similar threads but they were either different in nature or already covered some of the commands above.

Basicaly I am trying to get the AI to be more self-preserving when its loosing a fire fight.

Edited by Rejenorst

Share this post


Link to post
Share on other sites

Just forget about it. :rolleyes:

Unless we get a proper doFleeTo command (or maybe a forget everything you "knowAbout" command might work too) or something from BIS, that's about the best you can do. Not sure how far you could get, with configs/addons, but by means of pure scripting you can't do it.

Tickets are over here: http://feedback.arma3.com/view_all_bug_page.php. Look if you find something suitable, then vote for it, or create another feature request. That's about the best you can do. :cool:

Share this post


Link to post
Share on other sites

:butbut: lol alright. Cheers for the info. After a fair bit of testing I noticed it seems to work well when in closer proximity to the enemy (urban combat) but over longer ranges on hilly areas it doesn't seem to work so well.

Share this post


Link to post
Share on other sites
or maybe a forget everything you "knowAbout" command might work too

I heard, they said, "forgetting on demand" is too complex to implement into existing AI. :/

Indeed, solutions, used to work in Arma 2 and even in earlier verions of A3 aren't reliable anymore, like this one (in 1.42 stable some may run away, but at least part will stuck looking, like they want to run too, but they're glued to the ground by some force):

RYD_Disengage = 
{
_gp = _this select 0;
_pos = _this select 1;

_units = units _gp;
_ldr = leader _gp;
_side = side _gp;

_bh = behaviour _ldr;
_cm = combatMode _ldr;

_gp enableAttack false;
_gp setBehaviour "CARELESS";
_gp setCombatMode "BLUE";

_tmpGps = [];

	{
	_tGp = creategroup _side;
	[_x] joinSilent _tGp;
	_tmpGps pushBack _tGp;

	_tGp enableAttack false;
	_tGp setBehaviour "CARELESS";
	_tGp setCombatMode "BLUE";
	}
foreach (_units - [_ldr]);

	{		
	_x allowFleeing 0;
	_x setUnitPos "UP";
	_x disableAI "TARGET";
	_x disableAI "AUTOTARGET";
	_x doMove [(_pos select 0) + (random 20) - 10,(_pos select 1) + (random 20) - 10,0]	
	}
foreach _units;

waitUntil
	{
	sleep 5;

	(({(alive _x) and {(_x distance _pos) > 40}} count _units) == 0)
	};

(_units - [_ldr]) joinSilent _gp;

	{
	deleteGroup _x
	}
foreach _tmpGps;

_gp setBehaviour _bh;
_gp setCombatMode _cm;
_gp enableAttack true;

	{
	_x allowFleeing 0.1;//pure guess
	_x setUnitPos "AUTO";
	_x enableAI "TARGET";
	_x enableAI "AUTOTARGET";		
	}
foreach _units
};

To spawn, not call, used like here - 0-0-0 radio trigger. If group isn't engaged in combat from the beginning, but enemy is approaching into their FOV later, it seem to work a bit better, but still units engaged in combat will tend to stuck temporarily or permanently, unable to reliable follow doMove. Also may work a bit better when used for reckless charge toward enemy, but only, if enemy shows up after they start to charge.

I'm pasting this anyway in case, something will change and this may work again in the future, as the best way, I found so far, that worked once. Bonus thing here is splitting group into one-man temporary groups to avoid potential interferences with group-level behaviours, like leader ordering something to the subordinate. AFAIK AI is still under development and situation is pretty fluid there. Definitelly reliable group disengage, as one of the most basic tactical maneuvers, should be implemented on the base AI level but IIRC it's one of the obvious-to-have things never present in Arma. AI are trapped in the combat till the end.

Edited by Rydygier

Share this post


Link to post
Share on other sites
solutions, used to work in Arma 2

Really? :p

IMHO this never really worked, and I wouldn't call any of what we have all tried a "solution" either. ;)

Bonus thing here is splitting group into one-man temporary groups to avoid potential interferences with group-level behaviours [...]

I might be wrong, but IMHO it doesn't get any better than a simple "doMove", since this takes the unit out of the "group-loop" for as long as the unit isn't unitReady and that doMove completed. Granted, the waypoint behaviour/combatMode which applies to a whole group could have an effect. Hm. Does that indeed make a significant difference? Anyways...

Definitelly reliable group disengage, as one of the most basic tactical maneuvers, should be implemented on the base AI level but IIRC it's one of the obvious-to-have things never present in Arma. AI are trapped in the combat till the end.

Tell me about it. IMHO what's needed is

  • An alternative to commandMove/doMove to address the problem on a per-unit level, how about: commandMoveForced/doMoveForced, or maybe commandRun/doRun?
  • And maybe even a new waypoint to address the problem per group, how about: a "RUN" instead of "MOVE" waypoint?

Is it crazy banana ticket time again? :yay:

Share this post


Link to post
Share on other sites
Really?

Really. It was well tested at that time. Not exactly same code, but code that was using same ways. There is a thread about that.

Does that indeed make a significant difference?

Made some difference in Arma 2.

Edited by Rydygier

Share this post


Link to post
Share on other sites

Ha, cool beans! ;)

Yet, I'd really prefer a "doRun"-command which could be easily used for so many other things... Thinking about it, maybe we should head over into the "Suppression (dev branch)"-thread and make some party/noise in there: in order for the AI to get to some cover/out of line of (suppressing) fire, some quicker movement could come in very handy... AI needs to step up it's movement game anyways...

What I'm trying to say: maybe now, the time has finally come! :cool:

Share this post


Link to post
Share on other sites

Yes, also noticed that a tactical withdrawal is not really on the AI's menu. I've been wanting a "don't care" mode since Arma 2 where the AI will just run / sprint to a given waypoint without bothering for their environment and what's going on there. Could be useful for fleeing, pulling back or even blindly storming enemy defences.

Share this post


Link to post
Share on other sites

Absolutely. And I think "doRun/commandRun", maybe together with a "RUN" waypoint (less important), would be the exact right level of generality (e.g. a "withdrawl" command would be already much too specific).

In the end, it's more or less just a change in priorities in the low-level FSM: movement first, over anything else (and details such as lower weapon, don't target/shoot, run instead, etc.). So implementation should be totally possible/not too much of a hassle. :rolleyes:

But there must already exist a ticket/feature request for this, no (...I feel like I've already reached my ticket-spam-cap for a bunch of days, bwahaha)?

Share this post


Link to post
Share on other sites

Thank you for the responses. I haven't tried creating a new group for the units. I may give that a try but it may be problematic with for the scripts I am using.

Share this post


Link to post
Share on other sites

This has been a core requirement in my mod so I spent a lot of time trying to figure this out.

I ended up manually moving those jackasses, while playing running animations. Works quite well if there is a clean, straight los. I guess you need to make some pathfinding too for more complex movements.

So it's pretty much doable if you have enough time on you.

Share this post


Link to post
Share on other sites

A quick and dirty solution might be setting the courage of the AIs to 0 with setSkill array. Makes them run most of the times.

Example would be:

COWARD_AI setSkill["courage", 0];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×