Help - Search - Members - Calendar
Full Version: Strategic Search Failed Errors
Battlefield SinglePlayer Forum > Main > BF42 and BFV Discussion > AI Editing and Mod Support
Sting
Just added AI to a new map. After I generated the pathmaps (which completed the first run through amazingly enough) went ahead and let the round start to see how the bots were going to do.
Everything looked good so I put the map back together with the new paths and started up the game. This time the bots did nothing and the console streams messages about "Strategic search failed!"

Have seen this before in Liberation of Caen but was unsuccessful in resolving it, and now it has infected this latest map.
I swapped out all the prerequisites, conditions, and strategies to see if it was something maybe I had changed, but still nothing.

I've tried searching the Internet and these forums to see what would be causing this, but haven't found anything that helps. Any ideas?

The debugger pops up with an error, and I think this is the corresponding log info:

CODE

.\AIPathFinding/StrategicMap.h(345): Assert: .: (infoNo >= 0 && infoNo < 4 && constCellInMap(pos).isUsed(infoNo)) 2048 0 1591 0
.\AIPathFinding/StrategicMap.h(266): Assert: .: (isUsed(infoNo))
.\AIPathFinding/StrategicMap.h(259): Assert: .: (isUsed(infoNo))
.\AIPathFinding/StrategicMap.h(345): Assert: .: (infoNo >= 0 && infoNo < 4 && constCellInMap(pos).isUsed(infoNo)) 2051 0 1562 0
.\AIPathFinding/StrategicMap.h(266): Assert: .: (isUsed(infoNo))
.\AIPathFinding/StrategicMap.h(259): Assert: .: (isUsed(infoNo))
CareyBear
It's the pathmaps. The reason Liberation throws it (if it's the version I made you're talking about) is because I relased it with a bug and there's a bot spawn in a building - the door isn't pathed and they can't get out. I really should fix that.

Get hold of genpathmaps or the Battlefied Swiss Army Knife (there are links around the forum and on the main site). Check out your pathmaps, I suspect that's the problem.
Sting
The pathmaps look good, and I believe they are not the problem in Caen either.

In Caen is the attacking team doesn't really move past the bridge once its capped, until another one of the points is capped further in and the strategy switches. Even then just a few of the bots will trickle in.
I tried to resolve that by adding routes through the town , but then all they did was move up to those route areas and stop with the same message of strategic search failed.
Also, the defending team moves through town with no problem, which tells me the paths are good.

Generally a bot spawning on an invalid path will display a message indicating that.
So that is what makes me think there is something else going on.

I found a thread where 4cents mentioned the StrategicAreas causing them to stall, so I have been trying to make adjustments there...no luck yet

What really gets me is the first game I loaded where they were all running around doing their thing. Guess I can remove the paths and try to recreate them and see if that happens again.

CareyBear
A failed strategic search means the bots have attempted to go from point a to point b (ie, between where they are now and the orderposition in the strategic area they believe they should be able to reach) but can't find a valid path.

There does not need to be anything wrong with the pathmaps in the sense that they can be good, uncorrupted maps, there just need to be enclosed areas that bots believe they should be able to leave and can't. This is one thing that will throw the error. The trapped bots in caen are on a valid position, the door to the building just isn't pathed in. So it doesn't throw a pathfinding error, just the search error.

Yes, the StrategicAreas are involved, because in conjunction with the pathfinding they form the strategic map the AI is talking (yelling?) about.

I've seen things work once then not again. Try creating a few new sets of pathmaps or running with all black pathmaps. If the bots move, you've probably got blocked paths. If they still don't work with black maps, either your aipathfinding.con file has errors or your strategicareas have errors. Check over both and (if necessary) write a simpler strategicarea set.

If none of that works, try rewriting your strategies.

Some map formulations just simply don't work, even though they should. I have no idea why. AI bugs - as in the real ones, the engine idiosyncrasies - are difficult to spot and there's not usually anything you can do about it except try and avoid the problem.

The main reason bots don't like crossing the bridge in Caen is that they can usually see enemy targets and all in all would rather shoot than advance. That and the LOD bug which drops them in the water if the player is more than about 500m away.

The CP setup in Caen is not really very good for bots. Vehicles for starters can't get to nearly all of the CPs that are actually in the town, and I had to change the staticobjects for the level to even get them to go to the church and park on foot. The vehicles are in much more trouble, they certainly can't get to any of the SAs in town other than the bridge checkpoint.

I really should redo Caen. I know how to avoid most of these issues now, but it'll be a hellishly complex AI to do it. Oh, and cos that one doorway has been annoying me for years... tongue.gif
Sting
QUOTE (CareyBear @ Feb 13 2006, 12:09 AM)
If they still don't work with black maps, either your aipathfinding.con file has errors or your strategicareas have errors. Check over both and (if necessary) write a simpler strategicarea set.

Thanks CareyBear that was it - didn't even think to check AIPathfinding.con.

Sure enough I had the Car4 search defined but hadn't generated the paths for it, since it supposedly is not used. Once I removed it things are golden again.

So that solves at least that much of it.
Caen is going to be something different since the error doesn't occur until later in the game. I need to go back and have a look at that anyway since I somewhat broke the strategies when I added the extra routes. One of the CPs is defined as a route so there is a stage in the strategies that is skipped due to routes being there that weren't before.

Thanks for the help!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.