IMGD 4000

Project Behavior Tree

Due date: Thursday, April 7th, 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.


Top | Hints | Submission | Grading

Details

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."

Warning! We have tested the tutorial for UE v4.9 and it works as-is. If you use another version, the tutorial should work but some of the steps may need to be slightly modified (e.g., menu choices being slightly different). In addition, the assets we provide (see Hints) may or may not work with other versions.

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.

Extension

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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.


Hints

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 (e.g., GetActorLocation) are only available if you drag off the correct pins of specific nodes.

However, there are a couple of alternatives to crafting the Blueprints by hand:

For some of the steps in the guide, you can copy Blueprint image by selecting it with ctrl-c and pasting it in the Blueprint in UE4 with ctrl-v. Note, however, that note all the nodes go in and not all are connected. Your mileage may vary.

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. Close UE4 (save your work first!). Then, extract the zip file into the projects Content/Blueprints/ folder. Re-open your project. The new assets should be visible. Note, you will need to set the variable type of AI_CON_Ref to 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. If some of the links need re-connecting, do so. If any errors persist, try deleting and re-adding a component - UE is sometimes confused when components are copied.

Similarly, for Step #12, sub-step #5, you can download our implementation of the RapidMoveTo service and extract. In addition to setting the AI_CON_Ref as above, you also re-add the Cast to Follower_AI_CON component, reconnecting it and deleting the old one.

And ditto for Step #13, sub-step #6, you can download our implementation of the CloseEnough function and extract.

Another promising tutorial shows how C++ code can be used with behavior trees in Victor's Behavior tree basic zombie.


Submission

Your assignment is to be submitted electronically no later than 11:59pm on the last day of class. You must hand in the following:

To submit:

  1. Upload your .exe (see above).
  2. Place the README and Source code in a folder with your last name (e.g., "claypool").
  3. Zip up the folder.
  4. Log into the Instruct Assist website:
    https://ia.wpi.edu/imgd4000/

    Use your WPI username and password for access. Visit:

    Tools → File Submission

    Select "Project-BehaviorTree" from the dropdown and then "Browse" and select your assignment (claypool.zip).

    Make sure to hit "Upload File" after selecting it!

    If successful, you should see a line similar to:

     Creator    Upload Time           File Name      Size     Status    Removal
     Claypool 2016-04-08 10:23:23    claypool.zip    2788 KB  On Time   Delete
    

IMPORTANT!

After submitting your project, you must arrange a time to provide a demonstration with the TA. On the Instruct Assist website, visit:

Tools → Demonstrations - List → Project-BehaviorTree
and select an available slot. Demonstrations will be:

Show up to your slot with game ready and loaded! Don't spent any of your 15 minutes logging in, connecting to the network, loading your game ...


Grading

A grading guide is available.

Grading Guidelines
Basic Behavior 85%
Extension 15%

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.


Top | Hints | Submission | Grading

Return to the IMGD 4000 Home Page

Send all questions to the TA mailing list (imgd4000-staff at cs.wpi.edu).