Unreal Engine

2020 Notes

4.26 Features

Important

Less Important

Unimportant


Environment Creation Workflow

Pre-production

  1. Ask and answer some basic questions:
    • Who inhabits the environment?
    • What is it used for?
    • Where is it?
    • When is it used?
  2. Create a reference board of related images.
  3. Draw a simple map of the location.
  4. Distill ref board down to a mood board that conveys:
    • Art style.
    • Subject matter.
    • Structure.
    1. Choose a general direction to explore. In the case of an environment, perhaps it's lighting, structure, or textures. Don't get too attached to any one idea.
    2. Refer to project documentation. Look through what's already been written about the environment. If nothing's been written yet, maybe write something?
    3. Add existing visual elements. Leveraging the work that's been done with the reference images, just copy that collection into a new board and work from there.
    4. Collect inspiring design. Hunt for abstract representations of what you're looking for. The vaguer the better.
    5. Add photographs. Just to hammer home the point that the previous step was more abstract.
    6. Add colors and fonts. Pull from the existing images or find a palette that fits what's developing in this soup.
    7. Add motion and animation. Having strong, animated references can go a very long way in solidifying a concept.
    8. Arrange the materials. Determine the order of the references. Size and relationships matter at this stage. Take your time.
    9. Annotate. Add notes to reinforce and explain why certain elements fit. This provides context for…
    10. Get feedback. Not as big a concern for the soloist, but even leaving off at this stage for a day or two, then looking again with fresh eyes.
  5. Establish asset naming conventions:
    • SM prefix for static meshes.
    • T prefix for textures with appropriate suffixes:
      • _D for base color.
      • _N for normal map.
      • _M for occlusion/roughness/metallic masks.
    • M prefix for master materials.
    • MI prefix for instanced materials.
  6. Establish a file hierarchy.
  7. Create an asset list.

Blockout

  1. Draft Rough Unified Model of Environment: work quickly in modeling software to visualize the map, but work smart. Think modular, and plan for future detachment and refinement. Import the UE Manniquin for scale. Ensure Units are set to Centimeters!
  2. Export as Single Attached Mesh: export to the Meshes folder in the Unreal project.
  3. Import to Unreal Engine: Deselect Auto Generate Collision, Deselect Advanced → Generate Lightmap UVs. Material: Material Import Method (Do Not Create Material), Deselect Import Textures.
  4. Walk Through Blockout: Get a sense of the space, check for scale issues.
  5. Refine Model: Return to modeling software and create a refined version of the space. Break larger areas into smaller chunks for future asset management, eg. rooms divided into walls.
  6. Export/Import Refined Meshes
  7. Repeat for Props

Note:

Collision

Material Setup

  1. Create Basic Asset → Material.
  2. Use M_ prefix for master material.
  3. T+LMB: Place 3 Texture Sample nodes.
  4. Connect RGB of Texture Sample 1 to Base Color.
  5. Connect RGB of Texture Sample 2 to Normal.
  6. Connect R of Texture Sample 3 to Ambient Occlusion.
  7. Connect G of Texture Sample 3 to Roughness.
  8. Connect B of Texture Sample 3 to Metallic.
  9. Material Expression Texture Base → Texture: Assign 127grey (Engine Content) to Samples 1 and 3. Assign BaseFlattenNormalMap (Engine Content) to Sample 2.
  10. RMB on Texture Sample → Convert to Parameter. Name the new Param2D nodes Diffuse, Normal, and Mask, respectively.
  11. Clone this master material for each subgroup of asset, eg. Props, Structure.
  12. RMB on Material → Create Material Instance. Use MI_ prefix to denote material instance.
  13. Create folders within the Materials folder for Props, Structure, etc. Create material instances for each asset in their appropriate folders.
  14. Assign textures.

Texture Import

  1. Export alpha-pass textures in Painter:
    • Unreal Engine 4 (Packed)
    • TGA
    • 2K
    • Naming convention reminder: _D for Diffuse, _N for Normal, _M for Mask.
  2. Import to appropriate Textures sub folder in Unreal.
  3. For the Mask, edit the imported Texture → Compression → Compression Settings → Masks (no sRGB). Ensure that Texture → sRGB is disabled.
  4. Edit MI_ → Details → Parameter Groups → Texture Parameters → enable Diffuse, Mask, Normal → assign textures.
  5. Edit SM_ → Details → Material Slots → assign material.

This pipeline now allows for external texture editing and a simple re-import to change the finished look of meshes.

Set Dressing

