PDA

View Full Version : Making AI Land


5./JG27.Farber
04-05-2012, 08:41 PM
Does anyone know the trick to making the AI land? On some bases they will land but go off the end of the runway and crash. Othertimes they just circle the runway forever... Is it just a case of some runways will allow AI to land and others wont or what?

If anyone has an example of this working consistantly could you send me the mission please.

Thanks.

FG28_Kodiak
04-05-2012, 09:15 PM
the problem it the task of the airgroup. If the airgroup task is RETURN, the aircrafts often circle around their destination airfield, till running out of fuel. The task will become RETURN if a Aircraft is damaged or low on fuel. There is no way to change the RETURN-State into LANDING, so you must take care that all Aircrafts get Home before they 'decide' to do it automatically.

Here you will find a script example
http://forum.1cpublishing.eu/showpost.php?p=404729&postcount=3
take a look on OnTickGame, i send the Airgroup home at a Fuellevel at 150 (Bf109 has a value of 300 on 100% Fuel so it's the half).

Lets hope this behavior is fixed in one of the next patches :rolleyes:

5./JG27.Farber
04-05-2012, 09:59 PM
Hmm Im not even talking about anything so complicated. I just want them to go to the last way point and land. Like in old IL2.

5./JG27.Farber
04-05-2012, 10:21 PM
Nevermind - I got it. This is how I did it.

Place a normal flight at 500m's altitutde near the airfield. Place a landing way point on the plane icon on the airstrip. Ensure the landing waypoints speed is 0.

Larger aircraft like He111 will try and park in the small blast pens but will not explode.

FG28_Kodiak
04-06-2012, 04:04 AM
By my tests this works not very often, unfortunately. If the Task is RETURN all waypoints except the last are ignored, so the problem still exist. But i will make more tests, may be you find the holy grail of waypoint handling :grin:

hc_wolf
04-06-2012, 05:11 AM
By my tests this works not very often, unfortunately. If the Task is RETURN all waypoints except the last are ignored, so the problem still exist. But i will make more tests, may be you find the holy grail of waypoint handling :grin:

Never fails for me.
Set normal fly waypoint then
Set waypoint landing not to far from runnway.
Set altitude between 0 and 300
Set speed to 0 but it will default back to 169

They hit the landing waypoint and the first peels off to half circle and land, the others fly on a little circle behind first and all follow in.

I get no fly rounds like kodiak says. I did get that in scripting a while ago and fixed it.

FG28_Kodiak
04-06-2012, 07:20 AM
If the task is RETURN? The Task get in RETURN state if the AI gets out of fuel or is damaged and automatically return to base. If this not the case (the task is LANDING) all work fine for me, also. So i will make more tests :rolleyes:

hc_wolf
04-06-2012, 07:36 AM
You thought about a passthrough near airfield or along returnpath to switch to landing

Just an idea

Or have the passthrough around the base 2000m so when AI return to the area threre is a time trigger to switch them to land also

Osprey
04-06-2012, 08:09 AM
Now you guys are making me check my maps again to check if they do land because I just sent the AI in the direction of the base as a normal and then did a normal landing, just like 1946, and no problem.

salmo
04-06-2012, 08:13 AM
the problem it the task of the airgroup. If the airgroup task is RETURN, the aircrafts often circle around their destination airfield, till running out of fuel. The task will become RETURN if a Aircraft is damaged or low on fuel. There is no way to change the RETURN-State into LANDING, so you must take care that all Aircrafts get Home before they 'decide' to do it automatically.

Here you will find a script example
http://forum.1cpublishing.eu/showpost.php?p=404729&postcount=3
take a look on OnTickGame, i send the Airgroup home at a Fuellevel at 150 (Bf109 has a value of 300 on 100% Fuel so it's the half).

Lets hope this behavior is fixed in one of the next patches :rolleyes:
After more testing, if this is indeed the case, then we probably need to report it as a bug becuase damaged or out of fuel aircraft should not just 'RETURN', they should RETURN - then LAND at their HB, or attempt to land at nearest friendly airfield if they can't make their HB.

Osprey
04-06-2012, 08:37 AM
Indeed, please raise it. And also, if they are the leader then another member of the flight continue the mission. Presently they follow the leader even when he is massively damaged.

But, they are working on AI, perhaps better to see what is produced?

FG28_Kodiak
04-06-2012, 08:56 AM
Yep, i waiting for the next patch, if the problem still exist i make a bug track.
I made test with script defined Waypoints and without, in both cases the error occur if one of the planes was damaged or running out of fuel. The plane did not land and circled around the airfield until fuel was empty. May be only my game is affected :)

41Sqn_Banks
04-06-2012, 08:58 AM
AI is really a mess. I'm not talking about air combat stuff but take-off, landing and player interaction is really a mess.

FG28_Kodiak
04-06-2012, 09:06 AM
Da rennst du bei mir offene Türen ein. :rolleyes:

5./JG27.Farber
04-06-2012, 09:18 AM
It seems the AI try to keep within a percentile of the speed at the waypoint. So the 2nd to last waypoint must be near the airfield and the last waypoint, the speed must be 0. (the speed will snap to 180) Altitude I did not set on the landing waypoint so it doesnt seem to matter. I wonder if the AI try to be in a certain perctile of the Altitude also.

I tried this with 9 He111 at two different bases in the FMB. Would be good to try on dedi server.

salmo
04-06-2012, 09:38 AM
<snip>... Altitude I did not set on the landing waypoint so it doesnt seem to matter. I wonder if the AI try to be in a certain perctile of the Altitude also....<snip>
I thought altitude on final (landing) waypoint set the alt the plane entered the airfield circuit? The higher the alt the more circles before landing? I keep mine to a standard about 300m.

I agree with other comments about waiting for patch until we can lodge any AI bug reports. As soon as the patch comes out I'm sure we'll all be wanting to stress test the Ai logic.

hc_wolf
04-06-2012, 11:18 AM
Yeah wait for patch. I like just as the AI touch down, if you strafe them, they power back up and take off.

5./JG27.Farber
04-06-2012, 11:36 AM
Here are three groups landing at three different airfields. All aircraft land, taxi and park without fail. I even make the 9 Stuka attack a target just before landing. I dont know how to make attachments here but you can always copy this code into notepad and name it landingtest.mis and play it for yourself. I have not run this on a dedicated server yet but Im confident it would still work.

Now all I need to do is get the Suka working right with dive bombing.


[PARTS]
core.100
bob.100
[MAIN]
MAP Land$English_Channel_1940
BattleArea 302111 143947 31034 21575 10000
TIME 12
WeatherIndex 0
CloudsHeight 1000
BreezeActivity 10
ThermalActivity 10
player BoB_LW_LG2_I.010
[GlobalWind_0]
Power 3.000 0.000 0.000
BottomBound 0.00
TopBound 1500.00
GustPower 5
GustAngle 45
[splines]
[AirGroups]
g05.37
BoB_LW_LG2_I.02
BoB_LW_KG2_I.13
BoB_LW_StG2_II.13
[g05.37]
Flight0 1 2 3
Flight1 11 12 13
Flight2 21 22 23
Class Aircraft.He-111P-2
Formation VIC3
CallSign 26
Fuel 100
Weapons 1 1 1 1 1 1
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[g05.37_Way]
NORMFLY 317417.13 158476.20 500.00 300.00
NORMFLY 321017.44 154936.82 500.00 300.00
LANDING 321164.29 153607.28 500.00 169.10
[BoB_LW_LG2_I.02]
Flight1 11
Class Aircraft.Bf-109E-4
Formation FINGERFOUR
CallSign 30
Fuel 100
Weapons 1
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_LW_LG2_I.02_Way]
NORMFLY 323785.05 163824.02 500.00 169.10
NORMFLY 319801.36 163822.86 500.00 169.10
[BoB_LW_KG2_I.13]
Flight0 1 2 3
Flight1 11 12 13
Class Aircraft.Do-17Z-2
Formation VIC3
CallSign 26
Fuel 100
Weapons 1
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_LW_KG2_I.13_Way]
NORMFLY 315981.36 171965.18 1000.00 300.00
NORMFLY 308012.22 163233.04 500.00 300.00
LANDING 306370.51 160657.44 500.00 180.00
[BoB_LW_StG2_II.13]
Flight0 1 2 3 4 5 6
Flight1 11 12 13
Class Aircraft.Ju-87B-2
Formation VIC
CallSign 30
Fuel 100
Weapons 1 1 1 1
Belt _Gun02 Gun.MG15 MainBelt 0 2
Detonator Bomb.SC-250_Type2_J 1 -1 0
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_LW_StG2_II.13_Way]
NORMFLY 334637.34 156147.71 3000.00 300.00
NORMFLY 328587.55 172592.86 3250.00 300.00
GATTACK_TARG 328756.02 172047.71 500.00 300.00 0_Chief 0 /GAttackType DIVE /GAttackPasses _1
NORMFLY 329199.85 169293.43 500.00 300.00
LANDING 321276.88 172445.78 500.00 180.00
[CustomChiefs]
[Chiefs]
0_Chief Armor.Cruiser_Mk_IVA gb
[0_Chief_Road]
328657.41 172356.22 38.40 0 2 6.39
328695.19 172297.06 38.40
[Stationary]
[Buildings]
[BuildingsLinks]

