When and why have bots fallen out of style in what feels like the majority of modern shooters, particularly multiplayer shooters? Such a great feature, left out far too often. Thanks, great job with the blog!
Building bots requires a lot of resources, due to the nebulous nature of how they are supposed to behave (especially in situations where goals or good strategy are less well-defined), and because problems with bots can be difficult to reproduce and test. Building a bot isn’t trivial - it requires a lot of engineering and level design time, because the AI needs information in order to function.
So… why do they act this way? Probably because bots are supposed to be:
Adjustable (Can be set to different levels)
Scalable (can work either alone or in larger numbers)
Effective (can win the game)
Not overshadow the players (e.g. you don’t want the bot to get Play of the Game)
These ideas basically require some design and engineering time just to figure out how these will actually work. However, these requirements must be built on top of the game’s fundamentals, such as:
Recognizing important locations and/or powerups
Non-deterministic (will not always do the same routine)
Using weapons and powers that aren’t just “shoot the opponent”
Recognizing the game mode’s rules (capture the flag vs capture point vs death match vs …)
So in order to do this, each map will need:
A navigation map so that the bots know how to traverse the map (including special traversals, like jumpable gaps marked as such).
Points of interest marked with some way to tell which is more valuable at the moment.
Objective locations marked with some sort of algorithm to determine whether to go for the objective (e.g. consider the amount of danger present in relation to the objective), as well as stuff to actually tell the bot to stand in place and activate the objective.
And, the bot AI itself will need:
Some sort of prioritization system to decide what objectives or points of interest to chase, especially based on game mode. Typically, they’d take factors into account like distance, number of teammates nearby, number of teammates heading in that direction, number of enemies nearby, number of enemies heading in that direction, and relative value of the objective into account when determining this.
Behavior for recognizing how weapons are used, and (optionally) maps marked with areas for specific environmental use. So, for example, you’d have areas or objects on the map specifically marked as “pushing weapons can be used to shove enemies off of ledges here”, “explosive object here”, and so on for enemies to utilize specific effects to their best ability.
Some algorithm to decide what objective to pursue. One can make use of randomization, or one can decide to split things up by determining how many teammates or players are going to a specific objective or point of interest, and then choose a target based on that. Then you just need to figure out how often it needs to happen - does it happen on death? On objective captured/achieved? On some sort of other event, like a player leaving or arriving at a capture point?
You need to remember that this is all done in addition to the rest of the gameplay - interacting with objectives, shooting each other, different weapon behavior, environment art, level design, matchmaking, game modes, etc. This is all built on top of those. Then you need to start thinking about how to test this behavior, and constructing the environments in which you test them. Individual behaviors need testing, and aggregate behaviors need testing in order to make sure that the individual pieces can work together. This also necessitates useful debugging tools, such as showing the behaviors that the bot is currently running such as what it wants to do, where it wants to go, and how it plans to get there.
The biggest issue, as you may have noticed, is just how much these different systems are really interdependent on each other and how dependent they are on the map itself. There’s no way for a bot to understand what happens on a map without actively marking elements of it as such so that the bot understands how to move around. Even a small map change can cause bots to break if the navigation map isn’t properly updated. A lot of things that we understand intuitively (due to our brains being very good at parsing information) must be explicitly broken down for the AI in order for the bots to use that information. Creating functional bots requires an enormous commitment of resources, and it is a fragile system due to the sheer number of dependencies bots have. This is why many games don’t have them - they just require too much commitment in terms of resources to build.
Got a burning question you want answered?
Short questions: Ask a Game Dev on Twitter
Long questions: Ask a Game Dev on Tumblr
Frequent questions: The FAQ