Place all of the 0,0,0 objects, then work from large to small. Don't be afraid to slightly angle, scale, and offset objects. Make the space look lived in, used. Even at the alpha stage, there's still a ton of room to experiment and add environmental storytelling.

Lighting

Use a color swatch to drive lighting and mood. Use it to color pick lighting tones. Creating a light-proof "shell" around single-sided meshes will help reduce or eliminate light leak.

Stack Emmisive material, Point and Spot lights to layer and create more realistic lighting.

Lights have various parameters in their Details panel:

Lightmaps

Post Process Volumes


Blueprint to C++

Key Notes

Overview

Blueprint Strengths

C++ Strengths

Creating C++ Base Classes

Process

  1. Check parent class type: Open target Blueprint → Class Settings → Details → Class Options → Parent Class.
  2. File → New C++ Class… → of matching type. Use unprefixed matching name.
  3. Check .cpp and .h files in Visual Studio. For Scene Component, the UCLASS in the .h may require Blueprintable.
  4. Build project in VS.
  5. Change parent class type to newly-created cpp.

Lifecycle Methods

Actors vs. Components

Actors Components
Can be placed in levels
Can have components
Modularity Low High
Inheritance
Default variable values
Maintainability Low High
Composable

UPROPERTY: Exposing Variables

Migrating variables from Blueprint to C++ while maintaining Blueprint functionality.

  1. Add a protected method inside the .h class.
  2. Add preprocessor directive UPROPERTY(AccessType, BlueprintReadType) to annotate the variables. This exposes the variable to Blueprint.

UPROPERTY Access Types

Defaults Instance Blueprint
RO VisibleAnywhere BlueprintReadOnly
VisibleDefaultsOnly VisibleInstanceOnly
RW EditAnywhere BlueprintReadWrite
EditDefaultsOnly EditInstanceOnly
  1. Add variable(s) formatted as C++ standard: type VariableName = value.
  2. Build in Visual Studio.
  3. Compile in Unreal Engine.
  4. Replace any existing references to the old Blueprint variables (these will have the _0 suffix, search by selecting and Alt+Shift+F) with the new C++ variable, then delete the _0 Blueprint variable.

BlueprintCallable UFUNCTION

Exposing C++ functions to be called from Blueprint.

Mapping Blueprint to C++ Types

Blueprint C++
Float float
- double
Integer int32
- uint32
Integer64 int64
- uint64
Bool bool
String FString
Name FName
Vector FVector
Rotator FRotator
Transform FTransform
Object UObject*
Actor AActor*
ActorComponent UActorComponent*

Basic Steps for Pure Function

  1. Open target .h file.
  2. Write UFUNCTION(BlueprintCallable, BlueprintPute) under BeginPlay() call.
  3. Follow with CPPType FucntionName() const;
  4. Hover over function name until tool appears, then Copy signature to clipboard.
  5. Open .cpp file (Ctrl+K, Ctrl+O).
  6. Paste below TickComponent.
  7. Translate the Blueprint script into C++ code.
  8. Build and compile.
  9. Delete the now-legacy Blueprint function.

Tracing Unreal Engine C++ API Names

  1. Hover over Blueprint Node in question, look for "Target is..."
  2. Ctrl+, in Visual Studio and enter target name +.h for header lookup (eg SceneComponent.h).
  3. Ctrl+F Node name in header file (eg GetWorldLocation).
  4. F12 on Unreal function call to find return value (eg K2_GetComponentLocation() returns GetComponentLocation()).

Common Includes

Class #include
Uworld Engine/World.h
AActor GameFramework/Actor.h
UActorComponent Components/ActorComponent.h
UGameplayStatics Kismet/GameplayStatics.h
UKismetSystemLibrary Kismet/KismetSystemLibrary.h
FMath Math/UnrealMathUtility.h

BlueprintImplementableEvent

It is possible to call Blueprint from C++. In the header file, create the following:

UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void EventName(AActor* Actor);

BlueprintNativeEvent

In the header:

UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
returnType EventName(OutComponent*& OCType, etc)

In the .cpp:

returnType UType::EventName_Implementation(OutComponent*& OCType, etc)
{
return false;
}


2015 Legacy Notes

Shorthand Legend

Editor Navigation

Console Commands

Asset Naming Conventions

FBX Import

Fracture Mesh

Blueprint Notes (Bolded = Node Names)

Blueprint: Overview

Blueprint: Advanced

Blueprint Communication

Blueprint Input

Blueprint Mouse Interaction

Blueprint HUD

Blueprint Splines

Blueprint Networking

Landscapes

Matinee

Paper2D

Notes from Video Series

Materials

Sprites

Flipbooks

Blueprints

Macros

Physics

Destructibles

