Creating pathmaps with the debugger


The following is a repost from Cajun Wolf describing a better method of creating the pathmaps with the game instead of using the botinator settings:

In the AIpathFinding.con file rem out the following;

ai.setMapSpawnPoints (Do this for all vehicle types! Tank, Infantry, Boat, etc...)
run StaticObjects.con

In the AI.con file rem out the following or put an "0" after them like so;

game.showAIstats 0
ai.showBotStats 0
and any other stats that might be called for...

In the game types folder in the coop.con and in the coop.con file in the main map archive where it says "run Conquest/ControlPointTemplates" change it to read "run SinglePlayer/ControlPointTemplates". There are 2 places in each file that need this changed.

Now start the map in the debugger in SP or CO-OP and once the map loads hit the "P" key to pause the game. Now press the "~" key to drop the console. Now you are gonna create pathmaps for each vehicle type one at a time. To do this type the following line in the console;

ai.createMaps (Veh#) where veh# is the maps for the particular vehicle class you want to create. Example, lets make a set of Tank maps. The Vehicle no. for Tanks is "0" so we would type the following;

ai.createMaps 0

It will pause for a bit and then let you know this set of maps has been created. So for Infantry maps you would Type;

ai.createMaps 1

For Boat maps you would type;

ai.createMaps 2

...and so on.

This should resolve your problem, if not let me know. Since the 1.2 patch has come out the Botinator does not set up the files properly and the "ai.createAllMaps" call does not always work right in 1.2 version. Besides the method I explained above will get you a much better set of pathmaps anyhow.
Note from Dnamro:

The pathmap numbers are as follows (Vietnam & BF42 are the same for 0-4):
0 - for tanks
1 - for infantry
2 -for boats
3 -for landing craft
4 - cars (not used in BF42) & Amphibious in Secret Weapons
5 - Heli in Vietnam
6 - Amphibious in vietnam




is used like a filter. Cajunwolf and I were working on a Botinator problem when we discoved that by removing the commad, all valid pathfinding areas for the vehicle get rendered. Botinator was putting spaces between each coordinate in the list, which caused errors in the debugging logs, but did the same thing as leaving it out.

Also the Botinator like to put the command:


into the aiPathfinding.con file. That doesn't always work. Sometimes the map crashes before generating any pathfinding files. I talked Cajun into trying my way. Start the map, pause the game, go to the console and generate them one or more at a time. That seems to work even when the Botinator method fails.

For some mods, like DC, the lack of aiMeshes crashes the game before the pathfinding files are generated. When I created and used the needed aiMeshes, the pathfinding files generated fine. The game doesn't alway need all the aiMeshes, but the more building without them, the more likely the game will crash generating the paths.

I just wanted to give a little warning that if you rem out run StaticObjects.con, then you could also be losing the pathing of bridges and the bots will go to the bridge but not cross. This is what happened to me with the test map. I didn't understand it at first, but the bots would stop at the end of the road and not cross over. When I checked the pathmap, there was no bridge, it was just water there. After taking the rem out and pathing again, then the bridge appeared in the pathmap and the bots would pass over.
staticobjects.con must be run after aipathfinding then. you only need "run StaticObjects.con" if your going to create pathmaps as the map is loading. With this method the map is completely loaded before any pathmaps are made.

now i would like to give my own warning. Reming out ai.setMapSpawnPoints will cause the debugger to path out anything with a collision mesh. This includes vehicals (and overgowth in bfv). I recommend block commenting all of singleplayer/objectspawns.con, ie. beginrem on first line and endrem on last line, so your vehicals dont get pathed out with everything else. This has been my experience working with EoD on BFV.
Another warning. You have to have at least the all black default pathmaps provided by the botinator to do this method, because without them the game will crash when it gets the map loaded with a vehicle number error message.
You have to have reference to all the maps in th AIPathfinding.con file or you will get that problem. I ran into the same issue. If you just put reference to the boats and LC's it will work then. After you have all your maps just remove referance of the Boat and LC's from the AIPathfinding.con file and chunk out the boat and LC maps from your pathfinding folder. The debugger likes to have the full number sequence for some reason. If it aint got 2 it will not do 3 and so on...picky sucker aint it?

the way dice sets up aipathfinding.con for their non-sea maps works fine


ai.addSearchType Boat2
ai.addSearchType LandingCraft3

ai.addSearchMap Car4 0 0 20 4.0 0.3 2.5 0
ai.addSearchType Car 2 0
ai.setMapSpawnPoints 2 495.081/886.874

note that addSearchType and setMapSpawnPoints uses a 2 instead of a 4

[edit] this doesnt work in bfv however

I found by running with these statements in the aipathfinding:

run StaticObjects.con

and running the debugger, I was able to generate all the path map files in one pass without the vehicles or growth pathed out in BFVietnam. I assume it will do the same for BF42.
BFVietnam debugger creates much better pathmaps then the bf1942 debugger. I am able to use a smaller brush setting (1.0) and get better quality streak free pathmaps and create the small-ones in one pass. The pathmaps seem to be more accurate then BF1942 generated pathmaps.

In BF1942, even with the debugger, I was still getting steaked maps.
Cajun sent me a pic of streaky pathmaps once. It's the only time i've ever seen them, since it has never happened to me. I always generate them from the game console and have little use for those handy sp/coop adding tools. That might be why. The only problem I've had (other than CTD while genning them) is a few times every 64x64 tile was a miniture of the entire pathmap. All I had to do for those problems is re-create them and they were fine.

I wonder what causes the streaks in yours. Is there any noticeable errors in the logs that might provide clues as to why?

Four and I found out the Brush size is a float value. I use 0.5 as the Infantry brush size and 1.5 for Tank maps.

As for the streaks in bf pathmapping I think this is due to the way it looks at the mods and the "ai.setMapSpawnPoints" call in the AIPathfinding.con file. Also the lack of aiMeshes for complex structures.
I do like 4c does and rem out this line and gen them one at a time in the debugger mode from the console. I have no issues this way with streaking.
BTW the pathmaps are skewed in BFV just like in bf by the debugger. The only way to get them real accurate is to hand edit them in ED42.

Thanks guys,

Its seems that creating the pathmaps from the console is the way to go to get streak free pathmaps and create the pathmaps in one pass.

Even with ai.setMapSpawnPoints removed, I was still getting streaks when creating pathmaps when not using the console in bf1942.