Monday, 27 February 2017

Idea Generation for Computer Games - NPC implementation: Flow Control.

After making the NPC function as far as firing attacks and following the player were concerned, there were a couple of tweaks that needed to be added to the blueprint to round off the movement and tracking specifically.
The main specific alteration which needed adding at this point was the 'Face Character' setup, which was constructed to make the NPC face the character if it ever loses track of the pawn. This is a simple setup, fired by a custom event which is then linked into the earlier tracking procedures.
The custom event is linked to a standard 'Set actor rotation' node with a 'Find look at rotation' linked directly to the player character through a 'GetActorLocation' node.
This did present me with some more problems in the sense that sometimes the NPC would end up angling inappropriately in effort to face the player. This resulted in the NPC tipping forward or backward often, which looked wrong.
This in itself reruired a fix, which again was only a couple of nodes worth of work.

The blueprint solution for both the initial problem, and the additional problem which arose from that solution, can be seen below;

No comments:

Post a Comment