This is a simple game to demonstrate the usefulness of patterns to address certain design issues. The game uses the Unreal Engine 4 in order to provide a case study that is more realistic than the overly simple examples typically found in university courses (and also to make the program more interesting).
The Pattern Game is based on the 3rd Person Power-Up Game with C++ tutorial from Epic Games, with some changes to make it easier to use as a teaching vehicle for a software engineering coures (as opposed an Unreal Engine course). Most importantly, in a typical UE4 project many things are done using the visual scripting language called Blueprints. For this tutorial I've switched most of the Blueprint-related functionality to C++ so that I don't have to introduce yet another language during the lectures. (I have implemented the selection sphere for characters in a later iteration with Blueprints, I'll probably switch that to C++ as well for consistency.)
The branch tutorial
contains this state of the program. During the
lectures I've introduced a number of new requirements and shown how
they can be addressed using various design patterns. These changes are
contained in the master
branch. I do the ongoing development work on
the patterns
branch or on feature branches that I don't push.
This repository contains the complete Unreal Engine project, including all assets. You need to have Visual Studio 2015 or Xcode installed to compile the C++ code. To open the project from the Unreal Engine launcher after checking out from this repository, proceed as follows:
-
Launch Unreal Engine (Version 4.10.1), either from the Library tab or using the big yellow button in the upper left corner.
-
This should open an Unreal Project Browser window. Click on the
Browse...
button and select thePG.uproject
file from the repository. -
The UE4 Editor for the project should open.
If this does not work try navigating to the project folder in Explorer or the Finder and do the following
-
In Windows: Right click on the
PG.uproject
file and select the menu item "Generate Visual Studio Project Files." This should generate aPG.sln
file that you can open with Visual Studio. After building theDebugGameEditor
solution configuration you can launch the editor from VS using theStart Debugging
menu item (or F5) to debug any issues. -
On OS X: Select the
PG.uproject
file in the Finder and click on the "Finder/Services/Generate Xcode Project" menu entry. This should generate aPG.xcworkspace
file that you can open with Xcode. After building the PG target you can launch the editor using the "Play" button to debug any issues.
I have not built the example on Linux, but the process described on the Building on Linux page from the Unreal Wiki seems relatively straightforward.