# Sessions & Cameras
When the Frameplay SDK is initialized a Session & runtime connection to our servers is created. This Session is used for reporting on the Frameplay Dashboard (opens new window)
# Starting a Session
Initialize the Frameplay SDK to create a Session & runtime connection to our servers. This only needs to be called once before gameplay begins and is required for ads to load. Click here for more on Ad Spaces
Do this by making a call to the frameplay::initialize
method with the following parameters:
- Set the
gameId
to your Game ID value found in the Frameplay Dashboard Game Page (opens new window) This ensures your project is linked to your Game, on our Dashboard - Set the
frameplay::sdk_mode
parameter to test during development. This ensures you load mock ads. Analytics will be gathered on your Test Dashboard (opens new window) - Set the
global_texture_quality
parameter to control the ad download texture quality. - Configure the
player
parameter with the current player details.
#include "frameplay.h"
// Create the configuration objects
const frameplay::settings settings{
"my_game_id",
frameplay::sdk_mode::test,
frameplay::global_texture_quality::medium
};
const frameplay::player player(frameplay::data_collection::allow);
// Start the Frameplay SDK
frameplay::frameplay::initialize(settings, player);
See below for more details on what each session parameter does! Also, code examples can be found in our demo scene: Frameplay\FrameplayExampleScene.h
# Session Parameters
# Game ID
The Game ID value is found in the Frameplay Dashboard, on your Game Page (opens new window) This ensures your project is linked to your Game on our Dashboard.
# SDK Mode
The SDK Mode
parameter determines the environment: test
or release
.
During development ensure sessions are run with the frameplay::sdk_mode::test
value. This will load mock ads in your Session and analytics will be gathered on your Test Dashboard (opens new window).
When publishing a production build, set the frameplay::sdk_mode::release
parameter. This will ensure your Ad Spaces request real advertisements and analytics will be recorded on your Production Dashboard.
# Global Texture Quality
The Global texture quality
determines the advertisement texture size. Set to either quarter
, half
or original
.
All advertisement images will be under 2MB when downloaded at runtime. (Actual texture memory usage (VRAM) being higher.)
This global configuration - combined with the Ad Space quality setting - controls the downloaded advertisement file sizes and maximum resolution parameter to control the ad download texture quality.
# Player
The player Age
, Gender
and Gamer Tag
can be optionally sourced from a client API or a custom login. This data allows for targeted advertisements.
The Allow Data Collection
parameter corresponds to the "Limit Ad Tracking" signal (e.g. iOS, Android). False
- User has not opted-in tracking is limited per commercial guidelines, or True
- User has opted-in tracking is unrestricted.
# Camera
The Frameplay Session uses a Camera for gathering metrics. Only one Camera Object can be registered at a time.
By default, the Session will use the Scene's default camera, or the camera provided in the frameplay::initialize
method call.
Cameras can be registered and unregistered when required with the frameplay::set_camera
function.