Improving BF42 Chopper AI

Improving Chopper AI in Battlefield 42

by Ghostwriter

This could be a way to set up helicopters to have better flight control. I am not sure if you can script this for bots but at least a human player will be able to use them.

Going by keyboard flight control examples "upArrow" "downArrow" "left/rightArrow" keys.

The key will be to setting the pitch forward / backward control in an unconventional way. A similar adjustment to setting roll left / right to compliment it should do the trick.

The max pitch foward must be set so that it is the least possible, just enough to where a stable copter will go forward but not down too fast.

THIS MUST ALSO BE THE DEFAULT SETTING FOR "accelerate". No more just straight up.

The forward button "upArrow" is off and won't be used.

The max pitch backward also must be set to a minimal so that holding the backward "downArrow" key down will keep the copter level. Getting it stable hovering in this way is the primary objective.

Holding the backward button "downArrow" will let you hover, letting go will automatically move forward, but also go down. It would just be a matter of holding down and letting go the "downArrow".

Now to turn, again it will be setting the max values to the absolute minimums so that even holding the "leftArrow" or "rightArrow" down, the copter will turn as slowly as possible. (For Now)

You can always adjust the movement for performance after you get stability in this way.

There should be no ability for an angle to drift backwards, even slightly if you hold "downArrow" too long, that might ruin the stability. Would be better to turn left or right effectively and change forward direction.

Of course you would have to set the max altitude as low as possible, just enough to clear any terrain/objects but always able keep ground targets in sight. This will give gunners max ability to use MGs.

You might want to increase the armor so that the copters can become airtanks, sorta. I am hoping that this also might be able to be scripted for bots.

"BotDeath from Above" ack!

That setup would probably work for bots pretty well as the heli would fly similar to a plane. The biggest problem I have had to work with in getting decent ai heli pilots was rolls, I have been working on a behaviour setup that seems to improve it quite a bit, as well as constantly tweaking the ai control settings until one day, if I live long enough, they will fly better then me.

One thing that works really well with current dc heli's, for both humans and bots, is to set a down angle on the camera and weapons so that you can be flyiing straight and level but your crosshair and weapons will fire down allowing easier ground targeting without having to pitch causing you to drive forward too much. I have set the camera's and weapons to rotate to 0/2.55/0 and it is pretty good like that. Another thing I changed that made a vast improvement on bots firing rockets at ground targets was to make the original weapons racks to fire fake and move the actual projectile firing postions to a point closer to the originator so they are more accurate at long range. Of course to get them to actually fire the rockets means you have to adjust the mass/drag to a value that is more bot friendly.

The bots do not use the choppers in bf well for this reason .. it is coded as an airplane. In DCX Zuser coded the choppers by moving the engine back in the choppers and set them up as "AI Only" choppers and they worked fairly well. Basicly bots DO NOT use the choppers well in the bf refractor engine. They made changes to the choppers in bfv so that the bots use them much better.

realized while trying to fly the choppers that it was set up like the airplanes, as soon as I tried to turn

I have seen that there is some control over the response in the planes in the mods (much better balance than the original settings). I don't know how much control though.

It would be the equivelent of being able to make a plane unable to do a barrel roll by limiting its max movement variables.

If you can do that scripting a plane, then you should be able to force stablization of the choppers in a similar manner that I proposed.

Can't blame a guy for trying to find a way. I don't mind if the choppers aren't totally functional. It is nice to hear them flyin around as backgrownd noise.

If nothing else, the bot pilots keep the enemy bots looking up while we sneak in under their noses.

This is what started me wondering about this. The bots equate "accelerate" with forward movement. I don't think you can code a way for them to "understand" going up is forward so they spend all their time stabizing.

Also the copters act and feel like a plane with a propeller on its head. Real copters have stablizers. Slowing down significantly the left/right roll should do the trick. This should also take care of the yaw that automatically happens when you turn in planes so bots won't overcorrect when trying to turn.

Adjusting the resistance for left/right roll might be the simple part, getting the bird to go forward as default on acceleration I would think is the tricky part. And disabling the "forward stick control" would be best for bf42.

The focus on control for bots would be to "keep pulling back on the stick" to level off and counteract the yaw slide when turning. Stablize the copter and the bot is free to do targeting.

Forward momentum will be a concern possibly for the bots if going too fast. Unless the copters are big lumbering airtanks that move very slowly (Would be nice to see those russian bohemoths move like that).

Ok, well you peaked my interest in messing with these again and I think I have found a solution that works really well for what I want.
Instead of making helicopters into slow planes, I messed around with making them fly more like helicopters really do... sort of.

I added wings that cause you to turn on a roll instead of just rolling sideways. Then added a vertical wing that forces the helicopter body to stay upright unless you apply roll, or pitch. Then I added a flap that creates positive pitch as soon as you start moving forward, this allows you to fly straight ahead with pitch instead of just diving forward, also maintains lift so you can get going pretty fast without having to pull up.

I only made a few moderate changes to the basic engines, just to increase torque to compensate for the wings drag, and the rear airbrake. I also modified the acceleration of the roll speed so you cannot roll over fast-- mostly because this is the biggest problem for the ai.