Material Nodes

Decals

Lighting

Post Processing

Particle Systems (Deprecated by Niagara?)

Pivot Painter

Cloth

Dynamic Scene Shadows

Reflections

Audio

Static Meshes

Geometry Editing

Navmesh

Math Hall

Level Streaming

Media Framework

Physics-Based Animation

Subsurface Profile Shading Model

Multiplayer Shootout Demo (Gerleve & Noon)

Livestream Mar 12

UMG Unreal Motion Graphics (UI)

Engine Feature Samples

Features Tour 2014

Matinee

Landscape Mountains

Water Planes

Realistic Rendering

Elemental Demo

Reflections

Procedural Generation

Packaging and Cooking Games

Packaging Projects

Launching to Devices

Content Cooking

Unreal Frontend

Livestream March 17: Building a Tank

Video Series - Endless Runner

  • F8 - jump out of the character control while the game is running.
  • Rotating Movement: component that can be added to Actors for easy simple automated rotation.
  • Random Point in Bounding Box: returns a random point in a specified bounding box. Useful for spawning things inside a defined Box Collision.
  • Move Components in Child BP: now possible in 4.7x
  • Split Hit Struct Pin: opens a universe of options.
  • Livestream March 24: Foliage

  • Procedural foliage generation based on seeding/biomes.
  • Auto-spawn grass on landscape.
  • ProceduralFoliageSpawner:
    • Types: define. Random Seed, Tile Size.
    • Drag & drop into scene, adjust Brush Settings sizes.
    • Procedural Foliage → Simulate.
  • New Procedural Foliage: ProceduralFoliageSpawner.
  • New Type: FoliageType_InstancedStaticMesh.
      • Procedural: Clustering is the meat of the appearance results.
        • Steps: Initial Seed Density is 10x10 meters.
        • Num Steps 0 = 1 tree by 1 seed.
        • Seeds per step = Exponent.
        • Distribution seed controls clustering shape.
        • Increasing Average Spread Distance can create denser clusters.
    • Spawns based on Collision Radius (trunk of tree) and Shade Radius (canopy radius of tree).
      • Growth: Trees shouldn't Grow in Shade. Other actors can have this enabled to populate around tree bases.
      • Older trees tend toward Max Scale. Scaling within Growth controls overall size distribution of trees.
      • Overlap Priority: if there are 2 different seeds competing for the same position, whichever is higher wins.
  • Video Series: 3rd Person Game With Blueprints

    Video Series: Introduction to Materials

    Setting Up Unreal Engine Repository With Sourcetree, git, & GitHub on Windows 8.1

    1. Set Up Git.
    2. Set Up SourceTree.
    3. Open SourceTree & Clone/New → Create New Repository → Repository Type: Git, Destination Path: your Unreal project folder, Name: as you like, Folder: [Root] → Create.
    4. Select files to commit from Unstaged files. It may be easier to visualize/select from Tree view mode.
    5. If you're just sharing the bare bones, you'll need to commit the Content folder & the .uproject file. You won't need anything from Config, Intermediate, or Saved.
    6. Click the main Commit button (next to Clone/New in the top left), make a detailed comment about the contents, then click the Commit button in the lower right of the comment window.
    7. Create a Repository on your GitHub.
    8. GitHub will supply a list of commands you need to execute on your local machine. Copy the 1st, which should start: git remote add origin URL
    9. In SourceTree, click the Terminal icon (top right).
    10. Right-click on the Terminal window & Edit → Paste, then press enter. You'll be prompted to enter your GitHub security credentials; do so.
    11. Repeat for the 2nd command, git push -u origin --all
    12. I'm not sure if this command is necessary, GitHub doesn't supply it but the guy in the video did it, & I did it without error, so go ahead & enter this too: git push -u origin --tags
    13. At this point the repository should be mirrored on GitHub, click through your account to confirm.
    14. Changes made to existing content will show up with a yellow "..." icon & number under the repository name in SourceTree. These files can then be selected in the Unstaged files section, moving them into the Staged files section.
    15. Click the main Commit button, enter a detailed comment, enable Push changes immediately to origin/master, click the Commit button in the lower right of the content window, enter security credentials, & you're off to the races.

    Creating Basic UMG UI

    Livestream April 22: Audio and Blueprints

    Easy Dynamic Audio

    1. Split tracks and export .WAV from DAW.
    2. Import into Unreal.
    3. Construct Cue with Looping Wave Player nodes for each track.
    4. Wire each LWP node to Continuous Modulator, assigning Volume Modulation Parameter names for each.
    5. Wire all into Mixer node, then to Output.

    Home