Jump to content
madrussian

Helicopter pilot crash avoidance (enabling/disabling)

Recommended Posts

Hi all, I'm transporting & unloading some AI ground troops via helicopter (piloted by separate AI group as crew) in my mission.  I've done tons of experimentation with clear point selection, "TR UNLOAD" & "SCRIPTED" (with "A3\functions_f\waypoints\fn_wpLand.sqf" script) waypoints for the chopper crew, along with "GET OUT" for the cargo men.  Having some good success trying this different ways.  It's a dynamic mission landing/unloading men at random positions and this part needs to work reliably.

 

My one big remaining problem is:  Once landed, during the process of unloading sometimes the AI helo crew takes off and flies straight up, causing men to fall to their deaths as they unload.

 

This used to happen all the time, until I started syncing the helo crew group's "TR UNLOAD" WP with the ground troop group's "GET OUT" WP, or alternately using lockWP on the helo crew group for the duration of the unload.  With either of these measure in place, now AI helo crew mostly unloads crew without incident, but sadly now very rarely sometimes still takes off and flies straight up during unloading (again causing unloading men to fall to their deaths).  So the problem still happens, just way more rarely now.

 

Somewhere along the line, I observed this bolting straight up by the helo crew during unloading, only starts once one or more cargo guys get unloaded.  I am now ~ 98% convinced, that the helo crew is taking off this way as part of it's collision avoidance mechanic, which you'll also see in the air all the time when AI piloted helo gets too close to another aircraft.  Seems to me, the AI pilot flies straight up in an attempt to avoid crashing into the guy he just unloaded to the ground.  I'd like to test this theory, and I'm wondering how to turn this crash avoidance off.

 

The question:

How does one enable and/or disable helicopter pilot crash avoidance?

 

Btw - For my purposes, I'm talking about actually landing the helo on the ground (so no fastrope), and with engine remaining on for the duration.  I know turning engine off might help with this, but I am bound and determined to make this work with engine on.  Thanks!

Share this post


Link to post
Share on other sites

The phenomenon you describe is hard to override. It took me days, weeks for tuning the helo part of my TAXI module.

I didn't stop til I succeeded in pick/drop my group at any place of the map:  on sharp side of the Tanoa volcano (oups blades!), on jungle, at sea (usually helo sunk)...

 

Now it's done and here are some hints. Mind for:

 

1 - always use an helipad at destination. If not existing, create an invisible helipad, on a worthy position: I mean its z altitude must be in accordance with the relief or the sea level+state; 

2 - use simple move waypoint and add the land command on completion (when unitReady for the pilot or close to waypoint):  yourHelo land "GET OUT";

3 - disableAI "fsm","autocombat","target","autotarget"  for the pilot. It's mandatory for combat landing (and probably avoiding too much reaction).
4 - cut the trees if any close to helipad, something like:
 

Spoiler

 

private _obstacles = nearestTerrainObjects [_pos, ['tree'],25,FALSE,TRUE];
  if !(_obstacles isEqualTo []) then {
  [_obstacles,{ {_x hideObjectGlobal true} count _this}] remoteExec ['call',2];

};
note: I had to remoteExec on server because I run the whole script from an addAction (calling the helo) in MP

 

 

Of course, after that, you need to script for helo (taxi) order, but that's the basic for start.

 

  • Like 1

Share this post


Link to post
Share on other sites

Nice, really great summary.  Let's see...

 

18 hours ago, pierremgi said:

1 - always use an helipad at destination. If not existing, create an invisible helipad, on a worthy position: I mean its z altitude must be in accordance with the relief or the sea level+state; 

 

I'm currently using helipad.  Also in my case attaching helo crew group WP to helipad via waypointAttachObject, which I'm hoping forces particular helo to choose that exact helipad, for cases in which several helipads are close together.  Not totally sure waypointAttachObject works this way, but overall seems to do ok.

 

18 hours ago, pierremgi said:

2 - use simple move waypoint and add the land command on completion (when unitReady for the pilot or close to waypoint):  yourHelo land "GET OUT";

 

This sounds very streamlined & promising.  Haven't tried this exact combination yet.  I'm guessing you'd have to also control helo speed to make sure he doesn't totally overshoot helipad (having to boomerang back around), based on my experiments with the "SCRIPTED" WP (with "A3\functions_f\waypoints\fn_wpLand.sqf" script) & otherwise land command by itself.

 

18 hours ago, pierremgi said:

3 - disableAI "fsm","autocombat","target","autotarget"  for the pilot. It's mandatory for combat landing (and probably avoiding too much reaction).

 