At hover it flies just like regular dc choppers, but at speed it flies alot more like a real helicopter does, although the pitch wing is more evident then it should be, it is easy to get used to and seems to force the ai to fly forward instead of just straight up and back. I wanted to try and eliminate roll at hover, as well as backward movement but couldn't find a way with the current engines so this will have to do for now.

I think like this they are actually alot more fun to fly and the ai seem to have no problem with them. I have tested in a map with all helicopters and the bots were flying around all over the place and killing each other and crashes were more rare then with regular planes.

 If you have a chance to try changing the settings, could you test the ideas in these posts and let me know if they came close to working?

Ok, well you peaked my interest in messing with these again and I think I have found a solution that works really well for what I want.
Instead of making helicopters into slow planes, I messed around with making them fly more like helicopters really do... sort of.

I added wings that cause you to turn on a roll instead of just rolling sideways. Then added a vertical wing that forces the helicopter body to stay upright unless you apply roll, or pitch. Then I added a flap that creates positive pitch as soon as you start moving forward, this allows you to fly straight ahead with pitch instead of just diving forward, also maintains lift so you can get going pretty fast without having to pull up.

I only made a few moderate changes to the basic engines, just to increase torque to compensate for the wings drag, and the rear airbrake. I also modified the acceleration of the roll speed so you cannot roll over fast-- mostly because this is the biggest problem for the ai.

At hover it flies just like regular dc choppers, but at speed it flies alot more like a real helicopter does, although the pitch wing is more evident then it should be, it is easy to get used to and seems to force the ai to fly forward instead of just straight up and back. I wanted to try and eliminate roll at hover, as well as backward movement but couldn't find a way with the current engines so this will have to do for now.

I think like this they are actually alot more fun to fly and the ai seem to have no problem with them. I have tested in a map with all helicopters and the bots were flying around all over the place and killing each other and crashes were more rare then with regular planes.

Here is for the sa-342, the setup is pretty much the same for every helicopter you want to add this too. But the ai settings I have are a little different for each one, the plugin I included here does not work well with the mi24d or uh-60's but works fine with all the others.

Sa-342 objects.con. add these lines in the common complex bundle, right under the engines......

 rem \*\*\* SA342Common \*\*\*

ObjectTemplate.addTemplate Gaz\_Front\_WingObjectTemplate.setPosition 0/0/5ObjectTemplate.setRotation 0/0/-90ObjectTemplate.addTemplate Gaz\_Rear\_WingObjectTemplate.setPosition 0/0/-5ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate Gaz\_Wing\_RightObjectTemplate.setPosition 4/0/0ObjectTemplate.addTemplate Gaz\_Wing\_LeftObjectTemplate.setPosition -4/0/0
ObjectTemplate.addTemplate Gaz\_Dive\_WingObjectTemplate.setPosition 0/0/-4.5

Physics.con

 rem \*\*\* Gaz\_Dive\_Wing \*\*\*ObjectTemplate.create Wing Gaz\_Dive\_WingObjectTemplate.setNetworkableInfo SA342\_wing\_infoObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setMinRotation 0/-20/0ObjectTemplate.setMaxRotation 0/20/0ObjectTemplate.setMaxSpeed 0/90/0ObjectTemplate.setAcceleration 0/-90/0ObjectTemplate.setInputToPitch c\_PIPitchObjectTemplate.setAutomaticReset 1ObjectTemplate.setWingLift 0.26ObjectTemplate.setFlapLift 0.26

rem \*\*\* Gaz\_vert\_Wing \*\*\*ObjectTemplate.create Wing Gaz\_Front\_WingObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.6ObjectTemplate.setFlapLift 0.0
rem \*\*\* Gaz\_vert\_Wing \*\*\*ObjectTemplate.create Wing Gaz\_Rear\_WingObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.6ObjectTemplate.setFlapLift 0.0
rem \*\*\* Gaz\_Body\_Wing \*\*\*ObjectTemplate.create Wing Gaz\_Wing\_RightObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.8ObjectTemplate.setFlapLift 0.0
rem \*\*\* Gaz\_Body\_Wing \*\*\*ObjectTemplate.create Wing Gaz\_Wing\_LeftObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.8ObjectTemplate.setFlapLift 0.0

Change the acceleration in engine 3, only, for the roll direction (note the 20) This slows down the roll speed significantly. I also set all 3 engines to 16 torque and 4 on differential just to make them a bit faster.

 rem \*\*\* SA342HoverEngine3 \*\*\*ObjectTemplate.create Engine SA342HoverEngine3ObjectTemplate.setNetworkableInfo SA342\_engine\_infoObjectTemplate.setMinRotation -5000/-5000/1500ObjectTemplate.setMaxRotation 5000/5000/5000ObjectTemplate.setMaxSpeed 50/50/9500ObjectTemplate.setAcceleration 20/50/25000ObjectTemplate.setInputToRoll c\_PIThrottleObjectTemplate.setAutomaticReset 1ObjectTemplate.setEngineType c\_ETPlaneObjectTemplate.setTorque 16ObjectTemplate.setDifferential 4ObjectTemplate.setNoPropellerEffectAtSpeed 3000

Add this to Network.con for the new pitch flap.....

 NetworkableInfo.createNewInfo SA342\_wing\_infoNetworkableInfo.setPredictionMode PMLinear

The control plugin----
The AI are very good with these helicopters with my current control plugin but I think it may need some adjustments now as I adjusted this control plugin for the regular helicopter.

