+31 (0) 35 646 63 00 info@spilgames.com

Missions and Containers Feature

The Missions and Containers feature allows you the possibility to create a configuration that adds or tweaks missions which are present in your game via SLOT. This configuration is retrieved from SLOT by the Spil SDK and made available for the game to be used. Also, besides the configuration, the Mission feature allows for the saving of user mission progress that can also be synchronized across multiple devices using the existing Cross-Device implementation (link to Sync feature).

The mission feature is setup as flexible as possible to fit the needs for almost any kind of game. The Spil SDK provides all configurations needed to create a generic mission system including missions and chapters/episodes (through containers). It does however not control the state and progress of the missions and containers because those are very game specific. Instead, the Spil SDK provides methods to easily retrieve and save the state and progress by the game developer.

The Missions and Containers feature consists of four components:

  • Missions
  • Containers which represents a collection of missions
  • Mission Progress
  • Container Progress

Attributes

The Mission component has the following attributes:

Name Definition Controlled by the SDK Example
ContainerId The Id of the Container in which the Mission is located. No (the checking has to be done by the developer).  
MissionPrerequisites A list of MissionIds which point to Missions that need to be completed before the Mission can start. No. The player needs to complete “M1”, “M2” and “M3” before he can start this mission (“M4”).
MissionUnlocks A list of MissionIds which indicate what Missions will be unlocked once the Mission has been Completed. No (the payment for the activation cost needs to be done manually by the developer). Once “M4” has been completed, “M5” and “M6” are available.
GamePrerequisites A free-form Dictionary/JSON which allows game specific prerequisites to be defined. No (the objectives need to be checked by the developer). The player needs to have reached Level 5 and gained the Sword of Missions to unlock “M4”.
GameUnlocks A free-form Dictionary/JSON which allows the definition of unlocks that happen in the game once the Mission is Completed. Yes (if the developer calls the designated claim missions reward method). The player will be able to buy the Shield of Missions once the “M4” is completed.
ActivationCost A list of Currencies/Items that are required to be paid by the user in order to unlock the Mission. The value returned in the Type parameter of the MissionActivationCost can be CURRENCY, ITEM, GACHA. No (any value can be stored here). The player needs to pay 1000 coins to unlock “M4”.
Objectives A list of Objective objects which describes what needs to be accomplished by the user in order to Complete the Mission. No (the objectives need to be checked by the developer). The player needs to collect 10 flowers and 5 boar pelts in order to complete “M4”.
Rewards A list of rewards that will be given if the Mission is Completed. This is used mainly for display purposes as a dedicated method is provided which handles automatically the claiming of Mission Rewards (see below). Yes (if the developer calls the designated claim missions reward method). The player will receive 10 gems for completing “M4”.
Properties A free-form Dictionary/JSON which allows any additional properties of a Mission that is outside the defined attributes’ scope. No (any value can be stored here).

The location of the “M4” mission is in Mission Town.

The color of the “M4” mission marker is blue.

The Container component represents a collection of missions. You can picture Containers as for example Episodes or Chapters. The component has the following attributes:

Name Definition Controlled by the SDK Example
ContainerPrerequisites A list of ContainerIds which point to Containers that need to be completed before the Container can start (this check is not done automatically by the SDK). No (the checking needs to be done manually by the developer). The player needs to complete container “Chapter1” in order to start this container (“Chapter2”).
ContainerUnlocks A list of ContainerIds which indicate what Containers will be unlocked once the Container has been Completed. No (the next container will not be automatically unlocked). Once “Chapter2” has been completed, “Chapter3” and “Chapter4” are available.
Rewards A list of rewards that will be given if the Container is Completed. This is used mainly for display purposes as a dedicated method is provided which handles automatically the claiming of Containers Rewards (see below). Yes (if the developer calls the designated claim containers reward method). The player will receive 100 gems for completing “Chapter2”.
Properties A free-form Dictionary/JSON which allows any additional properties of a Container that is outside the defined attributes’ scope. No (any value can be stored here). The color of the “Chapter2” container description text is blue.

The Mission Progress component has the following attributes:

Name Definition Controlled by the SDK
MissionId Represent the id of the Mission to which the progress is related to. Yes.
Status

The current status of the Mission. The Status needs to be manually changed by the developer (except in the cases of claiming mission rewards which the SDK can do and which would move the state from PENDING_COLLECTION to COMPLETED). The Status attribute can have one of the following values:

  • INACTIVE – This is the initial state of a Mission.
  • PENDING_ACTIVATION – All the requirements for the Mission have been met and the Mission is awaiting activation from the user/developer. In this step, you should check if any activation costs are required.
  • IN_PROGRESS – The Mission is marked as in progress.
  • PENDING_COLLECTION – This status is used when all the Objectives have been met for this Mission. At this point, you can/should call the ClaimMissionsReward method if any rewards need to be given for this Mission.
  • COMPLETED – This Status marks that the Mission has been fully completed. Once this Status is set the Progress attribute will have its values completely removed.
No (the next container will not be automatically unlocked).
Progress A free-form Dictionary/JSON which allows the storing of any Progress Data that might be relevant in order to complete the Mission. This field should be kept as minimal as possible. Do not save full game states here! No (the progress needs to be updated manually by the developer.
LastCompleted The value that is populated by the SDK once the Status of a Mission has been set to COMPLETED. This value is defined in milliseconds. Yes.

The Container Progress component has the following attributes:

Name Definition Controlled by the SDK
ContainerId Represent the id of the Container to which the progress is related to. Yes.
Status

The current status of the Container. The Status needs to be manually changed by the developer. The Status attribute can have one of the following values:

  • INACTIVE – This is the initial state of a Container.
  • IN_PROGRESS – The Container is marked as in progress.
  • PENDING_COLLECTION – This status is used when all the Objectives have been met for this Container. At this point, you can/should call the ClaimContainersReward method if any rewards need to be given for this Mission.
  • COMPLETED – This Status marks that the Container has been fully completed.
No (the next container will not be automatically unlocked).
LastCompleted Value that is populated by the SDK once the Status of a Mission has been set to COMPLETED. This value is defined in milliseconds. Yes.

Implementation

In order to work with the Mission and Containers components you need to use the following methods:

The methods that you can use for updating the Mission and Container Progress components are the following:

Make sure when using the feature that you generate all the “Default Configuration Files” from the Spil SDK menu in order to create the “defaultMissionConfig.json” file.

In order to understand better how the feature flow should be implemented you will find an example below: