locke.bruce@yahoo.com



The Mystery of the Immobile Keepers


Introduction

In the final fight of Eclipse the player must defeat 3 waves of enemies before the game is finished. After changing this fight one day we were surprised to see that some Keepers spawned in caves refused to move. Previously they had worked fine, but after the changes they would stay in the caves. Since the game would not continue until all the Keepers were killed this caused a problem. The player would see no more enemies and wonder why nothing was happening. The game seemed to stop, and unless players searched the caves and killed the Keepers they would have to quit. I investigated the problem, and by readjusting the Keepr scripting and some path nodes I got the Keepers to behave as planned - and thankfully did not have to change the terrain.



Half-Life 2 Character Navigation

To successfully navigate a map enemies in Half-Life 2 use path nodes. A basic path node network is created with info_node entities. In a map with no path nodes an enemy such as a Keeper will charge when he sees the player. However, if the player moves behind a wall (or even a table) the Keeper will stop. Without path nodes the Keeper can only move toward the player if he has a direct unblocked path. However, with path nodes the Keeper will move around obstacles and continue to pursue, even if the player slips out of sight for a short time.

Figure 1

Figure 1 shows the difference in behavior when path nodes are added to an area. On each side of the wall two Keepers are set to spawn 2 seconds apart. The right-hand section uses path nodes to guide the Keepers. After the first is spawned he is scripted to walk to a path_corner, then since this region has path nodes he begins patrolling. The second Keeper is spawned and does the same thing. Basically, both Keepers move from the spot they were spawned and wander around. In contrast, the left-hand region has no path nodes or path_corners. The first Keeper is spawned and stands in place. The second Keeper will not spawn until the first leaves the spawn location.


As can be seen if Figure 1, the important factor for getting Keepers to move is to ensure the path nodes are working. To fix the problem caused by changes I went back in and readjusted the info-nodes around the spawn locations. I also had the Keepers run to a path_corner when spawned to ensure the area was clear for the next Keeper. With these corrections the Keepers behaved as expected.

Figure 2

Figure 2 shows a level editor picture of one of the caves where Keepers spawn. The Keeper model (A) is a NPC Template and defines the characteristics of the spawned Keepers. Once spawned the Keeper should run out and begin patrolling the area. When he spots Violet he will begin an attack. The boxes labeled B are the path corners that define the route the newly spawned Keeper will follow. If a Keeper spots Violet before finishing the path he will begin chasing her and forget the path. Since our only goal in using path corners was to get the Keepers out of the cave this was acceptable. In other parts of the game where it was necessary to make the Keepers ignore Violet and follow a specific path "Scripted Sequence" entities, which can turn the Keeper ai off, were used.

Once out of the cave a Keeper needs to be able to make his way around the level. The yellow boxes (C) are path nodes that help the Keeper navigate about. Due to the sloping nature of the terrain it was necessary to use more path nodes than would be needed in a flat area to ensure that the keepers would move over the bumps. During our project we had to spend a lot of time tweaking the path node system in all the levels, since the sloping terrain of our game made it hard to tell exactly which path nodes would link to others. Fortunately we did a good job of this, and it was rare to see our Keepers refusing to move.



Conclusion

Figure 3 shows two Keepers closing in on Violet. Before the corrections these two would stand idly in the caves. The important lesson to learn from this expereience is that the intelligence of enemies frequently depends upon the efficiency of their path node system.


Figure 3