Code starts under this line...

aiTemplatePlugIn.create ControlInfo3d SA342(S,H,M,L,G)Ctrl

^ I left that out since there are 5 different helicopter control plugins there that have to be done.

 aiTemplatePlugIn.driveTurnControl     PIYawaiTemplatePlugIn.driveThrottleControl PIThrottleaiTemplatePlugIn.aimHorizontalControl PIYawaiTemplatePlugIn.aimVerticalControl   PIPitchaiTemplatePlugIn.driveRollControl     PIRollaiTemplatePlugIn.drivePitchControl    PIPitchaiTemplatePlugIn.aimRollControl       PIRollaiTemplatePlugIn.aimThrottleControl  PIThrottleaiTemplatePlugIn.throttleSensitivity -0.3aiTemplatePlugIn.pitchSensitivity     0.14aiTemplatePlugIn.rollSensitivity      0.3aiTemplatePlugIn.yawSensitivity       0.14aiTemplatePlugIn.throttleLookAhead    1.6aiTemplatePlugIn.pitchLookAhead       0.8aiTemplatePlugIn.rollLookAhead        0.3aiTemplatePlugIn.yawLookAhead         0.6aiTemplatePlugIn.throttleScale        5.0rem \*\*\* Angle in radians \*\*\*aiTemplatePlugIn.pitchScale           5.0aiTemplatePlugIn.rollScale            5.0aiTemplatePlugIn.yawScale             5.0aiTemplatePlugIn.maxRollAngle         0.0133aiTemplatePlugIn.maxClimbAngle        0.0001

aiTemplatePlugIn.create Mobile SA342(S,H,M,L,G)Mobile

 aiTemplatePlugIn.vehicleNumber 1aiTemplatePlugIn.maxSpeed 80.0aiTemplatePlugIn.turnRadius 40.0aiTemplatePlugIn.coverSearchRadius 450.0aiTemplatePlugIn.avoidCollisionLookAhead 150.0

If you want them to shoot rockets, you have to make sure the ai weapons setting are correct, several of the dc weapons.con for ai are not right. You also need to adjust the drag/mass on the rockets themselves. Basically add mass or lower drag, either one works you just have to find the balance of what you want and what works for the AI.
I set the hydra's like this and they shoot them at me all the time.
ObjectTemplate.drag 0.5
ObjectTemplate.mass 35

Well I need to add, that if someone does want to put these to use in DC, there is a problem with using it on lan game unless you edit a couple more things.

Adding that "dive" wing requires a net info, and pushes all the helo's into the dreaded too many statemasks error. Easy to fix though, all you have to do is rem out the net info for the rotational bundles that the engines are attached to, these are not needed and should not have been there anyway.

Just rem it out on all of those for any helicopter.

Objects.con

 rem \*\*\* SA342DummyEngineRack \*\*\*ObjectTemplate.create RotationalBundle SA342DummyEngineRackrem ObjectTemplate.setNetworkableInfo SA342\_body\_info

 rem \*\*\* SA342EngineRack1 \*\*\*ObjectTemplate.create RotationalBundle SA342EngineRack1rem ObjectTemplate.setNetworkableInfo SA342\_rack\_info

On the apache or uh-60, you can also rem out the netinfo to the rear flap as it is just for show and has no effect on physics so no need for net info on it.
Physics.con

 rem \*\*\* AH64RearFlap \*\*\*ObjectTemplate.create RotationalBundle AH64RearFlaprem ObjectTemplate.setNetworkableInfo AH64\_body\_infoObjectTemplate.geometry AH64\_Flap

 rem \*\*\* UH-60RearFlap \*\*\*ObjectTemplate.create RotationalBundle UH-60RearFlaprem ObjectTemplate.setNetworkableInfo UH-60\_body\_infoObjectTemplate.geometry UH-60\_Flap

With those extra net info's out I have tested this in lan games and with a dedicated server with no problem.

I will work on getting a better ai plugin for these new physics.

Ok, well I have some worked out alot better. Mi24 is a menace in the sky, and pretty good at getting you on the ground as well, but they don't do too well if there are mountains around. The apache's are like stunt pilots, I don't know how they survive the stuff they do.. very rare that they crash and really good at dive bombing. The gazelle's unfornutaley cannot overcome the inertia modifier so they dive bomb right into the ground pretty often, but I have always had that problem with them and the only solution is to redo that helicopter with different name and lower that forward inertia.

I have the pitch and roll rates worked out pretty well, but the yaw is tricky since it changes based on how much throttle you are using.. it is close enough that the ai is not doing spins very often and when they are hovering over a target they can keep the nose pointed right at it. Also I made some changes to the wing settings on some helicopters based on the mass/drag of the pco. I have not done alot with uh-60 because we don't use it much, and the bots flight characteristics are very different in unarmed planes. I also have only started messing with the little bird helicopters and have not had much testing time on those.
It's nowhere near perfect, but it is much more fun. I have been playing it alot to test and ussually end up hiding in a building to watch or dying from rockets.

Here is what I have come up with so far. I leave alot of stuff out so you have to just look at where it goes. Also don't forget the net info's or you will see the desktop!!

Objects.con

 rem \*\*\* AH64Complex \*\*\*ObjectTemplate.create Bundle AH64Complex
