Get started2 / 12

Core concepts

Stacked is built from a few ideas. Offers, live ops events and leaderboards are the same loop seen three ways, so once these are clear, each feature is a short read.

The loop

  1. Your game sends events as players play.
  2. Each event updates what Stacked knows about the player, and counts toward whatever is listening: an offer's progress, a milestone track, a leaderboard.
  3. Your game asks Stacked what to show a player.
  4. The player claims what they have earned.
  5. Stacked tells your backend with a reward webhook, and your backend grants it.

Your game reports and grants. Stacked decides and keeps count. Nothing in your game's code names a specific offer, so you can change what runs from the dashboard at any time.

Game, Test and Live

A game is one organization in the dashboard, with its own team and roles.

Every game has two environments, switched at the top of the dashboard:

TestLive
ForBuilding and trying things outReal players
CredentialsIts own client id and API keyIts own client id and API key
DataIts own players, offers, events and leaderboardsIts own
WebhooksIts own endpoints and secretsIts own

Nothing moves from Test to Live by itself. See environments for the URLs.

Players

A player is whoever your game says it is. You choose the id (up to 250 characters), and Stacked creates the player the first time it sees that id.

What Stacked knows about a player is their snapshot. Your events keep it current, and conditions read it.

Part of the snapshotKept current by
Username, sign-up datesignIn, signUp
Days in game, login streaksignIn
LevelslevelUp
Currency balancesearnCurrency, spendCurrency
Dynamic fields: values of your ownsetField, incField
TagsaddTags, removeTags, or the dashboard
Trust scoretrustScore, or the dashboard
Achievements, quests, membershipsTheir own events
Country and networkThe address the player's game client calls from
Entity kind and linksplayerSnapshot, linkUser

Entities and links. A "player" does not have to be a person. It can be a pet, a guild or a character: give its snapshot an entity kind. Entities can be linked, a pet to its owners, a member to a guild. Links are what let an offer be shared by a team, let a milestone track count by group, and let a signed-in player act for an entity linked to them (targetId on the API).

Events

An event says one thing happened: a sign-in, a purchase, a level gained, a value of your own changed. Your backend sends events with a server SDK.

Two kinds of event are worth knowing by name, because you define them yourself:

  • A dynamic field is a named value on a player, such as boss_kills. Conditions and scoring rules can read it and count changes to it.
  • A context is a named moment, such as enter_arena. Calling it can surface offers on the spot.

Events lists them all.

Conditions

A condition is a test on a player. The same tests are used everywhere a feature needs to pick players:

Used asAnswers
A surfacing condition on an offerWho gets this offer?
A completion condition on an offerHas the player done it?
A bucket of a sharded leaderboardWhich shard does this player belong in?
A reward rule, a spend limit, a prize boostWhich players does this apply to?

Offers has the full list.

Scoring rules

A scoring rule turns an event into points: "1 point per gold coin spent", "50 points for each boss kill, once a day". Live ops milestone tracks and leaderboards both score with them. See Scoring rules.

Rewards and claims

A reward is what a player gets: an item, currency, experience. Rewards are claimed, by the player in your game or by your backend for them.

Stacked never changes anything inside your game. A claim makes Stacked send a signed reward webhook to your backend with the player and the rewards, and your backend does the granting.

The three features

OffersLive OpsLeaderboards
What a player seesTasks with rewardsA timed event: milestones, dailies, event offersA ranking, and their own place in it
Who gets itPlayers who meet the surfacing conditionsEveryone, or players who reach a contextEveryone, optionally split into shards
Progress comes fromCompletion conditionsScoring rules, and showing up each dayScoring rules
Paid whenThe player claimsThe player claims a milestone or a dailyYou generate rewards after it ends

Words used in these docs

WordMeaning
SurfaceTo give an offer or an event to a player. Before that, the player does not have it
InstanceOne player's copy of an offer, with its own progress, status and instanceId
SnapshotWhat Stacked knows about a player
Dynamic fieldA named value of your own on a player
ContextA named moment in your game
TrackA line of milestones in a live ops event, with its own points
ThresholdA point value on a track that unlocks rewards
ShardA group of players who compete on their own copy of a leaderboard
ClaimThe call that turns earned rewards into a reward webhook