WPI Worcester Polytechnic Institute


Technical Game Development II


This page has any samples discussed in class, links to useful documents, exam preparation material, tutorials or any other demonstration-type class materials.


WARNING! A state-of-the-art game development tool like Unreal Engine is always being improved, which means there will often be differences, large and small, between the latest available official documentation (not to mention information you find in user forums) and the current release you are using (e.g., UE4.15). Navigating such issues is an unavoidable part of professional game development. Use the online class forum at InstructAssist to get help and share relevant information with your classmates, TA's and faculty.

A short collision tutorial showing three different ways to create a collision in Blender, brining it in to UE4, and then within the UE4 editor.

Exposing Gameplay Elements to Blueprints - a "cheatsheet" for all the macros for variables and functions to access them in blueprints.

Draw Text/HUD Blueprint - a very fast tutorial of how to create HUDs in game (only 6 minutes long).

A useful debug technique includes printing to the log. Don't forget to #include "Engine.h" to print debug messages to the screen (this wiki doesn't tell you that). Also, helpful UE4 String Conversions may be helpful for debug messages.

It's helpful to know the differences between AActor types (most importantly, APawn, ACharacter, and AController). AScreenCapture is used for splitscreen, minimaps, etc.

The Collisions Responses document is helpful for understanding how collisions work in UE4.

A quick tutorial on nav meshes for basic AI navigation. Note, this only covers the blueprints aspects of it.

If you are familiar with Unity, you might try the Unity3D Developer's Guide to UE4.

A guide showing how to line trace in UE4 in C++.

The UE4 directory structure. The most important directories to focus on are the Content and Source directories. Content holds all art assets relevant to your game. Source holds all source files.

Events used for editing of objects properties within the UE4 editor. PostEditChangeProperty triggers when an actor's properties (details panel) are changed and PostEditMove triggers when an actor is moved in the world. These allow the UE4 Level Editor to communicate with C++ code. Function signatures are in the UE4 Documentation linked.

The Coding Standard for UE. It helps understand some of the code samples you might see. Although not required, you might use the same standard for your code. From the guide:

UE4 comes with 3D Drawing features that are enabled in debug mode to help visualize/debug your program. See: Draw 3D Debug Points, Lines, and Spheres: Visualize Your Algorithm in Action. Includes many different shapes, but points and lines may be the most useful.

Game Development Stack Exchange had a nice question and answer on Decision Trees vs. Behavior Trees.

Content examples and new features - Try the "Learn" menu in the "Epic Games Launcher" for a lot of great examples of the various features in UE4. Some are merely artistic examples while some are more advanced tech demos of AI and interactions between C++ and blueprints. The best map may be the "Content Examples", which is a project created by the UE4 developers in order to showcase various capabilities of the engine. Some examples will create a new project (such as a full game) while some can just be imported into an existing project (such as materials).

The FBX content pipeline to get FBX (e.g, Maya, 3ds) content into UE4. Relevant is a tutorial video to set up project and download the required FBX files from the Unreal Engine wiki site. With assets to download.

Some other coding tips:

  • Note, constructors for AActors are not like constructors for native C++ classes - they must all have the same argument because they are used by blueprints in the editor. The editor actually runs the constructor to initialize the properties before you expand upon them in the blueprint. If you want to have functionality that runs when an object is created, you can put it in the BeginPlay() function or make your own initialization function.

  • UE4 Editor Compiler Flag - Make sure to surround any code that refers to the UE4 editor with the following compiler macro:
      #if WITH_EDITOR
      // code here
    Examples of functions that reference the editor are PostEditChangeProperty(...)and PostEditMove(...).

  • AActor Ticks - Actors do not execute the tick function by default. If you want an actor to call Tick(float val), add the following line to your constructor.
      PrimaryActorTick.bCanEverTick = true;
    This will allow the actor to call the tick function. If this still doesn't work, you might want to try adding this line also:
      PrimaryActorTick.bStartWithTickEnabled = true;

  • Line Trace Debugging - Useful for determining how your line tracing is working:
      DrawDebugLine(this->GetWorld(), StartTrace, Hit.TraceEnd, FColor::Black, true, 1000.f, 10.f);


    A* related topics:

    1. There are numerous possible improvements to A* in addition to those we talked about in "Advanced Pathfinding". One such is A* with jump points.
    2. A nice overview of basic pathfinding algorithms, including A* can be found in An Introduction to A*, by Red Blob games.
    3. Pathfinding (using A* or something else) in 3d can be tricky, but some thoughts can be found in part1, part2, and part3.

    A good paper on generating NavMesh's automatically:

    [Leo14]Timothy Leonard. Procedural Generation of Navigation Meshes in Arbitrary 2D Environments, Open Journal Systems Game Behavior, Volume 1, Number 1, 2014. Online: http://computing.derby.ac.uk/ojs/index.php/gb/article/view/13


    A set of implementation tutorials on understanding steering behaviors.


    Mat Buckland. Programming Game AI by Example, Wordware, ISBN-13: 978-1556220784, 2005. Sample materials from this book include source code for all the examples and executables for all the examples.

    Game Development Stack Exchange had a nice question and answer on Decision Trees vs. Behavior Trees.

    Return to the IMGD 4000 Home Page

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