# 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.23 - 4.27, 5.0 - 5.1
  • Windows, Android, iOS, Mac

# Prerequisites

Before getting started you must create a Developer Account (opens new window) and a Game (opens new window) on the Frameplay Platform.

# Getting Started

# Download and Install the Frameplay Plugin

  1. Download and unzip the latest version of the Frameplay Unreal Engine plugin from the downloads page (opens new window)
  2. Go to your Project's Plugins folder [Project Root] > Plugins
  3. Copy the Frameplay folder into the Plugins folder

See the Unreal Engine manual (opens new window) for more information on Plugins

# Reload Your Project

  1. Code projects will need to regenerate the Visual Studio Project Files (opens new window) Image
  2. Open your Unreal Project and enable the Frameplay plugin (opens new window) from the Plugins Window. Image

# Configure Project Name and Version

  1. Confirm your Project Name and Version have been setup under Edit > Project Settings menu
  2. Select Project > Description and enter your Project Name and current Project Version

Image

# Configure the Frameplay Developer Settings

The Frameplay Developer Settings are stored in a Data Asset and is used to maintain the link between your project and the Developer Dashboard.

  1. Under the Frameplay menu icon located on the Main Toolbar in the Unreal Editor, select Developer Settings

Image

  1. Enter the Developer API Key and Game ID with the corresponding values found on your Game Page (opens new window)

Image

See the FAQ See the Unreal Engine manual (opens new window) for more information on Data Assets.

# Initialize the Frameplay SDK

  1. Initialize the Frameplay SDK by calling UFrameplayFunctionLibrary::Start_Session(). This starts a Session and creates a secure runtime connection to the Frameplay server
  2. Configure the player parameter with the current player details. (If available, the players Age and Gender should be passed as parameters. These can be sourced from a client API or a custom login)
  3. Set the Allow Data Collection player parameter. This corresponds to the respective platform signal Limit Ad Tracking

# Blueprint Example

Image

The Frameplay Session requires knowledge of the active Camera to use for measuring viewability. More information on Registered Cameras

# Code Example

# .h
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Frameplay/frameplay_wrapper.h"
#include "AExampleInit.generated.h"

UCLASS()
class UNREALPROJECT_API AAExampleInit : public AActor
{
	GENERATED_BODY()

public:
	// Sets default values for this actor's properties
	AAExampleInit();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;

};
# .cpp
#include "AExampleInit.h"
#include "FrameplayFunctionLibrary.h"

// Sets default values
AAExampleInit::AAExampleInit()
{
 	// 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 AAExampleInit::BeginPlay()
{
	Super::BeginPlay();

	//Capture player data
	const FPlayer_Data Player{UData_Collection::allow, 20, EFrameplayGender::unknown, "en", "newPlayer"};

	//Start SDK
	UFrameplayFunctionLibrary::Start_Session(Player);
}

void AAExampleInit::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
	Super::EndPlay(EndPlayReason);
	UFrameplayFunctionLibrary::Shutdown_Session();
}
# .Build.cs

Reference the Frameplay module in your project.


using UnrealBuildTool;

public class UnrealProject : ModuleRules
{
	public UnrealProject(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Frameplay" });

		PrivateDependencyModuleNames.AddRange(new string[] {  });
	}
}

More information on the Frameplay Session & Cameras.

More information on the Frameplay API.

# Create an Ad Space

An Ad Space is an Actor that displays intrinsic advertisements to the player. They can be created through the editor Place Actor menu or in a Blueprint.

  1. Using the Place Actors Mode, drag and drop a Frameplay Ad Space Actor into the Viewport
  2. Position the Ad Space to best fit your environment

Image

# Configure an Ad Space

  1. Select the Ad Space in the World Outliner to view the Ad Space Configuration located in the Details panel
  2. Enter a unique name for the Ad Space
  3. Set the image ratio to one of the preset aspect ratios to best fit your environment
  4. (Optional) Select Synchronize Ad Space and enter a Channel Name to begin creating a Group of Synchonized Ad Spaces that render the same image

Image

# Load a Mock Advertisement

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

Image

Congratulations! You have created your first intrinsic advertisement.

# View Impression Data

Sessions started in-editor and in development builds will automatically run in Test Mode and mock advertisements will be used.

Impression data gathered in Test Mode will display on the Test Dashboard (opens new window) and will not yet generate revenue.

# Packaging Builds

  1. When packaging a shipping version of your project, select File > Package Project > Build Configuration and toggle Shipping mode
  2. Submit your account and game for approval on the Frameplay Platform:

Please allow 48 hours for approval. Advertisements will not load in Production builds until both your account and game is approved.

At this time our integration team will contact you. Once approved, your Ad Spaces in your production build will load advertisements, earn revenue and analytics will be recorded on the Live Dashboard (opens new window).

# Best Practices

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

# Troubleshooting

If something went wrong during setup, check console logs for details and visit our FAQ page.

Last Updated: 1/5/2023, 10:46:42 PM