rem seats and wheels.. blah blah..........
rem this is not really a flap :)ObjectTemplate.addTemplate AH64RearFlapObjectTemplate.setPosition 0/0.208/-6.220
rem physics wings start here
ObjectTemplate.addTemplate AH64DiveFlapObjectTemplate.setPosition 0/0/-4.5
ObjectTemplate.addTemplate AH64\_Wing\_FrontObjectTemplate.setPosition 0/0/4.5ObjectTemplate.setRotation 0/0/-90ObjectTemplate.addTemplate AH64\_Wing\_RearObjectTemplate.setPosition 0/0/-4.5ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate AH64\_Wing\_RightObjectTemplate.setPosition 4/0/0ObjectTemplate.addTemplate AH64\_Wing\_LeftObjectTemplate.setPosition -4/0/0

Physics.con

 rem NOTE roll changes to hover engine 3rem increase torque to offset wing drag
rem \*\*\* AH64HoverEngine1 \*\*\*ObjectTemplate.create Engine AH64HoverEngine1ObjectTemplate.setNetworkableInfo AH64\_engine\_inforem -------------------------------------
rem -------------------------------------ObjectTemplate.setMinRotation -5000/-5000/1500ObjectTemplate.setMaxRotation 5000/5000/5000ObjectTemplate.setMaxSpeed 50/50/9500ObjectTemplate.setAcceleration 50/50/20000ObjectTemplate.setInputToRoll c\_PIThrottleObjectTemplate.setAutomaticReset 1ObjectTemplate.setEngineType c\_ETPlaneObjectTemplate.setTorque 20ObjectTemplate.setDifferential 6ObjectTemplate.setNoPropellerEffectAtSpeed 3000
rem \*\*\* AH64HoverEngine2 \*\*\*ObjectTemplate.create Engine AH64HoverEngine2ObjectTemplate.setNetworkableInfo AH64\_engine\_inforem -------------------------------------
rem -------------------------------------ObjectTemplate.setMinRotation -5000/-5000/1500ObjectTemplate.setMaxRotation 5000/5000/5000ObjectTemplate.setMaxSpeed 50/50/9500ObjectTemplate.setAcceleration 50/50/20000ObjectTemplate.setInputToRoll c\_PIThrottleObjectTemplate.setAutomaticReset 1ObjectTemplate.setEngineType c\_ETPlaneObjectTemplate.setTorque 20ObjectTemplate.setDifferential 6ObjectTemplate.setNoPropellerEffectAtSpeed 3000
rem \*\*\* AH64HoverEngine3 \*\*\*ObjectTemplate.create Engine AH64HoverEngine3ObjectTemplate.setNetworkableInfo AH64\_engine\_inforem -------------------------------------
rem -------------------------------------ObjectTemplate.setMinRotation -5000/-5000/1500ObjectTemplate.setMaxRotation 5000/5000/5000ObjectTemplate.setMaxSpeed 50/50/9500ObjectTemplate.setAcceleration 20/50/20000ObjectTemplate.setInputToRoll c\_PIThrottleObjectTemplate.setAutomaticReset 1ObjectTemplate.setEngineType c\_ETPlaneObjectTemplate.setTorque 20ObjectTemplate.setDifferential 6ObjectTemplate.setNoPropellerEffectAtSpeed 3000
rem doesn't need net info... it doesn't do anythingrem \*\*\* AH64RearFlap \*\*\*ObjectTemplate.create RotationalBundle AH64RearFlaprem ObjectTemplate.setNetworkableInfo AH64\_body\_infoObjectTemplate.geometry AH64\_FlapObjectTemplate.setMinRotation 0/-35/0ObjectTemplate.setMaxRotation 0/35/0ObjectTemplate.setMaxSpeed 0/120/0ObjectTemplate.setAcceleration 0/-120/0ObjectTemplate.setInputToPitch c\_PIPitchObjectTemplate.setAutomaticReset 1
rem needs net info addedrem \*\*\* AH64RearFlap \*\*\*ObjectTemplate.create Wing AH64DiveFlapObjectTemplate.setNetworkableInfo AH64\_wing\_infoObjectTemplate.setMinRotation 0/-30/0ObjectTemplate.setMaxRotation 0/30/0ObjectTemplate.setMaxSpeed 0/120/0ObjectTemplate.setAcceleration 0/-120/0ObjectTemplate.setInputToPitch c\_PIPitchObjectTemplate.setAutomaticReset 1ObjectTemplate.setWingLift 0.255ObjectTemplate.setFlapLift 0.25
rem \*\*\* AH1\_Vertical\_Wing \*\*\*ObjectTemplate.create Wing AH64\_Wing\_FrontObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.6ObjectTemplate.setFlapLift 0.0
rem \*\*\* AH1\_Vertical\_Wing \*\*\*ObjectTemplate.create Wing AH64\_Wing\_RearObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.6ObjectTemplate.setFlapLift 0.0
rem \*\*\* AH1\_Body\_Wing \*\*\*ObjectTemplate.create Wing AH64\_Wing\_RightObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.8ObjectTemplate.setFlapLift 0.0
rem \*\*\* AH1\_Body\_Wing \*\*\*ObjectTemplate.create Wing AH64\_Wing\_LeftObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.8ObjectTemplate.setFlapLift 0.0