Osprey
04-06-2012, 12:37 PM
Farber, for dive bombing simply set the waypoint just past the target since they fly over it, half roll and dive. The exit needs to be a 180 degree turn from the incoming path and much lower altitude (500m is fine). The AI will not dive bomb from lower than 3km.

Also, make sure you use the correct bomb and matching fuse set for delay with dive bombing when arming the AI or they won't drop it.

5./JG27.Farber
04-06-2012, 12:59 PM
Just tried it, they showere the bombs first then dive on target.

Can you show me a working example?

5./JG27.Farber
04-06-2012, 02:07 PM
Never mind I cracked it. Its differnet than old IL2.

1st waypoint 3500m's.

2nd the 500m's beypnd the target. This makes them start the dive.

3rd Attack target. In front of the 1st waypoint but behind the 2nd 500m's (180 heading change from first waypoints.)

4th roll out. 500m's


Ive changed in the mission example for landing, you can see for yourself.

Osprey
04-06-2012, 02:55 PM
I'm not sure what you needed to do, but if you check Ventnor, the Ju88's dive bomb successfully.

Old IL2 never needed 3km+, you just set a target and away they went.

5./JG27.Farber
04-07-2012, 12:19 AM
Both work in dedicated server. :-P

FG28_Kodiak
04-07-2012, 04:26 AM
The Ju88 should do (historical) a 60° Dive (maximum) and not a 90° like a Stuka. Had anyone success with the shallow dive parameter? Not working for me correctly.

