Due date: Thursday, March 30st, 11:59pm
The goal of this project is to gain a deeper understanding of A*, a core pathfinding algorithm used in games, by implementing the basic algorithm from scratch in UE4 and adding a smoothing extension.
You are to extend the QuickStart First-Person Shooter as follows:
(Note: If you prefer to start with a fresh project, rather than the First-Person Shooter, that is also fine.)
AddOnScreenDebugMessage()
). Better would be to
display the path using colored lines in the world.
Successful completion (and demonstration) of the above steps is sufficient for a "B" grade.
To achieve an "A" grade, add simple waypoint path smoothing as presented in class. Note, you also must implement some obstacles to smooth "around" in this case.
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.
Debugging Hint: To get extra debugging control, such as breakpoints, see instructions for how to attach Visual Studio to the Unreal Editor process.
Waypoints are easiest to extend from the Actor
.
Having a visible element, such as a sphere, will make them viewable in
the level editor.
You are strongly encouraged to check out the tutorial "Making Waypoints in UE4"). This walks you through creating Waypoints that are visible in the Level Editor, while allowing C++ code to be written for the A*.
Important! Accessing the Blueprint PathNode's "nextNode" variable from C++ is possible, but not advised. An alternate waypoint implementation is to create a PathNode C++ class and then create a Blueprint that inherit's from that class. If you create attributes in the C++ PathNode and prefix them with:
UPROPERTY(EditAnywhere, BlueprintReadWrite)they will be available for editing from the inherited Blueprint.
Lines between the waypoints, including the computed path, can be
shown with DrawDebugLine()
:
static void DrawDebugLine ( UObject *WorldContextObject, const FVector LineStart, const FVector LineEnd, FLinearColor LineColor, float Duration, float Thickness );
For example:
// Draw a red line. FVector start(0.0, 0.0, 0.0); FVector end(0.0, 10.0, 0.0); DrawDebugLine(GetWorld(), start, end, FColor::Red, 1.0, 12);
Grading Guidelines | ||||||
---|---|---|---|---|---|---|
Placeable Waypoints | 5% | |||||
Waypoint Connections | 20% | |||||
Selectable Source & Destination | 10% | |||||
A* Pathfinding | 35% | |||||
Path Depiction | 20% | |||||
Path Smoothing | 10% |
Below is a general grading rubric:
100-90. The submission clearly meets requirements. The waypoints are placeable from the level editor. The source and destination are selectable. The resulting path is accurate and clearly visible. The path smoothing element is effective and demonstrable.
89-80. The submission meets requirements. The waypoints are placeable from the level editor. The source or destination are selectable. The resulting path is accurate and mostly visible. The path smoothing element is not implemented effectively or is not clearly demonstrable.
79-70. The submission barely meets requirements. The waypoints may not be (easily) placeable from the level editor. The source and destination is not selectable. The resulting path is inaccurate or not visible. The path smoothing element is not implemented.
69-60. The submission fails to meet some requirements. Some combination of: a) the waypoints are not placeable from the level editor; b) the source and destination are not selectable; and/or c) the resulting path is inaccurate and not visible. The path smoothing element is not implemented and the game is not implemented.
59-0. The submission fails to meet requirements. The waypoints are not placeable from the level editor. The source and destination are not selectable. The resulting path is inaccurate and not visible. The path smoothing element is not implemented.
Return to the IMGD 4000 Home Page
Send all questions to the staff mailing list (imgd4000-staff at cs.wpi.edu).