AI /objects.con (starts at control)

 aiTemplatePlugIn.create ControlInfo3d AH64CtrlaiTemplatePlugIn.driveTurnControl     PIYawaiTemplatePlugIn.driveThrottleControl PIThrottleaiTemplatePlugIn.aimHorizontalControl PIYawaiTemplatePlugIn.aimVerticalControl   PIPitchaiTemplatePlugIn.driveRollControl     PIRollaiTemplatePlugIn.drivePitchControl    PIPitchaiTemplatePlugIn.aimRollControl       PIRollaiTemplatePlugIn.aimThrottleControl  PIThrottleaiTemplatePlugIn.throttleSensitivity -0.3aiTemplatePlugIn.pitchSensitivity     0.16aiTemplatePlugIn.rollSensitivity      0.28aiTemplatePlugIn.yawSensitivity       0.198aiTemplatePlugIn.throttleLookAhead    1.8aiTemplatePlugIn.pitchLookAhead       0.6aiTemplatePlugIn.rollLookAhead        0.3aiTemplatePlugIn.yawLookAhead         0.5aiTemplatePlugIn.throttleScale        5.0rem \*\*\* Angle in radians \*\*\*aiTemplatePlugIn.pitchScale           5.0aiTemplatePlugIn.rollScale            5.0aiTemplatePlugIn.yawScale             5.0aiTemplatePlugIn.maxRollAngle         0.0133aiTemplatePlugIn.maxClimbAngle        0.0001
aiTemplatePlugIn.create Mobile AH64MobileaiTemplatePlugIn.vehicleNumber -1aiTemplatePlugIn.maxSpeed 70.0aiTemplatePlugIn.turnRadius 55.0rem aiTemplatePlugIn.coverSearchRadius 650.0aiTemplatePlugIn.avoidCollisionLookAhead 160.0

objects.con

 rem \*\*\* Mi24DComplex \*\*\*ObjectTemplate.create Bundle Mi24DComplexrem should be stuff hereObjectTemplate.addTemplate Mi24DLGEngineObjectTemplate.setPosition 0/0/0
rem (start here)rem side wings slow roll rate and reset to levelrem front/rear allow wide turns in roll instead of hitting the ground
ObjectTemplate.addTemplate Mi24D\_Front\_WingObjectTemplate.setPosition 0/0/5ObjectTemplate.setRotation 0/0/-90ObjectTemplate.addTemplate Mi24D\_Rear\_WingObjectTemplate.setPosition 0/0/-5ObjectTemplate.setRotation 0/0/-90ObjectTemplate.addTemplate Mi24D\_Wing\_RightObjectTemplate.setPosition 4.5/0/0ObjectTemplate.addTemplate Mi24D\_Wing\_LeftObjectTemplate.setPosition -4.5/0/0
rem aids turning while rolled and pulls nose up to allow forward flight
ObjectTemplate.addTemplate Mi24D\_Dive\_WingObjectTemplate.setPosition 0/0/-4.5

physics.con

 rem \*\*\* Mi24DHoverEngine1 \*\*\*ObjectTemplate.create Engine Mi24DHoverEngine1ObjectTemplate.setNetworkableInfo Mi24D\_engine\_infoObjectTemplate.loadSoundScript Sounds/HindEngine.sscrem -------------------------------------rem -------------------------------------ObjectTemplate.setMinRotation -5000/-5000/2000ObjectTemplate.setMaxRotation 5000/5000/5000ObjectTemplate.setMaxSpeed 50/50/9500ObjectTemplate.setAcceleration 50/50/6000ObjectTemplate.setInputToRoll c\_PIThrottleObjectTemplate.setAutomaticReset 1ObjectTemplate.setEngineType c\_ETPlaneObjectTemplate.setTorque 16.2ObjectTemplate.setDifferential 4.8ObjectTemplate.setGearUp 0.7ObjectTemplate.setGearDown 0.3ObjectTemplate.setNoPropellerEffectAtSpeed 150
