ADR-138: Technical Assessment for the new Backpack V2

More details about this document
Latest published version:
https://adr.decentraland.org/adr/ADR-138
Authors:
sandrade-dcl
lorux0
davidejensen
Feedback:
GitHub decentraland/adr (pull requests, new issue, open issues)
Edit this documentation:
GitHub View commits View commits on githistory.xyz

Need

This is a technical proposal for the needs described here: PRD: Backpack V2

image

The intention of this document is:

Involved teams

This initiative will require a cross team effort that will include the following teams:

Back-end dependencies

We currently have several lambdas endpoints (compatible with pagination) that are already being used by the current version of the Backpack to retrieve the information about the wearables. These endpoints are:

We're going to need to modify some of these endpoints in order to make them compatible with the new requirements. The following is a description of each one of the new requirements and how they will affect the current endpoints:

Possibility of including the collection id in the owned wearables lambdas

In order to give the user the possibility of seeing and manage any type of wearables, base, owned, third party together in the backpack, we will be able to include them as part of the result returned by the owned wearables endpoint instead of having to request them separately.

image image

In order to be able to do it, we will need to add a new parameter to the existing Owned Wearables endpoint that will be used to specify the collection ids, either Decentraland, 'urn:decentraland:off-chain:base-avatars' or any third party collection, and return the list of wearables that match with that collections. The new parameter will be called collectionId and will be a string that will accept any value. We should be able to specify more than one collection id separated by commas.

Endpoints affected:

Possibility of including the collection id in the owned emotes lambdas

In order to give the user the possibility of seeing and manage any type of emotes, base, owned, together in the backpack, we will be able to include them as part of the result returned by the owned emotes endpoint instead of having to request them separately.

image

In order to be able to do it, we will need to add a new parameter to the existing Owned Emotes endpoint that will be used to specify the collection ids, either Decentraland or base, and return the list of emotes that match with that collections. The new parameter will be called collectionId and will be a string that will accept any value. We should be able to specify more than one collection id separated by commas.

Endpoints affected:

Filter wearables/emotes by text

The user will be able to filter the wearables/emotes by text.

image

In order to be able to do it, we will need to add a new parameter to the existing endpoints that will be used to specify a text and return the list of wearables that match with that text. The new parameter will be called textFilter and will be a string that will accept any value.

Endpoints affected:

Filter wearables by category

The user will be able to filter the wearables by category.

image

In order to be able to do it, we will need to add a new parameter to some of the existing endpoints that will be used to specify the category and return the list of wearables that match with that category. The new parameter will be called category and will be a string that will accept any value.

Endpoints affected:

Sort wearables/emotes

The user will be able to sort the wearables/emotes by different criteria: newest/oldest, rarest/less rare or name A-Z/name Z-A.

image

In order to be able to do it, we will need to add a new parameter to the existing endpoints that will be used to specify the sorting criteria. The new parameter will be called sort and will be a string that will accept the following values:

Endpoints affected:

Get wearable market details (NEW ENDPOINT)

The user will be able to click on a wearable and open a modal with some details as:

image

In order to be able to do it, we will need to create a new endpoint that will return the details of a specific wearable:

Get a random list of equipped wearables (NEW ENDPOINT)

The user will be able to click on a [RANDOMIZE] button and equip a random list of wearables on his avatar.

image

In order to be able to do it, we will need to create a new endpoint that will return a random list of wearable ids from the owned wearables of the user. The wearables must be from each category, avoiding conflicts with hides and replaces whenever possible.

Outfits

image

The outfit information should be stored in the catalyst because we need to support multi-platform.

On the other hand, we should avoid storing it in profiles since it is information that only each individual user needs and does not need to be shared with other users. Adding it to the profiles would add an additional data transfer for each request unnecessarily.

We need to discuss as a team what is the best approach.

Regarding to the outfit image previews, they can be generated in the client when saving the outfit. There is no need to store the images in the catalysts.

We may encounter the need of checking that the wearables in the outfit are valid for the current user. (What happens if the user does not have the wearable anymore?)

Equip/save wearables

image

We though about several alternatives to avoid performance issues by saving the profile every time you equip an item:

  1. Equip all the items and only when the backpack is closed, make the request to save the profile.
  2. The profile will be updated/saved in intervals of 20 seconds (to be defined) or whenever the user closes the backpack.
  3. Save the profile when the user equips a wearable.

Saving the profile would mean that the nearby users will be able to see the changes as soon as possible. We should discuss what would be the best option taking in consideration the user experience and performance.

Emotes pagination

image

We will need to refactor the current emotes catalog, the same way on how we did on wearables catalog, so its supports pagination. We will also reduce kernel responsibilities, moving all (or most) of the emote handling in the renderer. No need backend support. Open ticket: #4429

BackpackEditorV2

In Unity we are going to implement a new UI for the backpack v2 requirements, including all the components needed.

We will keep retro-compatibility with the old one, including the UI, service calls and dependencies.

License

Copyright and related rights waived via CC0-1.0. DRAFT Review