Osprey
04-07-2012, 08:22 AM
No I couldn't get that working Kodiak. On the Ventnor raid on August 12th 1940 the Ju88's attacked using a shallow dive but in game I couldn't get them to do it and had to resort to a dive bomb.

5./JG27.Farber
04-07-2012, 12:22 PM
This is my next task Kodiak. I will have a play around and try and find out.

5./JG27.Farber
04-07-2012, 01:33 PM
How about this:

[PARTS]
core.100
bob.100
[MAIN]
MAP Land$English_Channel_1940
BattleArea 120576 133632 42624 33408 10000
TIME 12
WeatherIndex 0
CloudsHeight 1000
BreezeActivity 10
ThermalActivity 10
player BoB_LW_KG3_Stab.002
[GlobalWind_0]
Power 3.000 0.000 0.000
BottomBound 0.00
TopBound 1500.00
GustPower 5
GustAngle 45
[splines]
[AirGroups]
BoB_LW_KuFlGr_706.01
BoB_LW_KG3_Stab.01
[BoB_LW_KuFlGr_706.01]
Flight0 1
Class Aircraft.Do-17Z-2
Formation VIC3
CallSign 26
Fuel 100
Weapons 1
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_LW_KuFlGr_706.01_Way]
NORMFLY 164202.54 160256.68 500.00 300.00
NORMFLY 132556.59 160205.30 500.00 300.00
[BoB_LW_KG3_Stab.01]
Flight0 1 2 3
Class Aircraft.Ju-88A-1
Formation LINEASTERN
CallSign 30
Fuel 100
Weapons 1 1 1 3 2 1
Detonator Bomb.SC-50_GradeII_J 1 -1 0
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_LW_KG3_Stab.01_Way]
NORMFLY 164921.76 146077.65 3000.00 300.00
NORMFLY 138549.73 146053.58 3000.00 300.00
GATTACK_TARG 131391.48 146001.17 200.00 300.00 0_Chief 0 /GAttackType SHALLOW_DIVE /GAttackPasses ALL_OUT
NORMFLY 123904.26 146033.75 1000.00 300.00
[CustomChiefs]
[Chiefs]
0_Chief Ship.Tanker_Medium1 gb /sleep 0/skill 2/slowfire 1
[0_Chief_Road]
129383.13 146041.86 38.40 0 2 5.56
136935.23 146064.86 38.40
[Stationary]
[Buildings]
[BuildingsLinks]