Steamworks Documentation
ISteamTimeline
Functions that allow the game to add events to the timeline that is displayed alongside recorded video.

See Steam Timelines and diagram at the bottom of page for more information.

Member Functions


Member functions for ISteamTimeline are called through the global accessor function SteamTimeline.

SetTimelineStateDescription

void SetTimelineStateDescription( const char *pchDescription, float flTimeDelta );
NameTypeDescription
pchDescriptionconst char *A localized string in the language returned by SteamUtils()->GetSteamUILanguage()
flTimeDeltafloatThe time offset in seconds to apply to this state change. Negative times indicate an
event that happened in the past.

Sets a description (B) for the current game state in the timeline. These help the user to find specific
moments in the timeline when saving clips. Setting a new state description replaces any previous
description.

Examples could include:
  • Where the user is in the world in a single player game
  • Which round is happening in a multiplayer game
  • The current score for a sports game

ClearTimelineStateDescription

void ClearTimelineStateDescription( float flTimeDelta );
NameTypeDescription
flTimeDeltafloatThe time offset in seconds to apply to this state change. Negative times indicate an
event that happened in the past.

Clears the previous set game state in the timeline.

AddTimelineEvent

void AddTimelineEvent( const char *pchIcon, const char *pchTitle, const char *pchDescription, uint32 unPriority, float flStartOffsetSeconds, float flDurationSeconds, ETimelineEventClipPriority ePossibleClip ) ;
NameTypeDescription
pchIconconst char *The name of the icon to show at the timeline at this point. This can be one of the icons uploaded through the Steamworks partner Site for your title, or one of the provided icons that start with steam_. The Steam Timelines overview includes a list of available icons.
pchTitleconst char *Title-provided localized string in the language returned by SteamUtils()->GetSteamUILanguage().
pchDescriptionconst char *Title-provided localized string in the language returned by SteamUtils()->GetSteamUILanguage().
unPriorityuint32Provide the priority to use when the UI is deciding which icons to display in crowded parts of the timeline. Events with larger priority values will be displayed more prominently than events with smaller priority values. This value must be between 0 and k_unMaxTimelinePriority.
flStartOffsetSecondsfloatThe time offset in seconds to apply to the start of the event. Negative times indicate an
event that happened in the past.

One use of this parameter is to handle events whose significance is not clear until after the fact. For instance if the player starts a damage over time effect on another player, which kills them 3.5 seconds later, the game could pass -3.5 as the start offset and cause the event to appear in the timeline where the effect started.
flDurationSecondsfloatThe duration of the event, in seconds. Pass 0 for instantaneous events.
ePossibleClip ETimelineEventClipPriorityAllows the game to describe events that should be suggested to the user as possible video clips.

Use this to mark an event (A) on the Timeline. The event can be instantaneous or take some amount of time to complete, depending on the value passed in flDurationSeconds.

Examples could include:
  • a boss battle
  • a cut scene
  • a large team fight
  • picking up a new weapon or ammo
  • scoring a goal

The game can nominate an event as being suitable for a clip by passing k_ETimelineEventClipPriority_Standard or k_ETimelineEventClipPriority_Featured to ePossibleClip. Players can make clips of their own at any point, but this lets the game suggest some options to Steam to make that process easier for players.

SetTimelineGameMode

void SetTimelineGameMode( ETimelineGameMode eMode );
NameTypeDescription
eModeETimelineGameModeThe mode that the game is in.

Changes the color of the timeline bar (C). See ETimelineGameMode for how to use each value.

Enums

These are enums which are defined for use with ISteamTimeline.

ETimelineGameMode

Controls the color of the timeline bar segments. The value names listed here map to a multiplayer game, where
the user starts a game (in menus), then joins a multiplayer session that first has a character selection lobby
then finally the multiplayer session starts. However, you can also map these values to any type of game. In a single
player game where you visit towns & dungeons, you could set k_ETimelineGameMode_Menus when the player is in a town
buying items, k_ETimelineGameMode_Staging for when a dungeon is loading and k_ETimelineGameMode_Playing for when
inside the dungeon fighting monsters.

NameValueDescription
k_ETimelineGameMode_Playing1The player is fully loaded into the game and playing.
k_ETimelineGameMode_Staging2The player is in a multiplayer lobby.
k_ETimelineGameMode_Menus3The player is in the game's main menu or a pause menu.
k_ETimelineGameMode_LoadingScreen4The player is waiting for a loading screen.

ETimelineEventClipPriority


Used in AddTimelineEvent, where Featured events will be offered before Standard events.

NameValueDescription
k_ETimelineEventClipPriority_None1This event is not appropriate as a clip.
k_ETimelineEventClipPriority_Standard2The user may want to make a clip around this event.

Diagrams


timeline_diagram.png