AIPathFinding.con

For Battlefield 1942 & Battlefield Vietnam AI

A tutorial by: cajunwolf 

Tutorials


The AIPathFinding.con file is responsible for the pathfinding information required by the Battlefield SAI. There is very little difference between the files from bf1942 & BFV except the number of vehicle pathmaps that are required and the "Second Layer Map" call for BFV ( that was never used). Now when you look at the file you notice there is a lot of things rem'ed out so we will concentrate on the lines that are used. Lets look at my standard AIPathFinding.con file for bf1942.

rem ****  bf1942 AIPathFinding.con file by cajunwolf. ****rem rem
if v_arg1 == host
rem ---------------------------------------------------------

rem *** Pathfinding debug mode (Use for trouble shooting only) ***
rem *** This is a bool value. To turn it on set the value to 1 and to turn it off set the value to 0.
game.aiPathfindingDebuggingActive 0


rem *** Set number of AStar resources ***

ai.numAStarResources 12

rem *** Setup map parameters ***
rem ***
searchMap name/waterHeight/waterDepth/maxSlope/brush/lowClipLevel/hiClipLevel/considerAITypes
rem *** searchType name/mapNum/minSearchLevel




rem *** Tank ***
ai.addSearchMap Tank0 0 0 25 3.0 0.3 2.5 0
ai.addSearchType Tank 0 0
rem ai.setMapSpawnPoints 0  
ai.setSmoothing 0 20


rem *** Infantry ***
ai.addSearchMap Infantry1 0 1.5 30 1.0 0.4 2.0 1
ai.addSearchType Infantry 1 0
rem ai.setMapSpawnPoints 1
ai.setSmoothing 1 10



rem *** Boat ***
ai.addSearchMap Boat2 1 8 30 4.0 0.3 2.5 0 2 5
ai.addSearchType Boat 2 2
rem ai.setMapSpawnPoints 2
ai.setSmoothing 2 20



rem *** LandingCraft ***
ai.addSearchMap LandingCraft3 1 1.4 30 4.0 0.3 2.5 0 2 5
ai.addSearchType LandingCraft 3 2
rem ai.setMapSpawnPoints 3
ai.setSmoothing 3 20

 

beginrem
rem *** Car ***
ai.addSearchMap Car4 0 0 20 4.0 0.3 2.5 0
ai.addSearchType Car 2 0
rem ai.setMapSpawnPoints 4
ai.setSmoothin 4 6
endrem



beginrem
rem *** Amphibius ***
ai.addSearchMap Amphibius4 0 1000 30 4.0 0.3 2.5 0
ai.addSearchType Amphibius 4 0
ai.setMapSpawnPoints 4  
ai.setSmoothing 4 20
ai.setWaterCutOffDepth 1
endrem

rem *** Load maps ***
ai.loadMaps

endIf

rem ---------------------------------------------------------

 

abc