Unreal Engine Quickstart
This plugin behaves as an Analytics Provider for Unreal Engine 5. It enables you to track in-game events using Treasure Data. Common use cases for this plugin are to track things like currency buys, item trades, and game progression
Prerequisites
- The Unreal Engine (5.3.0) has been compiled from the current source with all dependencies so third party plugins can build.
- The Unreal Engine has been installed on your machine.
- Blueprints plugin is in place and enabled
- Treasure data plugin is in place and enabled
- You have a Treasure Data Write-Only API Key
Warning
Treasure Data strongly recommends that you use a write-only API key for ingest and import operations and whenever using Treasure Data SDKs
Click here to see how to get a write-only API Key.
- Login to the Treasure Data Console and go to the API Key page .
- If you dont already have a write-only API key, then create one. From the top right, select Actions > Create API Key .
- Name the new API Key.
- From the Type drop-down menu, select Write-only .
- Select Save .
- Copy your new Write-Only API Key and use it authenticate the APIs in your project.
Setup
Setting Up Unreal Engine
- Sign up for an Unreal Engine account in order to access the GitHub repository for Unreal Engine 5.
- On the Unreal Engine website, use the Personal > Apps and Accounts page to connect your Unreal Account to GitHub.
- Clone the unreal repository from GitHub to your local machine.
- Compile the Unreal Engine with all dependencies.
Downloading and Placing the Plugin
To get a copy of the plugin from the main GIT repository:
-
Download the TD UE4 plugin from GitHub:
git clone https://github.com/treasure-data/td-ue4-sdk
-
Checkout the branch that matches your Unreal Engine version (UE-5.3):
git checkout UE-5.3
-
Copy the new
td-ue4-sdk
to your Unreal Engine plugins folder. The target path looks something like this:UnrealEngine/Engine/Plugins/td-ue4-sdk
Info
Alternatively, you can copy the plugin content inside your Project Plugin directory. However, this approach does not work in a Linux Development environment.
Building the Plugin
Build the td-ue4-sdk
plugin
Enabling the Analytics Plugins for Your Project
- In the Unreal Engine 5 Editor, select Edit > Plugins .
- Open your project and the plugins window.
-
Enable the two required plugins:
-
Blueprints: located at Built-in > Analytics
-
Treasure Data: located at Installed > Analytics
-
Blueprints: located at Built-in > Analytics
Configuring Project Settings
From your project directory, open and edit the Config/DefaultEngine.ini
file and append the following content at bottom:
[Analytics]
ProviderModuleName=TreasureData
TDApiKey=TD-WRITE-ONLY-KEY
TDDatabase=DATABASE_NAME
TDRegion=[US01,AP01,AP02,AP03,EU01]
SendInterval=10
[AnalyticsDevelopment]
ProviderModuleName=TreasureData
TDApiKey=TD-WRITE-ONLY-KEY
TDDatabase=DATABASE_NAME
TDRegion=[US01,AP01,AP02,AP03,EU01]
SendInterval=10
[AnalyticsTest]
ProviderModuleName=TreasureData
TDApiKey=TD-WRITE-ONLY-KEY
TDDatabase=DATABASE_NAME
TDRegion=[US01,AP01,AP02,AP03,EU01]
SendInterval=10
Info
The combined length of database name and table name must be shorter than 129 chars).
After making your changes, save the file and restart the Unreal Engine editor.
Gathering Metrics with Blueprints
- In the Editor, select Blueprints > Open Level Blueprint .
In the Event graphs window, different events can now be connected to Analytics functions, as an example the following image demonstrate how to track the Session Start
, Session End
, and Record Event w/Attributes
events:
After a Game starts, the plugin will send the events to Treasure Data.
Viewing data on Treasure Data
To query game events:
- From the Treasure Data Console , select Databases from the workbench and then open the database used in the game: Config/DefaultEngine.ini > TDDatabase .
By default two tables are created:
- Sessions: start and stop sessions
- Events: All events with or without attributes.
To query records, select a table name, and then select the Query button at the top of the screen. By default you can issue SQL queries similar to this:
SELECT * from events;