Platform Rule Sets for Cross Progression/Commerce
Summary
Platform Use Rulesets are an optional system to manage the unique rules that some platform partners have for how certain items are allowed/disallowed to transfer across different platforms.
Example Rulesets
These example rulesets are provided as a default with the "Load Defaults" button on the Ruleset page of the developer portal.
Real Money Purchase
This ruleset follows the cross commerce rules for each game platform. This applies to currency, and all other purchasable entitlements.
There are a couple things to note about this ruleset:
- PSN and Xbox Live does not allow currency purchased on other platforms to be used on PSN for in-game purchases.
- PSN does not allow currency purchased on PSN to be used on other platform.
- Where currency is allowed, the priority is to use it from the free/sweat pools before using currency that the user purchased.
| Real Money Purchase | Used on Steam | Used on Xbox Live | Used on PSN | Used on Nintendo | Used on Epic |
|---|---|---|---|---|---|
| Received from giveaway (Free) | 1 | 1 | 1 | 1 | 1 |
| Earned during gameplay (Sweat) | 2 | 2 | 2 | 2 | 2 |
| Purchased on Steam | 3 | ❌ | ❌ | 4 | 3 |
| Purchased on Xbox Live | 4 | 3 | ❌ | 5 | 4 |
| Purchased on PSN | ❌ | ❌ | 3 | ❌ | ❌ |
| Purchased on Nintendo | 5 | ❌ | ❌ | 3 | 5 |
| Purchased on Epic | 6 | ❌ | ❌ | 6 | 6 |
| Received from Twitch Drops | 7 | ❌ | ❌ | 7 | 7 |
| Received from Amazon Prime Rewards | 8 | ❌ | ❌ | 8 | 8 |
The raw version of this ruleset is:
{
"name": "Real Money Purchase",
"rules": {
"none": ["free","sweat","amazon","twitch","steam","xbox_live","nintendo_switch","epic"],
"psn": ["free","sweat","psn"],
"xbox_live": ["free","sweat","xbox_live"],
"nintendo_switch": ["sweat","nintendo_switch","amazon","twitch","steam","xbox_live","epic"]
}
}
Platform Exclusive Content
This ruleset is useful for content that is meant to only be used on the platform it was purchased on.
| Real Money Purchase | Used on Steam | Used on Xbox Live | Used on PSN | Used on Nintendo | Used on Epic |
|---|---|---|---|---|---|
| Purchased on Steam | 1 | ❌ | ❌ | ❌ | ❌ |
| Purchased on Xbox Live | ❌ | 1 | ❌ | ❌ | ❌ |
| Purchased on PSN | ❌ | ❌ | 1 | ❌ | ❌ |
| Purchased on Nintendo | ❌ | ❌ | ❌ | 1 | ❌ |
| Purchased on Epic | ❌ | ❌ | ❌ | ❌ | 1 |
The raw version of this ruleset is:
{
"name": "Platform Exclusive Content",
"rules": {
"epic": ["epic"],
"nintendo_switch": ["nintendo_switch"],
"psn": ["psn"],
"steam": ["steam"],
"xbox_live": ["xbox_live"],
"amazon": ["amazon"],
"twitch": ["twitch"]
}
}
Configuration
Rules
Each ruleset is comprised of a set of rules, which each have a list of buckets/platforms that define the priority order of how other buckets are used.
When creating rules, the none bucket is used as a fallback for any platform that is not explicitly defined in the ruleset.
Items
The Item configuration has a inventory_bucket_use_rule_set_id field for selecting which of these rulesets the item will follow. This system is OPT-IN by selecting a ruleset for the item.
- Items with no ruleset will always use inventory records without an inventory bucket.
- Items with a ruleset will ignore all inventory records without an inventory bucket.
Loot for a specific bucket
The Loot configuration has a use_inventory_bucket field that can be used to force the loot to use a specific inventory bucket.
Orders
Order entries have a use_inventory_bucket field that can be used select which bucket the loot should modify the inventory of. Note that Loot's use_inventory_bucket takes precedence over this.
When RallyHere submits an order as part of entitlement processing, all entries will be submitted with the associated use_inventory_bucket for that platform. Note that the support tool can also submit orders with the use_inventory_bucket set for testing purposes.
Loot operations when fulfilling an Order
When Loot for an item with a inventory_bucket_use_rule_set_id is granted via an order entry:
- If a
use_inventory_bucketis provided (either from the order entry, or the Loot), all operations will only consider/modify inventory with that bucket. - If a
use_inventory_bucketis NOT provided, operations have the following effects:check_greater_than_or_equal,check_less_than- checks the sum of ownership for the buckets that are in the rules (order doesn't matter) against the provided quantity.set- always failsadd(with a positive quantity) orsubtract(with a negative quantity) - always adds to thesweatbucketadd(with a negative quantity) orsubtract(with a positive quantity)- Following the sequence of buckets in the rules, subtract (down to 0, not allowing them to go negative) for each pool.
- If any remaining quantity hasn't been subtracted, subtract from the
sweatbucket, allowing it to go negative.- In practice, this should rarely happen, as we virtually always check the user has enough to subtract before doing so.
Inventory
A player that plays/purchases on multiple platforms may have multiple inventory records with the same item_id, but a different bucket with this system. When an item is configured to follow a ruleset, the client should only display inventory that is in the rules for the platform they are currently logged in on.
Here is an example player's inventory for item 123, which follows the "Real Money Purchase" ruleset from above.
| inventory_id | item_id | bucket | count |
|---|---|---|---|
| 6a763a99-6e68-4338-81fd-38ff01763ff5 | 123 | psn | 500 |
| 33295c54-2c61-4802-89ce-9a5600dce127 | 123 | xbox_live | 200 |
| 2c1235be-56b1-4f62-b81d-b7c9957731d0 | 123 | epic | 50 |
| ab3ea672-93e5-45c9-b760-fd2aaa83c64a | 123 | twitch | 9 |
| 11589784-91ad-4bda-b0ae-369dbaffe922 | 123 | sweat | 1000 |
This player has a total of 1759 of this item in their inventory. However, when following the ruleset, will not be able to access it all at the same time. When logging in from different platforms, here are the quantities the player will see in their UI:
- PSN = 1500
- Xbox = 1200
- Epic = 1259
- Nintendo = 1259
- Steam = 1259
Rule Sets Schema
| Name | Type | Required | Description |
|---|---|---|---|
| custom_data | object | No | Custom data associated with the resource |
| name | string | No | Name of the resource |
| description | string | No | Description of the resource |
| rules | object | No | The Inventory Bucket Use Rules by Inventory Bucket. |
| sandbox_id | string | No | ID of the Sandbox |
| last_modified_account_id | string | No | Account ID of the user who last modified the resource |
| last_modified_timestamp | string | No | Timestamp of when the resource was last modified |
| created_timestamp | string | No | Timestamp of when the resource was created |
| rule_set_id | string | Yes | The Inventory Bucket Use Rule Set ID. |
| legacy_rule_set_id | integer | Yes | The Legacy Inventory Bucket Use Rule Set ID. |