Assignment 10: Behave!
Due Friday, November 15, before midnight
The goals for this assignment are:
-
Use a behavior tree API to implement NPC behaviors
-
Create at least two distinct behaviors for two types of NPCs
1. Getting Started
It is not necessary to fetch from the upstream repository this week. Instead,
-
Create a new scene, called
A10_Behavior
, and save it to yourHelloUnity/Assets/Scenes
folder.
Scene and Player Setup
In both your scenes:
-
Initialize your scene with the prefab containing your level from assignment 7.
-
Add your character from assignment 4.
2. Assignment Goals
In this assignment, you will implement two behaviors using an existing behavior tree implementation. The first behavior should implement a traditional RPG attack and flee behavior. The second behavior can be anything you wish. It is not necessary to implement game mechanics for the player, although you are free to do so!
Your homework should use this class to implement
your behavior tree. Copy this file into your repository into the Scripts
directory.
|
2.1. Behaviors
Write two scripts, Scripts/BehaviorMinion.cs
and Scripts/BehaviorUnique.cs
.
Both these scripts must use a behavior tree.
2.1.1. Minion
In the script, Scripts/BehaviorMinion.cs
, implement a traditional RPG attack/flee
behavior. In this behavior,
-
Your minion should attack the player if the player comes within range of it.
-
Your minion should retreat if the the player returns to their home area.
-
Your minion should follow the player if the player runs away.
2.1.2. Unique
In the script, Scripts/BehaviorUnique.cs
, implement a behavior of your choice.
Below are some ideas:
-
A companion who helps the player
-
An NPC quest giver, story character, or merchant
-
A different type of minion enemy
-
A boss enemy
Choose something that supports your game design!
3. What to hand in
-
Your scenes with your level and player in it
-
Your scripts,
BehaviorMinion.cs
andBehaviorUnique.cs
-
Updated README
-
A video or GIF showing your two behaviors.
-
Credits/links for any assets that you did not make yourself — if you add assets this week.
-
Don’t forget to commit your changes and then push them to Github. Using Git Bash,
run the following command inside your HelloUnity
directory.
$ cd HelloUnity
$ git add .
$ git commit -m "Finished HelloUnity"
$ git push
Run git status
to check the result of the previous git command.
Check the Github website to make sure that your program uploaded correctly.
Assignment rubrics
Grades are out of 4 points.
-
Your scripts need to be feature complete (3.5 points)
-
Readme (0.5 point)
Submission rubrics
For full credit, your submission must
-
In your README, include videos or gifs showing your working scripts
-
Some credit lost for missing features or bugs, depending on severity of error
-
-100% for failure to commit work to Github
-
-100% for failure to build and run on the lab Windows machines