# Unreal Engine Quick Start

This guide will show you how to integrate the Frameplay plugin into your Unreal Engine project.

We officially support:

  • Unreal Engine 4.25
  • PC platforms

# Prerequisites

# Getting Started

# Download and Install the Frameplay Plugin

Download and unzip the latest version of the Frameplay Unreal Engine plugin from the downloads page

Plugins can be installed either in your project, or in the Engine itself.

# Install to Project

  1. Go to your project folder which contains the file [ProjectName].uproject
  2. Create a folder called Plugins
  3. Copy the Frameplay folder into the Plugins folder

# Install to engine

  1. Go to the Unreal Engine Plugins folder ~Epic Games > UE_4.xx > Engine > Plugins
  2. Copy the Frameplay folder into the Plugins folder

Installing the plugin to engine is required for running your project in the DebugGame configuration.

See the Unreal Engine manual for more information on Plugins.

# Reload Your Project

Our plugin is pre-compiled with the source code removed. This requires the BuildId to match your own.

Your BuildId can be found in an existing modules file. For example: ~Epic Games\UE_4.xx\Engine\Binaries\Win64\UE4Editor.modules

Update the BuildId property in the file Frameplay > Binaries > Win64 > UE4Editor.modules to match this.

If you require an open source version of the plugin, please email support@frameplay.gg.

# Setup the Frameplay Data Asset

The Frameplay Data Asset is an asset used to maintain the link between your project and the Developer Dashboard.

  1. Create a new Frameplay Data Asset using the Content Browser. Add new < Frameplay < Data Asset

Image

  1. Open the new Data Asset file and set the Developer API Key and Game ID with the corresponding values found on your Game Page

Image

3. Under Project Settings navigate to Plugins > Frameplay and select the newly created Data Asset.

Image

See the Unreal Engine manual for more information on Data Assets.

# Initialize the Frameplay SDK

Before loading Ads, have your project initialize the Frameplay SDK by calling Frameplay.StartSession() and register a Camera Component or Camera Manager. This only needs to be done once, ideally at launch.

The Frameplay Session requires knowledge of the active Camera to use for gathering metrics and triggering advertisements colliders. More information on Registered Cameras

# Blueprint Example

  1. Open the Level Blueprint by clicking the Blueprints button in the Level Editor Toolbar and select Open Level Blueprint.

To search for nodes right click and begin typing

  1. Setup the flow to start a Frameplay Session on Begin Play, and register a Camera Manager

  2. Under the Start Session node, select the newly created Frameplay Data Asset

Image

# C++ Example

#include "TestActor.h"
#include "FrameplayManager.h"
#include "Kismet/GameplayStatics.h"

// Sets default values
ATestActor::ATestActor()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

}

// Called when the game starts or when spawned
void ATestActor::BeginPlay()
{
	Super::BeginPlay();

	UFrameplayManager::StartSession(this, FPDataAsset, -1, FPlayerSex::Unknown, "newPlayer,", "en");

	auto cam = UGameplayStatics::GetPlayerCameraManager(this, 0);

	UFrameplayManager::RegisterCameraManager(cam);
}

The Frameplay SDK is now included in your project and will be initialized at run-time. You're now ready to implement an Ad Space.

More information on the Frameplay API.

More information on the Frameplay Session & Cameras.

See the Unreal Engine manual for information on Blueprints C++ and Cameras.

# Create an Ad Space

A Frameplay Ad Space is an Actor that displays targeted intrinsic advertisements to the player. There is a limit of 20 concurrent active Ad Spaces at runtime.

# In World

Under the Modes panel and Place tab, drag and drop a Frameplay Ad Space Actor into the Viewport.

The new unregistered Ad Space will display red debug text.

Image

Creating a new Ad Space automatically generates a new Activation Collider. This is used at runtime, if your registered camera overlaps this collider the Ad Space will activate and request an advertisement.

# Blueprint

Create a new Ad Space Blueprint class using the Content Browser. Add new < Frameplay < Ad Space Blueprint

If the Blueprint will be loaded at runtime with multiple concurrent instances, set ActorInstanceType to Multiple.

Image

See Unreal Engine manual for more information on Actors.

More information on Frameplay Activation Colliders.

# Register an Ad Space

For an Ad Space to request and display advertisements, it needs to first be registered.

  1. Select the Ad Space in the World Outliner and click the Register Ad Space button in the Details panel.

  2. Enter a description so the Ad Space is easily identifiable.

  3. Pick your preferred ratio then position and scale the Ad Space in your world to your liking.

  4. Click the Register Ad Space button.

The debug text will change from red to white as the Ad Space is now registered and linked to the Frameplay servers. When activated it will download mock advertisements.

Once an Ad Space has been registered, it cannot be unregistered. It can however be modified by using the Replace Ad Space button inside the Inspector window. Previous versions of a modified Ad Space will remain on the Frameplay dashboard. This ensures Ad Spaces from previous build versions will receive metrics and generate revenue.

Ad Spaces cannot be registered at runtime.

# Load a Mock Advertisement

Enter Play In Editor Mode and upon activation the Ad Space will request, download and display a mock advertisement.

Ad Spaces will activate either on spawn or if an Activation Trigger is used, on collision with the registered camera. More information on Ad Space Activation

Image

Congratulations! You have created your first intrinsic advertisement.

# Packaging Builds

# DebugGame & Development Builds

When playing in Editor, DebugGame and Development Build configurations, mock advertisements will be loaded at runtime.

To create a build select File > Package Project > Build Configuration and toggle DebugGame or Development while in development.

Image

# Release Build

Before monetizing your release build, you must first submit your account and game for approval on the Frameplay Platform:

The current wait time for game approval is 48 hours. No advertisements will load in non-development builds until both your account and game is approved.

When you are ready to package a production version of your project, set Test Mode off, in the Frameplay Data Asset. Ad Spaces will now request and load real revenue raising advertisements.

Image

See the Unreal Engine manual for more information on Packaging Builds.

# Best Practices

We highly recommend you check out the Best Practices Guide to maximize revenue, impression quality and user experience!

Last Updated: 10/6/2020, 11:57:51 PM