Game Development Reference
In-Depth Information
Detecting cover automatically in a
third-person game
Cover shooters is an ever-popular genre in today's console games. How does one code a
system that recognizes and allows players to take cover? There are several ways to do this,
but basically, there are two main branches, each with their benefits and drawbacks. The
first branch is one where a level designer places logical cover items around the environ-
ments or where they are baked into models by an artist. This could be as simple as a bound-
ing volume, or it could be complex with directional data as well. This has a benefit for the
programmer in that it's easy to recognize when a player is inside them by comparing
bounding volumes. Another benefit is that the designer has full control over where there is
cover and where there isn't. A drawback is that it is labor-intensive for the designer or artist
and might be inconsistent to the player.
The method we'll implement is one where there is no pregenerated cover, and it's checked
in runtime. No additional work is required for a designer or artist, except that the models
that are used need to be of a certain height to be recognized as cover (and work with anima-
tions).
Normally, there are two different kinds of cover: a low cover that characters can crouch be-
hind and shoot over. The other one is full height cover, where characters stand next to the
edge of it and shoot around the corner. In some games, it's only possible to use full height
covers where it's also possible to shoot from them, such as corners.
Once the character is in cover, certain movement restrictions usually apply. In most games,
the player can move sideways along the cover. In some games, moving backwards will re-
lease the character from the cover, while in others, you have to toggle the cover button.
We'll implement the latter.
Search WWH ::




Custom Search