Vehicle AI By Dnamro

The AI object template tells bots how to use a vehicle with several code sections called plug-ins: Unit, Cover, Physical, and Armament

Lets look at the B17\AI\object file:

rem *** Plugins ***
aiTemplatePlugIn.create Unit B17Unit
aiTemplatePlugIn.equipmentType 1

equipment type is linked to the vehicle behaviors, which are in the aibehaviors.con file in the game.rfa and can be edited

aiTemplatePlugIn.setStrategicStrength 0 7

When the bots are attacking [0 for offense - 1 for defense] , it will have a weight of 7 to use this vehicle. Tanks & Mustang has a weight of 3. Stuka has a weight of 5. The higher the number - the higher the chance of using the vehicle over another

aiTemplatePlugIn.setStrategicStrength 1 4
    when the bots are defending[1 for defense] it will have a weight of 4 to use this vehicle

aiTemplatePlugIn.create Cover B17Cover
aiTemplatePlugIn.coverValue 2.0

    bots will use a weight of 2 to use this as cover when its on the ground. Tanks have a weight of 4, bunkers are 100, buildings range between 40 – 80.

aiTemplatePlugIn.create Physical B17Physical
aiTemplatePlugIn.setStrType Air

    Options are Air, Infantry LightArmor, HeavyArmor, Naval, Submarine.
This is just a label that is used by the bot weapon AI to determine the chance of attacking a target catergory with a specific weapon. A Flak38 has a high priority against Air targets. Just because its an specific vehicle category does not mean that its setStrType has to be set to that same category. It should be set to the type that weapons will damage it.

aiTemplatePlugIn.create ControlInfo3d B17Ctrl
aiTemplatePlugIn.driveTurnControl PIYaw
aiTemplatePlugIn.driveThrottleControl PIThrottle
aiTemplatePlugIn.aimHorizontalControl PIYaw
aiTemplatePlugIn.aimVerticalControl PIPitch
aiTemplatePlugIn.driveRollControl PIRoll
aiTemplatePlugIn.drivePitchControl PIPitch
aiTemplatePlugIn.aimRollControl PIRoll
aiTemplatePlugIn.aimThrottleControl PIThrottle
aiTemplatePlugIn.throttleSensitivity -3.0
rem aiTemplatePlugIn.pitchSensitivity -0.5
aiTemplatePlugIn.pitchSensitivity -1.0
aiTemplatePlugIn.rollSensitivity -1.3
aiTemplatePlugIn.yawSensitivity 0.3
aiTemplatePlugIn.throttleLookAhead 1.0
aiTemplatePlugIn.pitchLookAhead 1.2
aiTemplatePlugIn.rollLookAhead 1.5
aiTemplatePlugIn.yawLookAhead 0.3
aiTemplatePlugIn.throttleScale 1.0
rem *** Angle in radians ***
aiTemplatePlugIn.pitchScale 0.0110
aiTemplatePlugIn.rollScale 0.0220
aiTemplatePlugIn.yawScale 0.0175
aiTemplatePlugIn.maxRollAngle 0.5000
aiTemplatePlugIn.maxClimbAngle 0.1700

 Ctrl plugin tells the bot how to control the vehicle

aiTemplatePlugIn.create Mobile B17Mobile
aiTemplatePlugIn.vehicleNumber –1

(This determines the pathmap type that the vehicle follows. Planes don’t follow pathmaps so should be set to -1. Cars & tanks are set by Dice to use 0, Battleships & Carriers are set to 2, and Destroyers and Launches are set to 3)

aiTemplatePlugIn.maxSpeed 50.0
(max speed that the bot can go)

aiTemplatePlugIn.turnRadius 25.0
(The smaller the number, the tighter the turn).

aiTemplatePlugIn.create Armament B17Arms

(This means that this vehicle position has a weapon).

rem *** AITemplate ***
aiTemplate.create B17
aiTemplate.addType ITUnit
aiTemplate.addType ITMobile
aiTemplate.addType ITAir

(There are many types that can be added. See the Dice AI tutorials for a complete list and detailed explanation)
rem aiTemplate.addType ITCover
aiTemplate.degeneration 7

(how many seconds once its out of view, does it take for a bot to forget about it)
aiTemplate.allowedTimeDiff 0.5
aiTemplate.basicTemp 35

(As I understand it, this is the value of how important this is to bots. The higher the number, the more likely they are to interact with it)
aiTemplate.commonKnowledge 0
aiTemplate.addPlugIn B17Unit
aiTemplate.addPlugIn B17Cover
aiTemplate.addPlugIn B17Physical
aiTemplate.addPlugIn B17Ctrl
aiTemplate.addPlugIn B17Mobile
aiTemplate.addPlugIn B17Arms