rem \*\*\* Mi24DHoverEngine2 \*\*\*ObjectTemplate.create Engine Mi24DHoverEngine2ObjectTemplate.setNetworkableInfo Mi24D\_engine\_inforem -------------------------------------rem -------------------------------------ObjectTemplate.setMinRotation -5000/-5000/2000ObjectTemplate.setMaxRotation 5000/5000/5000ObjectTemplate.setMaxSpeed 50/50/9500ObjectTemplate.setAcceleration 50/50/6000ObjectTemplate.setInputToRoll c\_PIThrottleObjectTemplate.setAutomaticReset 1ObjectTemplate.setEngineType c\_ETPlaneObjectTemplate.setTorque 16.2ObjectTemplate.setDifferential 4.8ObjectTemplate.setGearUp 0.7ObjectTemplate.setGearDown 0.3ObjectTemplate.setNoPropellerEffectAtSpeed 150
rem \*\*\* Mi24DHoverEngine3 \*\*\*ObjectTemplate.create Engine Mi24DHoverEngine3ObjectTemplate.setNetworkableInfo Mi24D\_engine\_inforem -------------------------------------rem -------------------------------------ObjectTemplate.setMinRotation -5000/-5000/2000ObjectTemplate.setMaxRotation 5000/5000/5000ObjectTemplate.setMaxSpeed 50/50/9500rem lower roll speedObjectTemplate.setAcceleration 20/50/6000ObjectTemplate.setInputToRoll c\_PIThrottleObjectTemplate.setAutomaticReset 1ObjectTemplate.setEngineType c\_ETPlaneObjectTemplate.setTorque 16.2ObjectTemplate.setDifferential 4.8ObjectTemplate.setGearUp 0.7ObjectTemplate.setGearDown 0.3ObjectTemplate.setNoPropellerEffectAtSpeed 150
rem \*\*\* lift\_Body\_Wing \*\*\*ObjectTemplate.create Wing Mi24D\_Front\_WingObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setAutomaticReset 1ObjectTemplate.setWingLift 0.55ObjectTemplate.setFlapLift 0.0
rem \*\*\* lift\_Body\_Wing \*\*\*ObjectTemplate.create Wing Mi24D\_Rear\_WingObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setAutomaticReset 1ObjectTemplate.setWingLift 0.55ObjectTemplate.setFlapLift 0.0
rem \*\*\* roll\_Body\_Wing \*\*\*ObjectTemplate.create Wing Mi24D\_Wing\_RightObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.75ObjectTemplate.setFlapLift 0.0
rem \*\*\* roll\_Body\_Wing \*\*\*ObjectTemplate.create Wing Mi24D\_Wing\_LeftObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.75ObjectTemplate.setFlapLift 0.0
rem netinfo!!rem \*\*\* lift\_from\_Dive\_Wing \*\*\*ObjectTemplate.create Wing Mi24D\_Dive\_WingObjectTemplate.setNetworkableInfo Mi24D\_wing\_infoObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setMinRotation 0/-20/0ObjectTemplate.setMaxRotation 0/20/0ObjectTemplate.setMaxSpeed 0/90/0ObjectTemplate.setAcceleration 0/-90/0ObjectTemplate.setInputToPitch c\_PIPitchObjectTemplate.setAutomaticReset 1ObjectTemplate.setWingLift 0.245ObjectTemplate.setFlapLift 0.24

AI stuff...

 aiTemplatePlugIn.create ControlInfo3d Mi24DCtrlaiTemplatePlugIn.driveTurnControl     PIYawaiTemplatePlugIn.driveThrottleControl PIThrottleaiTemplatePlugIn.aimHorizontalControl PIYawaiTemplatePlugIn.aimVerticalControl   PIPitchaiTemplatePlugIn.driveRollControl     PIRollaiTemplatePlugIn.drivePitchControl    PIPitchaiTemplatePlugIn.aimRollControl       PIRollaiTemplatePlugIn.aimThrottleControl  PIThrottleaiTemplatePlugIn.throttleSensitivity -0.3aiTemplatePlugIn.pitchSensitivity     0.17aiTemplatePlugIn.rollSensitivity      0.323aiTemplatePlugIn.yawSensitivity       0.224aiTemplatePlugIn.throttleLookAhead    0.9aiTemplatePlugIn.pitchLookAhead       0.6aiTemplatePlugIn.rollLookAhead        0.2aiTemplatePlugIn.yawLookAhead         0.4aiTemplatePlugIn.throttleScale        4.5rem \*\*\* Angle in radians \*\*\*aiTemplatePlugIn.pitchScale           0.0114aiTemplatePlugIn.rollScale            0.0014aiTemplatePlugIn.yawScale             0.0020aiTemplatePlugIn.maxRollAngle         0.0001aiTemplatePlugIn.maxClimbAngle        0.0001
aiTemplatePlugIn.create Mobile Mi24DMobileaiTemplatePlugIn.vehicleNumber 1aiTemplatePlugIn.maxSpeed 70.0aiTemplatePlugIn.turnRadius 60.0aiTemplatePlugIn.avoidCollisionLookAhead 200.0

objects.con

 rem \*\*\* Mi24DComplex \*\*\*ObjectTemplate.create Bundle Mi24DComplexrem should be stuff hereObjectTemplate.addTemplate Mi24DLGEngineObjectTemplate.setPosition 0/0/0
rem (start here)rem side wings slow roll rate and reset to levelrem front/rear allow wide turns in roll instead of hitting the ground
ObjectTemplate.addTemplate Mi24D\_Front\_WingObjectTemplate.setPosition 0/0/5ObjectTemplate.setRotation 0/0/-90ObjectTemplate.addTemplate Mi24D\_Rear\_WingObjectTemplate.setPosition 0/0/-5ObjectTemplate.setRotation 0/0/-90ObjectTemplate.addTemplate Mi24D\_Wing\_RightObjectTemplate.setPosition 4.5/0/0ObjectTemplate.addTemplate Mi24D\_Wing\_LeftObjectTemplate.setPosition -4.5/0/0
rem aids turning while rolled and pulls nose up to allow forward flight
ObjectTemplate.addTemplate Mi24D\_Dive\_WingObjectTemplate.setPosition 0/0/-4.5

