Due date: Thursday, April 6th, 11:59pm
The goal of this project is to implement a basic behavior tree in UE4, extending it in a couple of ways to show mastery and gain understanding of basic AI behaviors.
Complete the Behavior Tree Quick Start Guide.
"The Behavior Tree Quick Start Guide walks you through the process of creating a NavMesh, creating an AI Controller, creating a Character that will be controlled by that AI Controller, and creating all the parts necessary for a simple Behavior Tree."
Once complete, you should have an environment with two avatars. The player controls one avatar (the player) and the AI controls the second avatar (the AI). If the player gets close enough to the AI and the AI has line of sight to the player avatar, the AI will begin to chase the player. If the player is able to break line of sight, the AI will go to the player's last known location, wait, then return to where it started.
Successful completion (and demonstration, including questions about understanding) of the basic tutorial behavior is sufficient for a "B" grade. To achieve an "A" grade, one of the following must be accomplished:
Game. Make a "game" out of the project. As a game, it should have a goal with a win/loss condition. It can be quite basic.
Search. Rather than just going the player's last known location, the AI could wander a bit, hoping to catch sight of the player before returning to the home location.
Wander. The AI just stands around the home location when not chasing the player. Extend the behavior so the AI moves around a bit, but all near the home location.
Patrol. Rather than waiting around one location, the AI could move from one location to another in a pattern. Extend the behavior with a control point Actor with the AI moving back and forth between at least 2 Actors until it chases the player.
Attack. Instead of just chasing, implement an "attack" where the AI would collide with the player causing damage. Some consequence of the damage should be evident (e.g., a health indication/message).
You should be prepared to demo your solution, including your extension for an "A" grade (if any), as well as answer questions about your code and implementation.
You will work alone for this project. You may discuss this project with others, but you must write all the code yourself.
All of the Blueprints can be crafted by hand. When doing so, start
by defining the variables listed after each picture. If you do not,
many of the options you need will not be available. Some options
GetActorLocation) are only available if you drag
off the correct pins of specific nodes.
However, there are some alternatives to crafting all the Blueprints by hand:
For some of the steps in the guide, you can copy a Blueprint image by selecting it with ctrl-c and pasting it in UE4 with ctrl-v. Note, however, that this does not always work perfectly--some nodes may be missed and some may not be connected.
For step #11, "Make a Service", sub-step #5, you are to create an "AgroCheck" service. You can do so using the figure in the tutorial. However, if you would rather, you can download our implementation of the AgroCheck service:
Follower_AI_CON. To do this, open up the "Variable Type" drop-down and start typing the name "Follower_AI_CON" into the search bar, and it should come up automatically if everything is set up right.
Get all actors of classto
Similarly, for Step #12, sub-step #5, you can download our implementation of the RapidMoveTo service and extract:
AI_CON_Refas above, you should also re-add the
Cast to Follower_AI_CONcomponent, reconnecting it and deleting the old one.
CastTo Follower_AI_CONnode and set the type of
Follower_AI_CON, just as you did for AgroCheck.
For Step #13, sub-step #6, you can download our implementation of the CloseEnough function and extract.
The following tutorial shows how C++ code can be used with behavior trees: Victor's Behavior tree basic zombie.
Below is a general grading rubric:
100-90. The submission clearly meets requirements. The basic behavior in the tutorial is clearly visible. The extension (game or other behavior) is demonstrable and robust.
89-80. The submission meets requirements. The basic behavior in the tutorial is clearly visible. The extension (game or other behavior) is not complete and/or not robust.
79-70. The submission barely meets requirements. The submission meets requirements. The basic behavior in the tutorial is somewhat functional, but not complete. The extension (game or other behavior) is not started.
69-60. The submission fails to meet some requirements. The basic behavior in the tutorial is not functional, but aspects of the tutorial are evident through inspection. The extension (game or other behavior) is not started.
59-0. The submission fails to meet requirements. The submission fails to meet some requirements. The basic behavior in the tutorial is not functional and aspects of the tutorial are not started nor working. The extension (game or other behavior) is not started.
Return to the IMGD 4000 Home Page
Send all questions to the staff mailing list (imgd4000-staff at cs.wpi.edu).