I am struggling to come up with a way to explain this in an unambiguous way, and it is difficult to say the least. It always has been, and this is the reason behind this thread along with others I plan to start here, and at bfsp. Your asking very good questions, but like others you have the wrong impression as to how and why bots move around the map. It is the Strategic Areas or SA's for short and their values at any given time due to conditionals that move bots around the map. The pathmaps are just that, a map showing how to get from SA to SA.
I just want the bots to follow the roads.
I showed you how to do that with my edited Tank pathmaps for Bocage, and this is the only way to get them to specifically follow a road. You can see how that limits the game play right? In a real battle the infantry and tanks are not going to follow any roads, but take out across a field or what ever to engage the enemy. I keep tanks on the road only in parts of the map where it is appropriate for them to do so. Other wise I only restrict them, within reason. As for Infantry, I rarely ever restrict them to a road, but will keep them confined within a certain area. More on this later because understanding more about the AI will make a lot of this more clear to you.
And if they somehow end up off the road in one of the fields (such as a human player dropping them off or crashing) then I want the bots to head back to the road.
First off, why would they want to go back to the road? Remember a bot has two purposes or desires only, to kill other bots and take control points in the SA's. He knows nothing at all about a road but looks for the SA with the highest value and heads for it in the most direct route the pathmaps will allow. If along the way another SA develops a temperature or value higher than the one he is heading for, he goes towards that one. As he travels to the control point he goes from the tile he is in and heads for the next waypoint in the next tile, waypoint to waypoint until he reaches his destination.
Such as an area where they were walking back and forth along a fence line because they "didn't know" how to go around it to the gap that allowed them through
Sounds to me like you have a waypoint issue and I suspect there was some black or do go around the fence. Bots only see complex objects which are the buildings and structures with interiors, and then not even in the way you do. They see a mesh with "portals" which are the openings like doors and windows. They can only see or shoot at you through these portals. They don't even see things like fences. sandbags, etc. Even with a portal mesh, if the pathmap is black they will try to go right through it because the pathmap says that is a do go area.
As mentioned the bots move around the map from SA to SA because of their modulating values during game play. SA's are connected to each other by "AddNeighbor" and this is very important in deciding on which SA the bots go to from each SA. A SA, when created has a basic value you set and then it is modified by Flag modifiers linked to the strategies and due to conditionals, increase or decrease the value of the SA. For instance, Neutral, Hostile, or Owned would be three conditions and each would have a modifier value that the basic value is increased by due to this condition. Some other modifiers are chokepoint, soldierspawner, bridge, flank, front, and the list goes on. You have different modifiers in the strategies too along with number of attacks or defenses and aggression levels to name a few. By understanding the Strategic AI, the strategies, and the pathmapping system you can get the bots to play the map right. This can take a tremendous amount of time depending on the map and it's complexity.
I need to do a thread on StrategicAreas and strategies to give everyone a view of the bigger picture and I think this would help a lot towards understanding. Like I said, this is a very complected subject with a complex interaction of three complex systems. Hence my opening statement.
Here is something interesting to do and very educational at the same time. Take the pathmap textures from Ed42 and put them in your map. You of course would have to do Infantry and Tank separately, but you get the idea. Now when you play the map you have the pathmap as the terrain and your seeing what the bots see, in away. You can go free cam, set back and watch the bots play out the map, seeing how they follow the pathmaps. In the next post, when I have the time, I will show you how to turn on several ai debugging tools in the AI.con so you can see whats going on.
I hope this has helped somewhat and keep the questions coming. Anyone else please feel free to jump right in here ok?
L8trz,
Cajunwolf