physics.con

 rem \*\*\* Mi24DHoverEngine1 \*\*\*ObjectTemplate.create Engine Mi24DHoverEngine1ObjectTemplate.setNetworkableInfo Mi24D\_engine\_infoObjectTemplate.loadSoundScript Sounds/HindEngine.sscrem -------------------------------------rem -------------------------------------ObjectTemplate.setMinRotation -5000/-5000/2000ObjectTemplate.setMaxRotation 5000/5000/5000ObjectTemplate.setMaxSpeed 50/50/9500ObjectTemplate.setAcceleration 50/50/6000ObjectTemplate.setInputToRoll c\_PIThrottleObjectTemplate.setAutomaticReset 1ObjectTemplate.setEngineType c\_ETPlaneObjectTemplate.setTorque 16.2ObjectTemplate.setDifferential 4.8ObjectTemplate.setGearUp 0.7ObjectTemplate.setGearDown 0.3ObjectTemplate.setNoPropellerEffectAtSpeed 150
rem \*\*\* Mi24DHoverEngine2 \*\*\*ObjectTemplate.create Engine Mi24DHoverEngine2ObjectTemplate.setNetworkableInfo Mi24D\_engine\_inforem -------------------------------------rem -------------------------------------ObjectTemplate.setMinRotation -5000/-5000/2000ObjectTemplate.setMaxRotation 5000/5000/5000ObjectTemplate.setMaxSpeed 50/50/9500ObjectTemplate.setAcceleration 50/50/6000ObjectTemplate.setInputToRoll c\_PIThrottleObjectTemplate.setAutomaticReset 1ObjectTemplate.setEngineType c\_ETPlaneObjectTemplate.setTorque 16.2ObjectTemplate.setDifferential 4.8ObjectTemplate.setGearUp 0.7ObjectTemplate.setGearDown 0.3ObjectTemplate.setNoPropellerEffectAtSpeed 150
rem \*\*\* Mi24DHoverEngine3 \*\*\*ObjectTemplate.create Engine Mi24DHoverEngine3ObjectTemplate.setNetworkableInfo Mi24D\_engine\_inforem -------------------------------------rem -------------------------------------ObjectTemplate.setMinRotation -5000/-5000/2000ObjectTemplate.setMaxRotation 5000/5000/5000ObjectTemplate.setMaxSpeed 50/50/9500rem lower roll speedObjectTemplate.setAcceleration 20/50/6000ObjectTemplate.setInputToRoll c\_PIThrottleObjectTemplate.setAutomaticReset 1ObjectTemplate.setEngineType c\_ETPlaneObjectTemplate.setTorque 16.2ObjectTemplate.setDifferential 4.8ObjectTemplate.setGearUp 0.7ObjectTemplate.setGearDown 0.3ObjectTemplate.setNoPropellerEffectAtSpeed 150
rem \*\*\* lift\_Body\_Wing \*\*\*ObjectTemplate.create Wing Mi24D\_Front\_WingObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setAutomaticReset 1ObjectTemplate.setWingLift 0.55ObjectTemplate.setFlapLift 0.0
rem \*\*\* lift\_Body\_Wing \*\*\*ObjectTemplate.create Wing Mi24D\_Rear\_WingObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setAutomaticReset 1ObjectTemplate.setWingLift 0.55ObjectTemplate.setFlapLift 0.0
rem \*\*\* roll\_Body\_Wing \*\*\*ObjectTemplate.create Wing Mi24D\_Wing\_RightObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.75ObjectTemplate.setFlapLift 0.0
rem \*\*\* roll\_Body\_Wing \*\*\*ObjectTemplate.create Wing Mi24D\_Wing\_LeftObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setWingLift 0.75ObjectTemplate.setFlapLift 0.0
rem netinfo!!rem \*\*\* lift\_from\_Dive\_Wing \*\*\*ObjectTemplate.create Wing Mi24D\_Dive\_WingObjectTemplate.setNetworkableInfo Mi24D\_wing\_infoObjectTemplate.setAutomaticReset 1ObjectTemplate.setPositionOffset 0/0/0ObjectTemplate.setMinRotation 0/-20/0ObjectTemplate.setMaxRotation 0/20/0ObjectTemplate.setMaxSpeed 0/90/0ObjectTemplate.setAcceleration 0/-90/0ObjectTemplate.setInputToPitch c\_PIPitchObjectTemplate.setAutomaticReset 1ObjectTemplate.setWingLift 0.245ObjectTemplate.setFlapLift 0.24

AI stuff...

 aiTemplatePlugIn.create ControlInfo3d Mi24DCtrlaiTemplatePlugIn.driveTurnControl     PIYawaiTemplatePlugIn.driveThrottleControl PIThrottleaiTemplatePlugIn.aimHorizontalControl PIYawaiTemplatePlugIn.aimVerticalControl   PIPitchaiTemplatePlugIn.driveRollControl     PIRollaiTemplatePlugIn.drivePitchControl    PIPitchaiTemplatePlugIn.aimRollControl       PIRollaiTemplatePlugIn.aimThrottleControl  PIThrottleaiTemplatePlugIn.throttleSensitivity -0.3aiTemplatePlugIn.pitchSensitivity     0.17aiTemplatePlugIn.rollSensitivity      0.323aiTemplatePlugIn.yawSensitivity       0.224aiTemplatePlugIn.throttleLookAhead    0.9aiTemplatePlugIn.pitchLookAhead       0.6aiTemplatePlugIn.rollLookAhead        0.2aiTemplatePlugIn.yawLookAhead         0.4aiTemplatePlugIn.throttleScale        4.5rem \*\*\* Angle in radians \*\*\*aiTemplatePlugIn.pitchScale           0.0114aiTemplatePlugIn.rollScale            0.0014aiTemplatePlugIn.yawScale             0.0020aiTemplatePlugIn.maxRollAngle         0.0001aiTemplatePlugIn.maxClimbAngle        0.0001
