Sub-optimal pathing

Started by
20 comments, last by gp1628 19 years, 9 months ago
Well the main reason I want to have the bots choose different paths is basically so that they'll be less predictable and at least seem a *little* random, as people have said. I realize that in many cases things like that wouldn't seem realistic (especially if the 'new' path the bot chose went far, far out of the way). But on most maps, there are multiple ways to get from one location to another, and usually more than one is fairly valid. For RTCW players - a simple example is beach, and creating a path for an allied bot to the objective. Assuming the bot starts from the bunker flag, he can reach the upper base in 2 'normal' ways - via axis spawn to radio room, or up the stairs to the back stairway. If he goes the back stairway, he can then get to the warroom via the ducts (which is actually the 'shortest path' if you don't account for crouching being slower), or through the basement. This leaves 3 valid paths to reach the same goal, and it is much more interesting to play against these bots if they don't *always* go down the back stairs and through the ducts. If you're playing against 10 bots, and all 10 go the exact same way, every single time, it can get pretty boring, not to mention easy. That being said, I don't want totally random paths - like there's no reason at all for a bot to leave the bunker and go on to the beach and run around there for a while.

A lot of the factors mentioned for path selection are actually part of the goal selection I use for the bots - eg, one bot's longterm goal may be to steal the objective, but if he's low on health, he'll look for a medic if one isn't way out of the way, even if the medic isn't on a direct path to the objective. I'm working on including some of the other concepts into a factor of how likely a bot is to even search for a sub-optimal path (eg, if time is short and the bot is on offense, shorter paths are better, etc), and I will probably add some kind of influence mapping, though I'll try to do it without having the bots 'cheat' :)

Again, thank you to everyone for all the help and suggestions. I'm trying out a lot of these methods to see how well they perform in various situations, and I am sure that I will be able to use a lot of what is mentioned here to create something suitable. You have all given me a lot of good ideas and a better understanding of pathfinding in general. Thanks :)
Advertisement
The optimum path every time is not going to give a human player the challenge they want. There are logical reasons for variation. The "self safety" version which prefers to move in a direction but does it by going from landmark to landmark to get some cover as they move. The "swarming berserker" is the opposite and seeks the straightest line which can give the fastest speed only avoiding terrain which might slow it. The "flanking movement", the "assassin backattack", the "get close then pause for buddies". Really irritating would be the "scout/decoy" which moves into a line of site, then drops back abit and circles closer until a new line of site, then circles the other direction. So the bot will still get to the same target but its the positions inbetween which will be arrived at differently.

This topic is closed to new replies.

Advertisement