I seem to recall using disableAI "ALL" (on pilot) and still having helo bolt straight up during unload.  But that was before I was inhibiting helo from travel to his next WP (via syncing helo crew group WP together with cargo group WP, or lately instead using lockWP on the helo crew group).  Anyhow sounds promising, will try these exact disable AI with what I've got currently.

 

18 hours ago, pierremgi said:

4 - cut the trees if any close to helipad

 

In my case, created an expanding clear / flat (within threshold) point selection routine, spawned and which increases nearestObjects radius at same additional area per cycle (the goal being no impact on fps).  Seems to be super reliable, but can't always find a point in densely packed areas.  Never thought about automatically cutting down the trees!

 

@pierremgi - Curious in your landing/unloading system, (as far as you can tell) were you able to totally eliminate this upward helo bolting (aka "falling man syndrome")?  Or for you does it still rarely happen like I'm seeing here?

 

Share this post


Link to post
Share on other sites
49 minutes ago, madrussian said:

@pierremgi - Curious in your landing/unloading system, (as far as you can tell) were you able to totally eliminate this upward helo bolting (aka "falling man syndrome")?  Or for you does it still rarely happen like I'm seeing here?

 

 

No problem so far. As said, the helipad height may have importance, not only for water but also uneven terrain. I did a function for calculating a little height = f(size of helo, slope).

Share this post


Link to post
Share on other sites
5 minutes ago, Gunter Severloh said:

Hey madrussian have you tried HAS?

 

Yep, tried it and wow yes it's extremely useful!  (btw thanks for releasing)

 

But iirc (& please correct if I've got this wrong) HAS is for moving player groups around.  Of course there are big differences when you want to move AI (like far more than meets the eye).

 

7 minutes ago, pierremgi said:

No problem so far. As said, the helipad height may have importance, not only for water but also uneven terrain. I did a function for calculating a little height = f(size of helo, slope).

 

Glad you got it working so consistently.  I've been placing my helipads at exactly getTerrainHeightASL.  Should they perhaps be up a certain small amount?

Share this post


Link to post
Share on other sites

Yes. Play with surfaceNormal (of ground) and 0 boundingBoxReal helo  for adding a little vector on the helipad's position.

  • Like 1

Share this post


Link to post
Share on other sites

My pal froggyluv says (via PM) I should mention I'm landing these helos in an extremely hot combat zone.  So again (at this stage, now that I'm inhibiting helo from continuing along it's WPs while unloading), yes I'm pretty certain it's the helicopter pilot crash avoidance kicking in (causing pilot to bolt upwards), quite possibly when helo or pilot taking hits or similar.

 

20 hours ago, pierremgi said:

3 - disableAI "fsm","autocombat","target","autotarget"  for the pilot. It's mandatory for combat landing (and probably avoiding too much reaction).

 

^ Adding to my code now, & very hopeful this suggestion will improve things. 😉

 

Meanwhile, any other ideas specific to getting helicopter pilot to disable his crash avoidance mechanics?  Like even in the air this might be a problem for certain scripts.  Barrel bombing from helos comes to mind, or other applications where uninterrupted level helo flight is required.

Share this post


Link to post
Share on other sites
5 minutes ago, madrussian said:

 

 

 

^ Adding to my code now, & very hopeful this suggestion will improve things. 😉

 

 

Don't forget to start with a "SAFE" behavior for the pilot's group. Apply the disableAI on pilot only. This way, gunners can fire at enemy.

No script, but invincible helo + crew ,will guarantee a successful move when helo is hit.

  • Like 1

Share this post


Link to post
Share on other sites
29 minutes ago, madrussian said:

Yep, tried it and wow yes it's extremely useful!  (btw thanks for releasing)

  

But iirc (& please correct if I've got this wrong) HAS is for moving player groups around.  Of course there are big differences when you want to move AI (like far more than meets the eye). 

Welcome. You can have AI board a chinook if you want, as long as the heli is synced with the module or the game logic which

ever method you use, the script or module, and it should work the same.

 

   I never tested without AI under my command, as i know under your command you give the orders to the AI pilot

as soon as one of your AI boards the heli, from there to do what and where you want the heli to go to.

    As far as AI squad or groups by themselves never tested and then too it probably wont work as there is nothing

they could initiate on their own unless you code it in via script in relation to the HAS script or module.

    The module is the script, just more streamlined and efficient.

 

Btw i'll add this thread to my AI compilation list when i update next, have you see the AI heli threads on it?

  • Like 1

Share this post


Link to post
Share on other sites

Thanks guys, great ideas, (& video, and code to examine)... should get me going towards a solution.  Once I stop this rare sky suiciding insanity, will report back here on which specific thing(s) broke the case.

Share this post


Link to post
Share on other sites

You can also enableSimulation false on pilot until all units unloaded.  I think I did that for my Property of Mabunga mission heli extracts.

  • Like 2

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

×