aiTemplatePlugIn.create Mobile Mi24DMobileaiTemplatePlugIn.vehicleNumber 1aiTemplatePlugIn.maxSpeed 70.0aiTemplatePlugIn.turnRadius 60.0aiTemplatePlugIn.avoidCollisionLookAhead 200.0

It needs to be put in something 8) ,...I just reinstalled DC 1942 with hopes of figuring it out and winrfa'ing away myself but months away makes you rusty

Edit
well the rust is flaking off yippy kiyay
I managed to get the ah64 code in there it did stay aloft for quite some time.
Its weird how it flies especially the rolling when you get it just right.
The bots definately agree with it's control and I must say it the first time you see a bot guided helo FLYING towards something and STEERING in bf42 you will be amazed.
I so far have not had a shot fired by the pilots but during my own tweaking
I hooked up the passenger bots skills pretty good so I just need to fly it into a
pack of not locked on targets bots.
I made a boo boo lol
I don't know what to set it to if they arent shooting and I did the other 2 item tweak mass on rockets thing mentioned.
weapons cons please?If its a trade secret or some other reason I'll understand,...

Woops I might have been in the wrong mod dir to change the mass and so on of the missles my bad.
Great WORK OF ART RPW regardless
my bot apache gunners thank you for this most stable of firing platforms if thats all I can get working.
EDIT PTII
Got the whole thing working very sweet it is
I suppose this is THE big news for maps/mods with helos?
Mod of the what,..."year"?
AWESOME no more of that "cramped feeling" from flying in BFV sized maps
if you just had to play with helo ai bots that was the only way.TILL NOW
Cool that someone tried this out finally. I have found that once you get used to the way they fly you won't want to go back to the dc heli physics anymore. I was racing a friend around iwo jima in apache's and you can really get some speed going.
Also if you want to make them faster, you can lower the flap lift only of the rear flap just a bit and then you will really have to put some forward pitch into it to keep level but it will go really fast.

Also found a good way to make the rockets fire better, at least for me. If you add the line ObjectTemplate.addRootSpeed 0 to any of the heli rockets weapons it makes the rockets fly where your crosshair is pointed no matter what speed or direction your going, sort of a bf42 guided missile simulation I guess... You just have to get the crosshair on the tank and fire and it will hit them.The root speed 0 doesn't seem to make any difference with the bots firing behaviours. I still get shot out of apache when a bot in a hind sneaks up on me, which they do alot.

Also I have done the Uh-60 and uh-60l and have seen good results from the bots in them, especially the uh-60l for some reason they are really good at killing tanks with that one. So if you want those I can post them here or just pm them to you whatever is easier.

I'm still tinkering with ah-6 but the other iraqi versions of those they are good with, just can't get them to fire the weapons very often on the ah-6 yet.

Just let me add : I applied some of RPW's tricks (especially the four stabilizer wings) to the Flettner (the heli on 'Raid on Agheila') and lifted the 'Engine Bundle' from a height of 0.7 to 5.7. This stabilizes the Flettner very good and now for the first time the Flettner is used by the bots to fire rockets and MG on ground troops, vehicles and other Flettners
A first AI add-on for RoA with this features is available at
http://www.schoeldgen.de/bf1942/
Its not final, but WIP. Thanks go to RPW for sharing his finds

That setup would probably work for bots pretty well as the heli would fly similar to a plane. The biggest problem I have had to work with in getting decent ai heli pilots was rolls, I have been working on a behaviour setup that seems to improve it quite a bit, as well as constantly tweaking the ai control settings until one day, if I live long enough, they will fly better then me.

One thing that works really well with current dc heli's, for both humans and bots, is to set a down angle on the camera and weapons so that you can be flyiing straight and level but your crosshair and weapons will fire down allowing easier ground targeting without having to pitch causing you to drive forward too much. I have set the camera's and weapons to rotate to 0/2.55/0 and it is pretty good like that. Another thing I changed that made a vast improvement on bots firing rockets at ground targets was to make the original weapons racks to fire fake and move the actual projectile firing postions to a point closer to the originator so they are more accurate at long range. Of course to get them to actually fire the rockets means you have to adjust the mass/drag to a value that is more bot friendly.

A quick update on some success I had while trying to get the bots to fly the dc blackhawk better, the one with the miniguns on it.

The problem with helicopters is that the bots can only fly them fairly well if they have a weapon, it's when they have a target that they will really start to fly those helicopters decent. So I added a weapon that just shoots a blank projectile to the pilot postion, and setup an ai template to get them to focus on infantry. I also had to cut the cameras rotation controls because I wanted them to use the fire command, so they wouldn't be trying to call artillery all the time, and I already know they will surely crash if they press fire and the camera turns, I have tried that before...lol
Ok so anyway, adding a fake weapon and setting the control sensitivites to have them fly very slow and smooth and not ever actually attempt to pitch to the target, along with adding a spawn for the gunner postions and now I have bot helo's flying sniper cover in dc lost village for the first time.