Skip to content

Quest system for games

Quests a designer adds without code. A quest counts metrics the game reports (play, win, spend-gold), completes when all its objectives are reached and gives a reward the player claims, or that claims itself. Quests may repeat every day, week or month, open for a window, and follow one another. Requires Inventory.

await rudder.quests.submit({ metric: 'play', amount: 1 });

Engagement → Metrics. What quests count.

FieldMeaning
key, name, descriptionThe metric.
clientWhether the game client reports it. Otherwise only the game server does.

Engagement → Quests.

FieldMeaning
key, name, description, imageThe quest.
groupThe tab the client shows it in, such as daily, story or event.
objectivesEach a metric and an amount. The quest is completed when every objective is.
currencies, itemsThe reward, as in an offer of a store.
autoClaimThe reward is given as soon as the quest is completed.
windowWhen the quest is offered.
periodnever, day, week or month: how often it starts again, from the day start of the project.
afterA quest the player must have claimed before this one is offered.

A quest counts only while it is offered: inside its window, after its after is claimed, and until it is completed in its period, each objective up to its amount. Progress and claims are counted in every period at once, like the purchases of an offer.

FunctionKindCallerArgumentsResult
questsqueryclientnoneThe quests offered now, each with its status and objectives
submitmutationclient{metric, amount}{completed}: the quests this progress completed
claimmutationclient{quest}The quest with its status
reportmutationserver, other modules{metric, amount}{completed}
completemutationserver{quest}The quest with its status
resetmutationserver{quest}The quest with its status
  • quests returns each quest offered now with its key, name, description, image, group, period and reward, its status (active, completed or claimed), objectives (each with the metric, its name, done in this period and of, the amount, in the order of the objectives), resetsAt (when it starts again, null for never) and endsAt (the end of its window, null for none). claim, complete and reset answer one quest in the same shape.
  • submit reports progress of the player on a metric with client; a metric without it answers server_only. report takes any metric, from the game server or from another module (a purchase that counts toward a quest is your module calling quests.report).
  • claim grants the reward of a completed quest. A reward item that does not fit the inventory refuses the whole claim.
  • complete and reset are for operators on the player card: bring the objectives of a quest to their amounts, or take back its progress and claims in every period.

A quest with autoClaim claims itself shortly after it is completed. If its reward does not fit the inventory, it is tried again later; the quest stays completed and the player may claim it meanwhile.

CodeWhen
unknown_quest, unknown_metricNo such quest or metric.
server_onlyThe client reported a metric without client.
invalid_amountThe amount of progress is not positive.
not_offeredThe quest is not offered to the player now.
not_completedThe objectives are not completed yet.
already_claimedThe player claimed the quest in this period.
stack_full, unknown_itemA reward item does not fit the inventory.
EventPayloadWhen
completed{quest, group}For each quest a progress completed.
claimed{quest, group}When a quest is claimed.
  • Engagement → Quests as cards, and Engagement → Metrics.
  • Engagement → Calendar: quest windows and the starts of their periods.
  • Player card, Overview: the quests of the player with their status, when they start again and a progress bar per objective, and Report, Complete and Reset on each quest.
  • No segments, no random rotation or reroll, no deadline per player. A module of your game with a timer does those.
  • after names one quest, not several. A cycle of after hides its quests and is not shown as a problem of the catalog.