373
Figure 9.1. Visualizing the line of sight from an NPC to the player.
9.2. Debug Drawing Facilities
also notice some debug text rendered just above the head of the enemy,
in this case showing weapon ranges, a damage multiplier, the distance
to the target, and the character’s percentage chance of striking the tar-
get. Being able to print out arbitrary information in three-dimensional
space is an incredibly useful feature.
z Figure 9.2 shows how a wireframe sphere can be used to visualize the
dynamically expanding blast radius of an explosion.
z Figure 9.3 shows how spheres can be used to visualize the radii used
by Drake when searching for ledges to hang from in the game. A red
line shows the ledge he is currently hanging from. Notice that in this
diagram, white text is displayed in the upper left -hand corner of the
screen. In the Uncharted: Drake’s Fortune engine, we have the ability to
display text in two-dimensional screen space, as well as in full 3D. This
can be useful when you want the text to be displayed independently of
the current camera angle.
z Figure 9.4 shows an AI character that has been placed in a special de-
bugging mode. In this mode, the character’s brain is eff ectively turned